Example #1
0
 internal static TypeInformation GetTypeInformation(Type type)
 {
     lock (typeNameCache)
     {
         TypeInformation typeInformation = null;
         if (!typeNameCache.TryGetValue(type, out typeInformation))
         {
             bool hasTypeForwardedFrom;
             string assemblyName = FormatterServices.GetClrAssemblyName(type, out hasTypeForwardedFrom);
             typeInformation = new TypeInformation(FormatterServices.GetClrTypeFullName(type), assemblyName, hasTypeForwardedFrom);
             typeNameCache.Add(type, typeInformation);
         }
         return typeInformation;
     }
 }
 internal static TypeInformation GetTypeInformation(Type type)
 {
     lock (typeNameCache)
     {
         TypeInformation information = null;
         if (!typeNameCache.TryGetValue(type, out information))
         {
             bool flag;
             string clrAssemblyName = FormatterServices.GetClrAssemblyName(type, out flag);
             information = new TypeInformation(FormatterServices.GetClrTypeFullName(type), clrAssemblyName, flag);
             typeNameCache.Add(type, information);
         }
         return information;
     }
 }
        public static TypeInformation[] GetTypes(object com_obj)
        {
            var obj = (IDispatch)com_obj;
            int count;
            obj.GetTypeInfoCount(out count);

            // MSDN says count is 0 or 1 :P
            var ret = new TypeInformation[count];

            for (int i = 0; i < count; i++)
            {
                ITypeInfo typeInfo;
                obj.GetTypeInfo(0, 0, out typeInfo);
                string strName, strDocString, strHelpFile;
                int dwHelpContext;
                typeInfo.GetDocumentation(-1, out strName, out strDocString, out dwHelpContext, out strHelpFile);
                ret[i] = new TypeInformation
                             {
                                 Name = strName,
                                 Documentation = strDocString,
                                 HelpContext = dwHelpContext,
                                 HelpFile = strHelpFile
                             };
            }

            return ret;
        }
 internal static TypeInformation GetTypeInformation(Type type)
 { 
     lock (typeNameCache)
     {
         TypeInformation typeInformation = null;
         if (!typeNameCache.TryGetValue(type, out typeInformation)) 
         {
             typeInformation = new TypeInformation(FormatterServices.GetClrTypeFullName(type), FormatterServices.GetClrAssemblyName(type)); 
             typeNameCache.Add(type, typeInformation); 
         }
         return typeInformation; 
     }
 }
Example #5
0
 public CompilerServices(string name, TypeInformation compiler)
 {
     Name = name;
     ProjectCompiler = compiler;
 }