public static AssemblyDataItemSet BuildAssemblyDataItemsMonoCecil()
        {
            var asmDataItemsSet = new AssemblyDataItemSet();

            ModuleDefinition asmEngine = null;
            ModuleDefinition asmEditor = null;
            try
            {
                asmEngine = ModuleDefinition.ReadModule(DirectoryUtil.EngineDllLocation);
                asmEditor = ModuleDefinition.ReadModule(DirectoryUtil.EditorDllLocation);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
            }

            var engineDataItems = LoadAssemblyDataItemsMonoCecil(asmEngine);
            Console.Out.WriteLine("engineDataItems.Count = {0}", engineDataItems.Count);
            var editorDataItems = LoadAssemblyDataItemsMonoCecil(asmEditor);
            Console.Out.WriteLine("editorDataItems.Count = {0}", editorDataItems.Count);

            Debug.Assert(engineDataItems != null);
            Debug.Assert(editorDataItems != null);

            asmDataItemsSet.AddDataItems(engineDataItems);
            asmDataItemsSet.AddDataItems(editorDataItems);
            asmDataItemsSet.EngineAssemblySize = engineDataItems.Count;
            asmDataItemsSet.EditorAssemblySize = editorDataItems.Count;
            asmDataItemsSet.engineModule = asmEngine;
            asmDataItemsSet.editorModule = asmEditor;

            return asmDataItemsSet;
        }
        /// <summary>
        /// ReloadAllProjectData
        /// </summary>
        public void ReloadAllProjectData()
        {
            asmset = AssemblyDataBuilder.BuildAssemblyDataItemsMonoCecil(asmLocation);
            docSet = DocumentDataBuilder.BuildDocumentDataItems(docPath);

            asmset.Bind(docSet);
            PopulateAllItems(asmset, docSet);
        }
        private void PopulateAllItems(AssemblyDataItemSet asmSet, DocumentDataItemSet docSet)
        {
            var apiMissingList = docSet.GetAPIMissingDocumentDataItems();             //documents with no APIs => shouldn't really happen.

            _allItems.Clear();
            _allItems.AddRange(asmSet.Items.ToArray());

            var lst = apiMissingList.ToList();

            _allItems.AddRange(lst.ToArray());

            Console.WriteLine("|docSet| = {1}; |asmSet| = {0}; |apiMissingList| = {2}; |allItems| = {3}", asmSet.Items.Count,
                              docSet._documentList.Count, lst.Count, _allItems.Count);

            Debug.Assert(_allItems.Count == lst.Count + asmSet.Items.Count);
        }
示例#4
0
        public static AssemblyDataItemSet BuildAssemblyDataItemsMonoCecil(AssemblyLocation asmLocation)
        {
            var asmDataItemsSet = new AssemblyDataItemSet();

            ModuleDefinition asmEngine = null;
            ModuleDefinition asmEditor = null;

            try
            {
                asmEngine = ModuleDefinition.ReadModule(asmLocation.engineDllPath);
                asmEditor = ModuleDefinition.ReadModule(asmLocation.editorDllPath);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
            }

            var engineDataItems = LoadAssemblyDataItemsMonoCecil(asmEngine);

            Console.Out.WriteLine("engineDataItems.Count = {0}", engineDataItems.Count);
            var editorDataItems = LoadAssemblyDataItemsMonoCecil(asmEditor);

            Console.Out.WriteLine("editorDataItems.Count = {0}", editorDataItems.Count);

            Debug.Assert(engineDataItems != null);
            Debug.Assert(editorDataItems != null);

            asmDataItemsSet.AddDataItems(engineDataItems);
            asmDataItemsSet.AddDataItems(editorDataItems);
            asmDataItemsSet.EngineAssemblySize = engineDataItems.Count;
            asmDataItemsSet.EditorAssemblySize = editorDataItems.Count;
            asmDataItemsSet.engineModule       = asmEngine;
            asmDataItemsSet.editorModule       = asmEditor;

            return(asmDataItemsSet);
        }
        private void PopulateAllItems(AssemblyDataItemSet asmSet, DocumentDataItemSet docSet)
        {
            var apiMissingList = docSet.GetAPIMissingDocumentDataItems(); //documents with no APIs => shouldn't really happen.

            _allItems.Clear();
            _allItems.AddRange(asmSet.Items.ToArray());

            var lst = apiMissingList.ToList();
            _allItems.AddRange(lst.ToArray());

            Console.WriteLine("|docSet| = {1}; |asmSet| = {0}; |apiMissingList| = {2}; |allItems| = {3}", asmSet.Items.Count,
                              docSet._documentList.Count, lst.Count, _allItems.Count);

            Debug.Assert(_allItems.Count == lst.Count + asmSet.Items.Count);
        }
        /// <summary>
        /// ReloadAllProjectData
        /// </summary>
        public void ReloadAllProjectData()
        {
            asmset = AssemblyDataBuilder.BuildAssemblyDataItemsMonoCecil();
            docSet = DocumentDataBuilder.BuildDocumentDataItems();

            asmset.Bind(docSet);
            PopulateAllItems(asmset, docSet);
        }