public void Add_Element() { var intellisense = new IntelliSense(); intellisense.AddWord("System"); Assert.Equal(6, intellisense.Depth); }
public void Add_Elements() { var intellisense = new IntelliSense(); intellisense.AddWord("System"); intellisense.AddWord("System.IO"); intellisense.AddWord("System.Threading"); intellisense.AddWord("System.Text"); Assert.Equal(16, intellisense.Depth); }
public void Find_Elements_That_Do_Not_Exist_On_Trie() { var intellisense = new IntelliSense(); intellisense.AddWord("System"); intellisense.AddWord("Microsoft"); intellisense.AddWord("System.IO"); intellisense.AddWord("Microsoft.AspNetCore.Mvc"); intellisense.AddWord("System.Threading"); intellisense.AddWord("System.Text"); var listOfItems = intellisense.Find("System.Drawing"); Assert.Empty(listOfItems); }
public void Find_Elements_With_Prefix_System() { var intellisense = new IntelliSense(); intellisense.AddWord("System"); intellisense.AddWord("Microsoft"); intellisense.AddWord("System.IO"); intellisense.AddWord("Microsoft.AspNetCore.Mvc"); intellisense.AddWord("System.Threading"); intellisense.AddWord("System.Text"); var listOfItems = intellisense.Find("System."); Assert.Equal("System.IO", listOfItems[0]); Assert.Equal("System.Threading", listOfItems[1]); Assert.Equal("System.Text", listOfItems[2]); }
public GestItemsUC(AccountUC Account) { InitializeComponent(); account = Account; LVGestItems.Columns.Add("Nom", 200, HorizontalAlignment.Center); LVGestItems.Columns.Add("Action", 200, HorizontalAlignment.Center); this.ItemTxtBox.KeyUp += (s, e) => { IntelliSense.AutoCompleteTextBox(ItemTxtBox, this.litPopup, IntelliSense.ItemsList, e); }; AutoDeletionTimer = new System.Timers.Timer(Convert.ToDouble(NUDAutoDeletion.Value * 1000)); AutoDeletionTimer.Elapsed += new System.Timers.ElapsedEventHandler(PerformAutoDeletion); if (AutoDeletionBox.Checked) { AutoDeletionTimer.Start(); } }
private static void CheckBlueSheepDatas() { // Create the BlueSheep needed folders string applicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string blueSheepPath = Path.Combine(applicationDataPath, "BlueSheep"); if (!Directory.Exists(blueSheepPath)) { Directory.CreateDirectory(blueSheepPath); } if (!Directory.Exists(Path.Combine(blueSheepPath, "Accounts"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Accounts")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Groups"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Groups")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Temp"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Temp")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Paths"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Paths")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "IAs"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "IAs")).Attributes = FileAttributes.Normal; } if (!Directory.Exists(Path.Combine(blueSheepPath, "Logs"))) { Directory.CreateDirectory(Path.Combine(blueSheepPath, "Logs")).Attributes = FileAttributes.Normal; } string bsConfPath = Path.Combine(blueSheepPath, "bs.conf"); if (File.Exists(bsConfPath)) { StreamReader sr = new StreamReader(bsConfPath); string path = sr.ReadLine(); if (Directory.Exists(Path.Combine(path, "app", "content", "maps"))) { ActualMainForm.DofusPath = path; } else { sr.Close(); DofusPathForm frm = new DofusPathForm(ActualMainForm); frm.ShowDialog(); } } else { DofusPathForm frm = new DofusPathForm(ActualMainForm); frm.ShowDialog(); } FileInfo fileInfo = new FileInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\BlueSheep\Logs.txt"); fileInfo.Delete(); using (fileInfo.Create()) { } //fileInfo = new FileInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\BlueSheep\Packets.txt"); //fileInfo.Delete(); //using (fileInfo.Create()) //{ //} I18NFileAccessor i18NFileAccessor = new I18NFileAccessor(); if (File.Exists(@"C:\Program Files (x86)\Dofus2\app\data\i18n\i18n_fr.d2i")) { string path = @"C:\Program Files (x86)\Dofus2\app\data\i18n\i18n_fr.d2i"; i18NFileAccessor.Init(path); I18N i18N = new I18N(i18NFileAccessor); GameData.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\data\common"); MapsManager.Init(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Dofus2\app\content\maps"); } else if (File.Exists(bsConfPath)) { List <string> PaysList = new List <string>(); PaysList.AddRange(new List <string>() { "fr", "en", "ja", "es", "de", "pt" }); foreach (string pays in PaysList) { string combinedPath = Path.Combine(ActualMainForm.DofusPath, "app", "data", "i18n", "i18n_" + pays + ".d2i"); if (File.Exists(combinedPath)) { i18NFileAccessor.Init(combinedPath); break; } } I18N i18N = new I18N(i18NFileAccessor); GameData.Init(Path.Combine(ActualMainForm.DofusPath, "app", "data", "common")); MapsManager.Init(Path.Combine(ActualMainForm.DofusPath, "app", "content", "maps")); } //else //{ // i18NFileAccessor.Init(Path.Combine(ActualMainForm.DofusPath, "app", "data", "i18n", "i18n_fr.d2i")); // I18N i18N = new I18N(i18NFileAccessor); // GameData.Init(@"D:\Dofus2\app\data\common"); // MapsManager.Init(@"D:\Dofus2\app\content\maps"); //} IntelliSense.InitMonsters(); IntelliSense.InitItems(); IntelliSense.InitServers(); }
public AbstractTerminal(TerminalInitializeInfo info) { TerminalEmulatorPlugin.Instance.LaterInitialize(); _session = info.Session; //_invalidateParam = new InvalidateParam(); _document = new TerminalDocument(info.InitialWidth, info.InitialHeight); _document.SetOwner(_session.ISession); _afterExitLockActions = new List<AfterExitLockDelegate>(); _decoder = new ISO2022CharDecoder(this, EncodingProfile.Get(info.Session.TerminalSettings.Encoding)); _terminalMode = TerminalMode.Normal; _currentdecoration = TextDecoration.Default; _manipulator = new GLineManipulator(); _scrollBarValues = new ScrollBarValues(); _logService = new LogService(info.TerminalParameter, _session.TerminalSettings); _promptRecognizer = new PromptRecognizer(this); _intelliSense = new IntelliSense(this); _commandResultRecognizer = new PopupStyleCommandResultRecognizer(this); if (info.Session.TerminalSettings.LogSettings != null) _logService.ApplyLogSettings(_session.TerminalSettings.LogSettings, false); //event handlers ITerminalSettings ts = info.Session.TerminalSettings; ts.ChangeEncoding += delegate(EncodingType t) { this.Reset(); }; ts.ChangeRenderProfile += delegate(RenderProfile prof) { TerminalControl tc = _session.TerminalControl; if (tc != null) tc.ApplyRenderProfile(prof); }; }
public void Start(MetaData meta) { IntelliSense = new IntelliSense(meta); }