Example #1
0
        public void InitStructureEnums()
        {
            Console.WriteLine("Initializing Structure Enums...");
            Structure = new Dictionary <string, IEnumerable <MFilesObject> >();

            if (ObjectTypes == null)
            {
                ObjectTypes = new ObjectTypes(DevelopertTool.Vault);
            }
            Structure["Object"] = ObjectTypes;

            if (ClassTypes == null)
            {
                ClassTypes = new ClassTypes(DevelopertTool.Vault);
            }
            Structure["Class"] = ClassTypes;

            if (PropertyDefinitions == null)
            {
                PropertyDefinitions = new PropertyDefinitions(DevelopertTool.Vault);
            }
            Structure["PropertyDefinition"] = PropertyDefinitions;

            if (ValueLists == null)
            {
                ValueLists = new ValueLists(DevelopertTool.Vault);
            }
            // Add later
        }
Example #2
0
        private void RemoveLeastRecentlyUsedEntry()
        {
            var leastRecentlyUsedEntry = ValueLists[MaxSize - 1];

            Debug.WriteLine($"Removing least recently used entry: {leastRecentlyUsedEntry.Hash}");

            ValueLists.RemoveAt(MaxSize - 1);

            LastIndexCache.Remove(leastRecentlyUsedEntry.Hash);
        }
Example #3
0
        private void MoveToFrontOfCache(CacheEntry entry)
        {
            int lastIndex = LastIndexCache[entry.Hash];

            Debug.WriteLine($"Moving existing entry to front of cache: {entry.Hash}");

            ValueLists.RemoveAt(lastIndex);

            ValueLists.Insert(0, entry);

            UpdateIndices(entry.Hash);
        }
Example #4
0
        private void MakeHTable(ref Word._Document Doc, string TableName, List <string> Header, params List <string>[] ValueLists)
        {
            try
            {
                string EndOfDocFlag = "\\endofdoc";


                Word.Paragraph McuParagraph;
                Word.Range     AtEndOfDoc;
                AtEndOfDoc   = Doc.Bookmarks.get_Item(EndOfDocFlag).Range;
                McuParagraph = Doc.Content.Paragraphs.Add(AtEndOfDoc);
                McuParagraph.Range.Font.Size = 16;
                McuParagraph.Range.Text      = TableName;
                McuParagraph.Range.InsertParagraphAfter();

                Word.Table McuTable;
                AtEndOfDoc = Doc.Bookmarks.get_Item(EndOfDocFlag).Range;
                McuTable   = Doc.Tables.Add(AtEndOfDoc, ValueLists[0].Count + 1, Header.Count);
                McuTable.Borders.InsideLineStyle  = Word.WdLineStyle.wdLineStyleSingle;
                McuTable.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle;

                foreach (var row in Header.Select((value, index) => new { value, index }))
                {
                    McuTable.Cell(1, row.index + 1).Range.Text = row.value;
                    McuTable.Cell(1, row.index + 1).Range.Shading.BackgroundPatternColor = Word.WdColor.wdColorGray10;
                    McuTable.Cell(1, row.index + 1).Range.Font.Bold = 1;
                }

                foreach (var col in ValueLists.Select((value, index) => new { value, index }))
                {
                    foreach (var row in col.value.Select((value, index) => new { value, index }))
                    {
                        McuTable.Cell(row.index + 2, col.index + 1).Range.Text = row.value;
                    }
                    McuTable.Columns[col.index + 1].AutoFit();
                }
                McuTable.Columns[1].AutoFit();
            }
            catch
            {
            }
        }
Example #5
0
 public void InitValueLists()
 {
     Console.WriteLine("[INFO] Initializing ValueLists...");
     ValueLists = new ValueLists(DevelopertTool.Vault);
 }