Пример #1
0
        internal bool ImportComComponent(string path, OutputMessageCollection outputMessages, string outputDisplayName)
        {
            var importer = new ComImporter(path, outputMessages, outputDisplayName);

            if (importer.Success)
            {
                var typeLibs = new List <TypeLib>();

                // Add TypeLib objects from importer...
                if (_typeLibs != null)
                {
                    typeLibs.AddRange(_typeLibs);
                }

                if (importer.TypeLib != null)
                {
                    typeLibs.Add(importer.TypeLib);
                }
                _typeLibs = typeLibs.ToArray();

                // Add ComClass objects from importer...
                var comClasses = new List <ComClass>();
                if (_comClasses != null)
                {
                    comClasses.AddRange(_comClasses);
                }

                if (importer.ComClasses != null)
                {
                    comClasses.AddRange(importer.ComClasses);
                }
                _comClasses = comClasses.ToArray();
            }
            return(importer.Success);
        }
Пример #2
0
        internal bool ImportComComponent(string path, OutputMessageCollection outputMessages, string outputDisplayName)
        {
            ComImporter importer = new ComImporter(path, outputMessages, outputDisplayName);

            if (importer.Success)
            {
                ArrayList list = new ArrayList();

                // Add TypeLib objects from importer...
                if (_typeLibs != null)
                {
                    list.AddRange(_typeLibs);
                }
                if (importer.TypeLib != null)
                {
                    list.Add(importer.TypeLib);
                }
                _typeLibs = (TypeLib[])list.ToArray(typeof(TypeLib));

                // Add ComClass objects from importer...
                list.Clear();
                if (_comClasses != null)
                {
                    list.AddRange(_comClasses);
                }
                if (importer.ComClasses != null)
                {
                    list.AddRange(importer.ComClasses);
                }
                _comClasses = (ComClass[])list.ToArray(typeof(ComClass));
            }
            return(importer.Success);
        }
 internal bool ImportComComponent(string path, OutputMessageCollection outputMessages, string outputDisplayName)
 {
     ComImporter importer = new ComImporter(path, outputMessages, outputDisplayName);
     if (importer.Success)
     {
         ArrayList list = new ArrayList();
         if (this.typeLibs != null)
         {
             list.AddRange(this.typeLibs);
         }
         if (importer.TypeLib != null)
         {
             list.Add(importer.TypeLib);
         }
         this.typeLibs = (TypeLib[]) list.ToArray(typeof(TypeLib));
         list.Clear();
         if (this.comClasses != null)
         {
             list.AddRange(this.comClasses);
         }
         if (importer.ComClasses != null)
         {
             list.AddRange(importer.ComClasses);
         }
         this.comClasses = (ComClass[]) list.ToArray(typeof(ComClass));
     }
     return importer.Success;
 }