public void Clear() { // raise the BeforeChanged event var args = new BeforeChangedEventArgs(); BeforeChanged?.Invoke(this, args); if (args.Cancel) { return; } _currentSelection.Clear(); Changed?.Invoke(this, EventArgs.Empty); }
private void ApplyChange(TextSnapshotMock snapshot) { Changing?.Invoke(this, new TextContentChangingEventArgs(CurrentSnapshot, new object(), CancelAction)); var before = CurrentSnapshot; CurrentSnapshot = snapshot; var args = new TextContentChangedEventArgs(before, CurrentSnapshot, EditOptions.None, new object()); BeforeChanged?.Invoke(this, args); ChangedHighPriority?.Invoke(this, args); Changed?.Invoke(this, args); ChangedLowPriority?.Invoke(this, args); PostChanged?.Invoke(this, EventArgs.Empty); }
public static void Set(int uiScalePercent = 100) { if (!_initialized && !Runtime.IsLinux && Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } if (_initialized && _uiScalePercent == uiScalePercent) { return; } _initialized = true; _uiScalePercent = uiScalePercent; _scale = getDpiScale().MultiplyBy(_uiScalePercent / 100f); BeforeChanged?.Invoke(); Changed?.Invoke(); AfterChanged?.Invoke(); }
public void Replace(IEnumerable <IEntity> newSelection) { if (newSelection == null) { throw new ArgumentNullException(nameof(newSelection)); } // raise the BeforeChanged event var args = new BeforeChangedEventArgs(); BeforeChanged?.Invoke(this, args); if (args.Cancel) { return; } _currentSelection.Clear(); _currentSelection.AddRange(newSelection); // notify listeners Changed?.Invoke(this, EventArgs.Empty); }