Esempio n. 1
0
        // returns strongly typed, verified components/interfaces in an application
        static void GetAllComponentsForRemove(ComAdminAppInfo appInfo, out IList<ComponentDefinition<Guid>> outComps)
        {
            outComps = new List<ComponentDefinition<Guid>>();

            foreach (ComAdminClassInfo classInfo in appInfo.Classes)
            {
                ComponentDefinition<Guid> outComp;


                outComp = new ComponentDefinition<Guid>(classInfo.Clsid);

                foreach (ComAdminInterfaceInfo interfaceInfo in classInfo.Interfaces)
                    outComp.AddInterface(interfaceInfo.Iid, null);
                outComp.AddInterface(typeof(IMetadataExchange).GUID, null);
                outComps.Add(outComp);
            }
        }
Esempio n. 2
0
        // returns strongly typed, verified components/interfaces in an application
        static void GetAllComponentsForAdd(ComAdminAppInfo appInfo, bool mex, out IList<ComponentDefinition<Guid>> outComps)
        {
            outComps = new List<ComponentDefinition<Guid>>();

            foreach (ComAdminClassInfo classInfo in appInfo.Classes)
            {
                ComponentDefinition<Guid> outComp;

                if (!ValidateClass(classInfo))
                {
                    continue;

                }

                outComp = new ComponentDefinition<Guid>(classInfo.Clsid);

                foreach (ComAdminInterfaceInfo interfaceInfo in classInfo.Interfaces)
                {
                    if (ComPlusTypeValidator.VerifyInterface(interfaceInfo, options.AllowReferences, classInfo.Clsid))
                        outComp.AddInterface(interfaceInfo.Iid, ComPlusTypeValidator.FetchAllMethodsForInterface(interfaceInfo));
                }
                if (mex && (outComp.Interfaces != null))
                    outComp.AddInterface(typeof(IMetadataExchange).GUID, null);
                if (outComp.Interfaces != null)
                    outComps.Add(outComp);
                else
                    ToolConsole.WriteWarning(SR.GetString(SR.NoneOfTheSpecifiedInterfacesForComponentWereFoundSkipping, Tool.Options.ShowGuids ? classInfo.Clsid.ToString("B") : classInfo.Name));

            }
        }