/// <summary> /// Handles the incoming events /// </summary> public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority) { if (e.Type == EventType.Command && ((DataEvent)e).Action == ProjectManagerEvents.Project) { behavior.Clear(); sciPrevPosition = 0; executableStatus = null; UpdateMenuItems(); return; } if (e.Type != EventType.FileSwitch) { return; } var doc = PluginBase.MainForm.CurrentDocument; if (!doc.IsEditable) { return; } var sci = doc.SciControl; sci.Modified -= SciControlModified; sci.Modified += SciControlModified; sci.UpdateUI -= SciControlUpdateUI; sci.UpdateUI += SciControlUpdateUI; SciControlUpdateUI(sci); }
public void Clear() { var behavior = new VSBehavior(); behavior.Add("filename", 0, 1); behavior.Add("filename", 10, 1); behavior.Clear(); Assert.IsTrue(behavior.CurrentItem.IsEmpty); Assert.IsFalse(behavior.CanBackward); Assert.IsFalse(behavior.CanForward); }