public aj.c b(cv A_0) { aj.a key = new aj.a(A_0); int num = PluginCore.cq.l.c["MyMonsters"].c(); for (int i = 0; i < num; i++) { string str = k.b(PluginCore.cq.l.c["MyMonsters"].a(i)[0]); if (str != "<DEFAULT>") { if (this.c.ContainsKey(key) && this.c[key].ContainsKey(i)) { if (this.c[key][i]) { PluginCore.e(string.Format("Entry \"{0}\" match! (Result cached)", str)); return(this.c(str)); } PluginCore.e(string.Format("Entry \"{0}\" does not match. (Result cached)", str)); } else { bool flag; if (dk.a(key, str, A_0, out flag)) { PluginCore.e(string.Format("Entry \"{0}\" match!", str)); return(this.c(str)); } PluginCore.e(string.Format("Entry \"{0}\" does not match.", str)); } } } PluginCore.e("No rules match selected monster, using default entry."); return(this.d()); }
public Playlist GetPlaylistfromPath(string path) { using (var db = new SQLiteConnection(Tables.DBPath)) { try { if (db.Table <Library.TableModels.Playlist>().Any()) { Playlist m3 = PluginCore.Instance() .GetPlaylist( new FileInfo(db.Table <Library.TableModels.Playlist>().Where(c => c.Path == path).First().Path).Extension.ToLower ()); m3.ID = db.Table <Library.TableModels.Playlist>().First().ID; m3.Path = db.Table <Library.TableModels.Playlist>().First().Path; CPlaylistID = m3.ID; return(m3); } } catch { } } return(null); }
public Completion(PluginCore.Helpers.SimpleIni config, Settings settings) { this.settings = settings; lang = ScintillaControl.Configuration.GetLanguage("css"); InitProperties(GetSection(config, "Properties")); InitLists(GetSection(config, "Lists")); }
public void d() { if ((this.i != 0) && (this.j != this.i)) { this.m = this.i; PluginCore.cq.ax.get_Actions().UseItem(this.i, 0); if (this.e.ContainsKey(this.i)) { b5.a a = this.e[this.i]; a.j++; if (a.j >= er.i("BlacklistCorpseOpenAttemptCount")) { a.j = 0; a.k = DateTimeOffset.Now; cv cv = PluginCore.cq.p.d(this.i); string str = "???"; if (cv != null) { str = cv.e(); } PluginCore.e("Blacklisting unopenable corpse \"" + str + "\" for " + er.i("BlacklistCorpseOpenTimeoutSeconds").ToString() + " seconds."); } } } }
public void EventKey(PluginCore.KeyEvent k) { ScintillaNet.ScintillaControl currentSci = ASContext.CurSciControl; int linePos = currentSci.LineFromPosition(currentSci.CurrentPos); string line = currentSci.GetLine(linePos); string[] str = DivideStringCode(line); if (str == null) { // MessageBox.Show("non รจ stato diviso niente"); return; } else { if (SearchForOperators(str[1], false)) { string newString = Reformat(str[0] + ";"); currentSci.GotoPos(currentSci.PositionFromLine(linePos)); currentSci.BeginUndoAction(); currentSci.DelLineRight(); currentSci.InsertText(currentSci.CurrentPos, newString); currentSci.EndUndoAction(); currentSci.GotoPos(currentSci.CurrentPos + newString.Length); } } }
public static void a(string A_0, k A_1) { string[] files = Directory.GetFiles(PluginCore.ci, "*.usd"); foreach (string str in files) { string[] strArray2 = str.Split(new char[] { '\\' }); string str2 = strArray2[strArray2.Length - 1]; if (str2 == PluginCore.cq.l.m) { er.b(A_0, A_1); } else { bf bf = new bf(str); v v = bf["Settings"].a(0, k.a(A_0)); if (v == null) { v v2 = new v(bf["Settings"]); v2[0] = k.a(A_0); v2[1] = A_1; bf["Settings"].c(v2); } else { v[1] = A_1; } bf.c(str); } } string[] strArray4 = new string[] { "Done saving setting ", A_0, " to all profiles. (Changed ", files.Length.ToString(), " profiles)" }; PluginCore.e(string.Concat(strArray4)); }
public void b(int A_0) { if (this.b.ContainsKey(A_0)) { Dictionary <int, int> dictionary; int num2; (dictionary = this.b)[num2 = A_0] = dictionary[num2] + 1; } else { this.b[A_0] = 1; } if (this.b[A_0] > er.i("BlacklistMonsterAttemptCount")) { if (PluginCore.cq.n.f.ContainsKey(A_0)) { string str = "???"; cv cv = PluginCore.cq.p.d(A_0); if (cv != null) { str = cv.g(); } int num = er.i("BlacklistMonsterTimeoutSeconds"); PluginCore.e("Blacklisting unhittable monster " + str + " (" + A_0.ToString() + ") for " + num.ToString() + " seconds."); PluginCore.cq.n.f[A_0].a(TimeSpan.FromSeconds((double)num)); } this.b.Remove(A_0); } }
internal MainWindow(string directory) : base(Gtk.WindowType.Toplevel) { log.Debug("Beginning Program"); Build(); roomeditor1.SetClient(areaviewer1); roomeditor1.SetObjectGroupEditor(objectgroupeditor1); dungeonMinimap.TileSelectedEvent += delegate(object sender) { Room room = dungeonMinimap.GetRoom(); SetRoom(room); }; worldMinimap.TileSelectedEvent += delegate(object sender) { Room room = worldMinimap.GetRoom(); SetRoom(room); }; areaviewer1.HoverChangedEvent += delegate() { if (areaviewer1.HoveringIndex == -1) { statusbar1.Push(1, "Selected Tile: 0x" + areaviewer1.SelectedIndex.ToString("X2")); } else { statusbar1.Push(1, "Hovering Tile: 0x" + areaviewer1.HoveringIndex.ToString("X2")); } }; areaviewer1.TileSelectedEvent += delegate(object sender) { statusbar1.Push(1, "Selected Tile: 0x" + areaviewer1.SelectedIndex.ToString("X2")); }; roomeditor1.HoverChangedEvent += delegate() { if (roomeditor1.HoveringIndex == -1) { statusbar1.Push(1, "Selected Tile: 0x" + areaviewer1.SelectedIndex.ToString("X2")); } else { statusbar1.Push(2, "Hovering Tile: (" + roomeditor1.HoveringX + ", " + roomeditor1.HoveringY + ")"); } }; worldSpinButton.Adjustment = new Adjustment(0, 0, 5, 1, 0, 0); dungeonSpinButton.Adjustment = new Adjustment(0, 0, 15, 1, 0, 0); pluginCore = new PluginCore(this); LoadPlugins(); if (directory != "") { OpenProject(directory); } }
private void a() { if ((er.j("DeleteGhostMonstersByHPTracker") && PluginCore.cq.n.b) && (PluginCore.cq.an.h() != 0)) { cv cv = PluginCore.cq.p.d(PluginCore.cq.an.h()); if (cv != null) { string str = cv.g(); if (PluginCore.cq.x.e(str) > 0) { TimeSpan span = (TimeSpan)(DateTimeOffset.Now - PluginCore.cq.an.g()); if (span.TotalSeconds >= er.i("GhostDeleteHPTrackerSeconds")) { TimeSpan span2 = (TimeSpan)(DateTimeOffset.Now - PluginCore.cq.an.e()); if (span2.TotalSeconds >= er.i("GhostDeleteHPTrackerSeconds")) { int num = PluginCore.cq.an.h(); cv cv2 = PluginCore.cq.p.d(num); if ((cv2 != null) && (cv2.c() == ObjectClass.Monster)) { PluginCore.e("Deleting ghost monster " + cv2.g() + " (" + num.ToString() + ") due to HP tracker notification."); dh.d(num); } } } } } } }
public void e() { foreach (dy dy in this.c) { PluginCore.e("(*." + dy.b.a + ") " + dy.d); } }
public void c() { if ((this.f == this.d) && (this.g == this.e)) { this.h++; if (this.h > 80) { this.a[this.d] = true; this.a[this.e] = true; PluginCore.e(string.Format("Abandoned trying to stack/cram items {0}, {1} (Bugged item and/or pack)", this.d, this.e)); return; } } else { this.f = this.d; this.g = this.e; this.h = 0; } if (this.c) { PluginCore.cq.ax.get_Actions().MoveItem(this.d, this.e); } else { PluginCore.cq.ax.get_Actions().MoveItem(this.d, this.e, 0, true); } }
public void k() { PluginCore.cq.ay.w(); if (string.IsNullOrEmpty(this.n)) { this.k.b(); } else { if (!File.Exists(Path.Combine(PluginCore.ci, this.n))) { this.k.b(); this.k.a(this.n); } if (this.k.b(this.n)) { PluginCore.e("Loaded nav ruleset."); } else { this.k.b(); this.k.a(this.n); PluginCore.e("Failed to load nav ruleset."); } } PluginCore.cq.ay.ak(); PluginCore.cq.n.c(); PluginCore.cq.ay.l(); }
void objecttracker_ObjectDeleted(Logic.ObjectTrackerObject oldobj, int oldlistindex) { lstObjects.RemoveRow(oldlistindex); //Tell the user PluginCore.WriteToChat("Object deleted: " + oldobj.Name); }
public void d() { this.b = false; int num = k.e(this.c["DBLastUpdateTime"].d()[0][1]); PluginCore.e("Checking for GameInfoDB update (DB age " + this.a((TimeSpan)(DateTimeOffset.UtcNow - a(num))) + ")."); this.e.a("http://auth.virindi.net/plugins/gamedb/get2.php?date=" + num.ToString() + "&dbver=" + this.a(this.c).ToString(), new ea.b(this.a)); }
public cz(PluginCore A_0, CoreManager A_1, PluginHost A_2, cj A_3) { this.a = A_1.get_WorldFilter(); this.a.add_ChangeObject(new EventHandler <ChangeObjectEventArgs>(this.a)); this.a.add_ReleaseObject(new EventHandler <ReleaseObjectEventArgs>(this.a)); A_3.f(new cj.c(this.a)); A_3.l(new cj.c(this.b)); }
public b0(CoreManager A_0, PluginCore A_1, cj A_2) { this.a = A_0.get_WorldFilter(); A_2.l(new cj.c(this.a)); this.d.a(new EventHandler(this.a)); this.d.a(0x1f3); this.d.a(true); }
public void b() { GC.SuppressFinalize(this); this.a(); this.az.Clear(); this.n = null; this.ag = null; this.au = null; this.at = null; this.@as = null; this.ar = null; this.aq = null; this.ap = null; this.ao = null; this.an = null; this.am = null; this.al = null; this.ak = null; this.aj = null; this.ai = null; this.ah = null; this.af = null; this.ae = null; this.ad = null; this.ac = null; this.ab = null; this.aa = null; this.z = null; this.y = null; this.x = null; this.w = null; this.v = null; this.u = null; this.t = null; this.s = null; this.r = null; this.q = null; this.p = null; this.c = null; this.av = null; this.o = null; this.m = null; this.l = null; this.k = null; this.j = null; this.i = null; this.h = null; this.g = null; this.f = null; this.e = null; this.d = null; this.b = null; this.a = null; this.aw = null; this.ax = null; this.ay = null; }
public da(cj A_0, PluginCore A_1) { this.e = A_0; this.e.j(new cj.c(this.d)); this.e.g(new cj.c(this.a)); this.e.f(new cj.c(this.b)); this.e.d(new cj.c(this.c)); A_1.ProfileChanged += new PluginCore.EmptyDelegate(this.b); }
protected override bool e() { if ((this.b <= DateTimeOffset.Now) && (PluginCore.cq.ax.get_Actions().get_BusyState() == 0)) { PluginCore.e("Executing chat command \"" + this.a + "\""); dh.h(this.a); return(false); } return(true); }
private bool a(string A_0) { this.h.a(A_0); if (this.h.b(A_0)) { PluginCore.e("Tell from " + A_0 + " ignored due to spam."); return(true); } return(false); }
public void c() { if (this.e()) { if (this.e.ContainsKey(this.j)) { this.e[this.j].b = true; } PluginCore.cq.ax.get_Actions().UseItem(this.j, 0); } }
public b5(CoreManager A_0, PluginCore A_1) { this.b = A_1; this.a = A_0.get_WorldFilter(); this.a.add_CreateObject(new EventHandler <CreateObjectEventArgs>(this.a)); this.a.add_ChangeObject(new EventHandler <ChangeObjectEventArgs>(this.a)); this.a.add_ReleaseObject(new EventHandler <ReleaseObjectEventArgs>(this.a)); this.d.a(0x7879); this.d.a(new EventHandler(this.a)); this.b.a(new uTank2.PluginCore.a(this.a)); this.b.b(new PluginCore.EmptyDelegate(this.a)); }
public bool b() { if ([email protected] >= 0x2710) { PluginCore.e("Meta Error: Call stack overflow (recursive call loop?)."); PluginCore.e("Disabling Meta."); er.b("EnableMeta", k.a(false)); return(false); } [email protected](this.b); [email protected](this.a); return(false); }
public void InitCommands(PluginCore PGCore) { try { Core = PGCore; if (lib.CommandsInstance < 1) { lib.MyCore.CommandLineText += Core_CommandLineText; lib.CommandsInstance++; } } catch (Exception ex) { Repo.RecordException(ex); } }
public static void a(string A_0) { string str; if (((str = A_0) != null) && (str == "idqueue")) { a(); } else { PluginCore.e("Usage: \"/vt explain [command]\". Available commands: idqueue"); } }
internal cLogic(dv A_0, PluginCore A_1, s A_2) { this.c = A_1; this.f = new e3(); A_0.a(new dv.b(this.a)); A_0.b(new dv.a(this.a)); A_2.a(new s.a(this.a)); A_2.b(new s.c(this.a)); this.f.a(new EventHandler(this.b)); this.g = new e3(); this.g.a(new EventHandler(this.a)); this.g.a(0xc83); PluginCore.PC.b(new PluginCore.EmptyDelegate(this.a)); }
public bool a() { if ([email protected] == 0) { PluginCore.e("Meta Error: Call stack underflow, cannot return."); PluginCore.e("Disabling Meta."); er.b("EnableMeta", k.a(false)); return(false); } string str = [email protected](); [email protected](str); return(false); }
private void a(int A_0) { string str = "<UNKNOWN>"; try { str = PluginCore.cq.p.d(A_0).e(); } catch { } PluginCore.e("Abandoned trying to combine item " + str + " (Bugged unsalvageable salvage bag)"); this.i.Add(A_0); if (this.h.ContainsKey(A_0)) { this.h.Remove(A_0); } }
public void o() { if ((PluginCore.cq.u.b(b0.a.a) > 0) && this.r) { PluginCore.e("Set default profile: Inventory scan canceled."); } this.r = false; PluginCore.cq.u.a(b0.a.a); this.c.d(this.e); this.a(); PluginCore.e("Loaded default settings."); if (PluginCore.cq.p.a("Splitting Tool").Count > 0) { PluginCore.e("Set default profile: Splitting Tool in inventory. Assuming you want to split old component peas."); PluginCore.PC.t(); } this.f(); }
public void b() { if (!this.c) { this.c = true; GC.SuppressFinalize(this); this.b.b(new uTank2.PluginCore.a(this.a)); this.d.b(new EventHandler(this.a)); this.a.remove_CreateObject(new EventHandler <CreateObjectEventArgs>(this.a)); this.a.remove_ChangeObject(new EventHandler <ChangeObjectEventArgs>(this.a)); this.a.remove_ReleaseObject(new EventHandler <ReleaseObjectEventArgs>(this.a)); if (this.d != null) { this.d.e(); } this.b = null; this.a = null; } }
bool customCompletionTextBoxAndListBox_BeforeItemInsert(PluginCore.ICompletionListItem mitem) { if (listSearchIn == null) return true; foreach (String value in listSearchIn) { if (mitem.Value == value) { listSearchIn.Remove(value); return false; } } // listSearchIn = null; return true; }
public void StartMacro() { if (!PluginCore.ck) { a5.a(eChatType.Errors, "The macro encountered an exception on startup. Cannot continue."); } else if (PluginCore.cg == 0) { PluginCore.cq.c.StopMacro(); a5.a(eChatType.Errors, "Please wait until you are fully logged in."); } else if (!PluginCore.cq.ay.cl) { PluginCore.cq.c.StopMacro(); a5.a(eChatType.Errors, "Please wait until you are fully logged in."); } else { this.k = true; PluginCore.cq.n.b = true; PluginCore.cq.n.i.Clear(); PluginCore.cq.n.a = false; PluginCore.cq.n.r = 0; PluginCore.cq.g.d(); PluginCore.cq.n.c(); PluginCore.cq.n.n.a(); a2.e(); [email protected] = DateTimeOffset.Now; PluginCore.cq.ay.aq(); PluginCore.cq.ay.v.Checked = true; this.f.a(0x125); this.f.d(); ai.a(); this.k = false; PluginCore.e("Macro started."); foreach (ILogicRule rule in this.m) { rule.Running = false; } PluginCore.cq.aj.g(); this.TryPokeMacro(); } }
public IEnumerable <Playlist> GetAllPlaylists() { using (var db = new SQLiteConnection(Tables.DBPath)) { if (db.Table <Library.TableModels.Playlist>().Any()) { foreach (Library.TableModels.Playlist v in db.Table <Library.TableModels.Playlist>()) { if (v.Path != null) { Playlist m3 = PluginCore.Instance().GetPlaylist(new FileInfo(v.Path).Extension.ToLower()); m3.Path = v.Path; m3.ID = v.ID; m3.Name = v.Name; CPlaylistID = m3.ID; yield return(m3); } } } } }
public MapHud(HudManager manager, PluginCore pluginCore, LocationDatabase locationDatabase) : base(DefaultRegion, "Map of Dereth", manager) { mPluginCore = pluginCore; mZipFile = new ZipFile(Util.FullPath(@"Huds\DerethMap.zip")); using (StreamReader mapInfoReader = new StreamReader(mZipFile.GetInputStream(mZipFile.GetEntry("map.txt")))) { // File format has 3 lines: mapSize, tileSize, padding mMapSize = int.Parse(mapInfoReader.ReadLine()); mTileSize = int.Parse(mapInfoReader.ReadLine()); mTilePaddedSize = mTileSize + int.Parse(mapInfoReader.ReadLine()); mMaxTile = (mMapSize - 1) / mTileSize; mPixPerClick = mMapSize / 204.1f; } mActualZoom = mZoomMultiplier; mCoordTickDelta = CalculateCoordTickDelta(Zoom); SetAlphaFading(255, 128); ClientMouseDown += new EventHandler<HudMouseEventArgs>(MapHud_ClientMouseDown); ClientMouseUp += new EventHandler<HudMouseEventArgs>(MapHud_ClientMouseUp); ClientMouseDrag += new EventHandler<HudMouseDragEventArgs>(MapHud_ClientMouseDrag); ClientMouseDoubleClick += new EventHandler<HudMouseEventArgs>(MapHud_ClientMouseDoubleClick); ClientMouseWheel += new EventHandler<HudMouseEventArgs>(MapHud_ClientMouseWheel); ClientMouseMove += new EventHandler<HudMouseEventArgs>(MapHud_ClientMouseMove); ClientMouseLeave += new EventHandler<HudMouseEventArgs>(MapHud_ClientMouseLeave); ResizeEnd += new EventHandler(MapHud_ResizeEnd); ClientVisibleChanged += new EventHandler(MapHud_ClientVisibleChanged); Moving += new EventHandler(MapHud_Moving); Heartbeat += new EventHandler(MapHud_Heartbeat); ResizeDrawMode = HudResizeDrawMode.Repaint; mLocDb = locationDatabase; WindowMessage += new EventHandler<WindowMessageEventArgs>(MapHud_WindowMessage); AlphaChanged += new EventHandler<AlphaChangedEventArgs>(MapHud_AlphaChanged); //MaxSize = new Size(1024, 1024); }
public void SetBreakPointsToEditor(PluginCore.ITabbedDocument[] documents) { m_bAccessable = false; foreach (ITabbedDocument document in documents) { ScintillaControl sci = document.SciControl; if (sci == null) continue; if (Path.GetExtension(sci.FileName) == ".as" || Path.GetExtension(sci.FileName) == ".mxml") { foreach (BreakPointInfo info in m_BreakPointList) { if (info.FileFullPath.Equals(sci.FileName, StringComparison.OrdinalIgnoreCase) && !info.IsDeleted) { if (info.Line < 0 || info.Line + 1 > sci.LineCount) continue; sci.MarkerAdd(info.Line, info.IsEnabled ? ScintillaHelper.markerBPEnabled : ScintillaHelper.markerBPDisabled); } } } } m_bAccessable = true; }
void CompletionList_OnInsert(ScintillaControl sender, int position, string text, char trigger, PluginCore.ICompletionListItem item) { CompletionList.OnInsert -= new InsertedTextHandler(CompletionList_OnInsert); if (trigger == '.' || trigger == ';' || trigger == '=') { isList = -1; return; } if (Words == null) return; if (alreadyInvoke) { retest = true; return; } if (curIndWord==isList && curIndWord < Words.Count - 1 ) { isList = -1; MoveNextWord(); } else isList = -1; }
public void EventKey(PluginCore.KeyEvent k) { if (enabled) { Disable(); if (settings.ShowStateChange) { System.Windows.Forms.MessageBox.Show("AutoClose Disable"); } } else { EnabledAutoCloseAndListenOpenDocuments(); if (settings.ShowStateChange) { System.Windows.Forms.MessageBox.Show("AutoClose Enable"); } } }
private Dictionary<string, string> GetSection(PluginCore.Helpers.SimpleIni config, string name) { foreach (var def in config) if (def.Key == name) return def.Value; return null; }
public void EventKey(PluginCore.KeyEvent k) { if (k.Value == settings.AbbrevationPlusFormatterShortCut) { if (reformatterCode == null) { System.Windows.Forms.MessageBox.Show("Reformat Code must be enable!!!"); return; } if (settings.abbrevationDictList == null) { System.Windows.Forms.MessageBox.Show("Insert abbreviations before!!"); return; } ScintillaControl sci = ASCompletion.Context.ASContext.CurSciControl; if (sci == null) return; if (dictionaryCreateWords.TryGetValue(sci.Handle, out currentCreateWords)) { if (currentCreateWords.IsMonitoring) { ControlCaretPosition(); return; } } int linePos = sci.LineFromPosition(sci.CurrentPos); string lineText = sci.GetLine(linePos); string[] str = reformatterCode.DivideStringCode(lineText); insertOnly = true; // Nothing Divisor ; so do a normal abbrevation if (str == null) { ProcessAbbrevation(sci); return; } bool hasOperator = reformatterCode.SearchForOperators(str[1], true); if (!hasOperator) { ProcessAbbrevation(sci); return; } int startLine = sci.PositionFromLine(linePos); int pos = startLine + str[0].TrimEnd().Length; int start = 0; int end = 0; // sci.CurrentPos = pos; //string word = sci.GetWordFromPosition(pos); string word = GetWordFromPosition(sci, pos, ref start,ref end); // string expandeText = ""; AbbrevationSnippet abbrSnippet = null; if (word !=null ) { String ext = System.IO.Path.GetExtension(ASContext.Context.CurrentFile).ToLower(); ; dictAbbreviations = null; if (!settings.abbrevationDictList.TryGetValue(ext, out dictAbbreviations)) { dictAbbreviations = settings.abbrevationDictList[".other"]; } dictAbbreviations.TryGetValue(word,out abbrSnippet); } if (abbrSnippet != null) { //string reformatterString = reformatterCode.Reformat(abbrSnippet.Snippet); AbbrevationSnippet reformatAbbreviation = new AbbrevationSnippet(reformatterCode.Reformat(abbrSnippet.Snippet)); reformatAbbreviation.Arguments = abbrSnippet.Arguments; reformatAbbreviation.HasAfterCurrentMember = abbrSnippet.HasAfterCurrentMember; reformatAbbreviation.HasEventHandler = abbrSnippet.HasEventHandler; reformatAbbreviation.HasImport = abbrSnippet.HasImport; sci.GotoPos(start); sci.BeginUndoAction(); if (currentCreateWords != null) cw_MonitorOnWordsDeactive(currentCreateWords); CreateWords cwNew = CreateNewWords(); string elaborateText = currentCreateWords.MakeTextFromSnippet(sci, reformatAbbreviation); sci.SetSel(start, end); sci.ReplaceSel( elaborateText); sci.DelLineRight(); if (abbrSnippet.Arguments == null) { sci.EndUndoAction(); return; } DoBeforeMonitor(); if (!currentCreateWords.TryActivateMonitor()) { cwNew.MonitorOnWordsActive -= new OnMonitorActiveEventHanlder(cw_MonitorOnWordsActive); cwNew.MonitorOnWordsDeactive -= new OnMonitorActiveEventHanlder(cw_MonitorOnWordsDeactive); } else { currentCreateWords = cwNew; } sci.EndUndoAction(); return; } else { string newString = reformatterCode.Reformat(str[0] + ";"); sci.GotoPos(startLine); sci.BeginUndoAction(); sci.DelLineRight(); sci.InsertText(sci.CurrentPos, newString); sci.EndUndoAction(); sci.GotoPos(startLine + newString.Length); } } else if (k.Value == settings.AbbrevationShortCut) { ScintillaControl sci = ASCompletion.Context.ASContext.CurSciControl; if (sci == null) return; if (dictionaryCreateWords.TryGetValue(sci.Handle, out currentCreateWords)) { if (currentCreateWords.IsMonitoring) { ControlCaretPosition(); return; } } if (sci != null) if (sci.Focused) ProcessAbbrevation(sci); } else if (k.Value == settings.GotoAbbreviationShortCut) { if (dictionaryCreateWords != null && dictionaryCreateWords.Count>0) { if (dictionaryCreateWords.Count == 1) { Dictionary<IntPtr, CreateWords>.ValueCollection.Enumerator enumerator = dictionaryCreateWords.Values.GetEnumerator(); enumerator.MoveNext(); CreateWords currentCreateWords = enumerator.Current; if (currentCreateWords != null) { currentCreateWords.GoToCurrentWord(); } } else { List<PluginCore.ICompletionListItem> lcomp = new List<PluginCore.ICompletionListItem>(); foreach (KeyValuePair<IntPtr,CreateWords> data in dictionaryCreateWords) { lcomp.Add(new GotoAbbreviationCmd(data.Value.FileName ,data.Value.SciMonitor.FileName, ManagerResources.GoToAbbreviationBitmap, data.Value)); } PluginMain.custCompletion.Show(lcomp, false); } } } else if (k.Value == settings.GenerateSensibleAreaShortCut) { if (PathExplorer.IsWorking) { WaitFinishPathExplorer(); } if (ASContext.Context.CurrentMember != null) { MemberModel currentMember = ASContext.Context.CurrentMember; if (currentMember.Parameters == null || currentMember.Parameters.Count == 0) return; ScintillaControl sci= ASContext.CurSciControl; string declaration = sci.GetLine(currentMember.LineFrom); int startPos = declaration.IndexOf('('); int startLine = sci.PositionFromLine(currentMember.LineFrom); if (currentMember.Parameters.Count == 1) { int index = declaration.IndexOf(currentMember.Parameters[0].Name, startPos); int pos = startPos + startLine +1; sci.SetSel(pos, pos + currentMember.Parameters[0].Name.Length); return; } int j = -1; int[] positionsSensibleArea = new int[currentMember.Parameters.Count * 2]; int length = positionsSensibleArea.Length; for (int i = 0; i < length; i+=2) { j++; int index = declaration.IndexOf(currentMember.Parameters[j].Name, startPos); positionsSensibleArea[i] = index; positionsSensibleArea[i + 1] = index + currentMember.Parameters[j].Name.Length; } CreateWords cw; if (dictionaryCreateWords.TryGetValue(sci.Handle, out cw)) { cw_MonitorOnWordsDeactive(cw); currentSci = ASContext.CurSciControl; } currentCreateWords = CreateNewWords(); currentCreateWords.GenerateSensibleArea(startLine, positionsSensibleArea, sci); } } }
public void SetBreakPointsToEditor(PluginCore.ITabbedDocument[] documents) { m_bAccessable = false; for (int i = 0; i < documents.Length; i++) { ScintillaControl sci = documents[i].SciControl; if (sci == null) continue; if (Path.GetExtension(sci.FileName) == ".as" || Path.GetExtension(sci.FileName) == ".mxml") { foreach (BreakPointInfo info in m_BreakPointList) { if (info.FileFullPath == sci.FileName && !info.IsDeleted) { sci.MarkerAdd(info.Line, info.IsEnabled ? ScintillaHelper.markerBPEnabled : ScintillaHelper.markerBPDisabled); } } } } m_bAccessable = true; }