io.IoCLRAssembly.createObject C# (CSharp) Method

createObject() public static method

public static createObject ( IoState state ) : IoCLRAssembly
state IoState
return IoCLRAssembly
        public static new IoCLRAssembly createObject(IoState state)
        {
            IoCLRAssembly cf = new IoCLRAssembly();
            return cf.proto(state).clone(state) as IoCLRAssembly;
        }

Usage Example

コード例 #1
0
ファイル: IoCLR.cs プロジェクト: MilkTool/io-clr
        public static IoObject slotLoadAssembly(IoObject target, IoObject locals, IoObject message)
        {
            IoCLR         self         = target as IoCLR;
            IoMessage     m            = message as IoMessage;
            IoSeq         assemblyName = m.localsSymbolArgAt(locals, 0);
            IoCLRAssembly asm          = self.loadedAssemblies[assemblyName.value] as IoCLRAssembly;

            if (asm != null)
            {
                return(asm);
            }

            asm = IoCLRAssembly.createObject(target.state);

            asm.assembly = Assembly.LoadWithPartialName(assemblyName.value);
            if (asm.assembly == null)
            {
                return(self);
            }

            self.loadedAssemblies[assemblyName.value] = asm;

            asm.assemblyTypes      = asm.assembly.GetTypes();
            asm.assemblyNamespaces = new Hashtable();
            foreach (Type t in asm.assemblyTypes)
            {
                string theNameSpace = t.FullName.LastIndexOf(".") == -1 ? "-" : t.FullName.Substring(0, t.FullName.LastIndexOf("."));
                string theClass     = t.FullName.LastIndexOf(".") == -1 ? t.FullName : t.FullName.Substring(t.FullName.LastIndexOf(".") + 1);
                if (theClass.Equals("Form"))
                {
                    int i = 0;
                }
                if (asm.assemblyNamespaces.ContainsKey(theNameSpace))
                {
                    Hashtable a = asm.assemblyNamespaces[theNameSpace] as Hashtable;
                    a[theClass] = t;
                }

                else
                {
                    Hashtable classes = new Hashtable();
                    classes[theClass] = t;
                    asm.assemblyNamespaces[theNameSpace] = classes;
                }
            }
            return(asm);
        }
All Usage Examples Of io.IoCLRAssembly::createObject