How to create your own namespace and System objects?

It says http://msdn.microsoft.com/en-us/library/fa13yay7%28v=VS.90%29.aspx (see also http://msdn.microsoft.com/en-us/library/s4wcexbc % 28VS.90% 29.aspx )

Use this option if you want to define or create your own System namespace and objects.

But how? Where can I find some examples?

Update: of course, my question is not how to create a namespace or class, but an example of an approximate system architecture (UML schema and source code).

For example, can this be used to port .NET to other processors such as iphone? Mono uses this?

Is there any smallest possible example instead of a whole commercial clr to learn from?

+3
source share
2 answers

I don’t know why you want to do this, but you just need to create a special assembly “System” (for example, a standard library) and use it as a link in another project using /nostdlib+.

namespace System 
{
  public sealed class String : IComparable, ICloneable, IConvertible, IComparable<string>, IEnumerable<char>, IEnumerable, IEquatable<string>
  {
     ...
  }
}
+4
source

How? Just write the code. Create a namespace called "System" that contains the Object class and a class called String, and the compiler will pick it up and use it instead of the version of the framework class library. This is how the framework team does it. All you have to do is copy all your work yourself, and you can also be in the class library that provides the business.

, , , System , . - ! - - , , System.Collections.Generic.IEnumerator<T>, , "", , "foreach". - , , , #. .

+7

Source: https://habr.com/ru/post/1767310/


All Articles