public SPDefinitionWindow() { InitializeComponent(); def = Program.Configs[Program.SelectedConfig].GetSMDef(); if (def == null) { MessageBox.Show("The config was not able to parse a sourcepawn definiton.", "Stop", MessageBoxButton.OK, MessageBoxImage.Warning); this.Close(); return; } List<SPDefEntry> defList = new List<SPDefEntry>(); for (int i = 0; i < def.Functions.Length; ++i) { defList.Add((SPDefEntry)def.Functions[i]); } for (int i = 0; i < def.Constants.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Constants[i], Entry = "Constant" }); } for (int i = 0; i < def.Types.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Types[i], Entry = "Type" }); } for (int i = 0; i < def.MethodNames.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.MethodNames[i], Entry = "Method" }); } for (int i = 0; i < def.Properties.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Properties[i], Entry = "Property" }); } defList.Sort((a, b) => { return string.Compare(a.Name, b.Name); }); defArray = defList.ToArray(); int defArrayLength = defArray.Length; items = new ListViewItem[defArrayLength]; for (int i = 0; i < defArrayLength; ++i) { items[i] = new ListViewItem() { Content = defArray[i].Name, Tag = defArray[i].Entry }; SPBox.Items.Add(items[i]); } searchTimer.Elapsed += searchTimer_Elapsed; }
public SPDefinitionWindow() { InitializeComponent(); def = Program.Configs[Program.SelectedConfig].GetSMDef(); if (def == null) { MessageBox.Show("The config was not able to parse a sourcepawn definiton.", "Stop", MessageBoxButton.OK, MessageBoxImage.Warning); this.Close(); return; } List <SPDefEntry> defList = new List <SPDefEntry>(); for (int i = 0; i < def.Functions.Length; ++i) { defList.Add((SPDefEntry)def.Functions[i]); } for (int i = 0; i < def.Constants.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Constants[i], Entry = "Constant" }); } for (int i = 0; i < def.Types.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Types[i], Entry = "Type" }); } for (int i = 0; i < def.MethodNames.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.MethodNames[i], Entry = "Method" }); } for (int i = 0; i < def.Properties.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Properties[i], Entry = "Property" }); } defList.Sort((a, b) => { return(string.Compare(a.Name, b.Name)); }); defArray = defList.ToArray(); int defArrayLength = defArray.Length; items = new ListViewItem[defArrayLength]; for (int i = 0; i < defArrayLength; ++i) { items[i] = new ListViewItem() { Content = defArray[i].Name, Tag = defArray[i].Entry }; SPBox.Items.Add(items[i]); } searchTimer.Elapsed += searchTimer_Elapsed; }
public void LoadSMDef() { if (this.SMDef != null) { return; } try { this.SMDef = SourcepawnCondenser.Condense(SMDirectories); } catch (Exception) { this.SMDef = new CondensedSourcepawnDefinition(); //this could be dangerous... } }
public void InvalidateSMDef() { this.SMDef = null; }
public void LoadSMDef() { if (this.SMDef != null) { return; } try { this.SMDef = SourcepawnCondenser.Condense(SMDirectories); } catch (Exception) { this.SMDef = new CondensedSourcepawnDefinition(); //this could be dangerous... } }
public void InvalidateSMDef() { this.SMDef = null; }