public async Task Init() { var folderList = await App._instance.IO.GetLocalDataAsync <List <FolderItem> >(StaticString.FolderListFileName); var historyList = await App._instance.IO.GetLocalDataAsync <List <HistoryItem> >(StaticString.HistoryListFileName); FolderCollection.Clear(); DisplayHistoryCollection.Clear(); if (!folderList.IsNullOrEmpty()) { folderList.ForEach(p => FolderCollection.Add(p)); } else { var folderItem = new FolderItem(App._instance.App.GetLocalizationTextFromResource(LanguageName.Default), FeatherSymbol.Activity); FolderCollection.Add(folderItem); await SaveFolderList(); } string lastSelectedFolderId = App._instance.App.GetLocalSetting(Settings.LastSelectFolderId, ""); if (!FolderCollection.Any(p => p.Id == lastSelectedFolderId)) { lastSelectedFolderId = FolderCollection.First().Id; } CurrentSelectedFolder = FolderCollection.Where(p => p.Id == lastSelectedFolderId).First(); if (!historyList.IsNullOrEmpty()) { AllHistoryList = historyList; historyList.Where(p => p.FolderId == lastSelectedFolderId).ToList().ForEach(p => DisplayHistoryCollection.Add(p)); HistoryChanged?.Invoke(this, EventArgs.Empty); } }
public static void ClearHistory() { _commands = new LinkedList <Command>(); _current = null; LogManager.GetCurrentClassLogger().Info($"Commands history was cleared!"); HistoryChanged?.Invoke(); }
public bool Add(string url, MediaRouter.InputType urlType, string subUrl = null) { lock (locker) { Entry entry = null; int existIndex = Get(url, subUrl); if (existIndex != -1) { entry = Entries[existIndex]; entry.OpenedAt = DateTime.Now.Ticks; RemoveAll(url, subUrl); } else { entry = new Entry(url, urlType, subUrl); } int removeCount = Entries.Count - maxEntries; for (int i = 0; i <= removeCount; i++) { Entries.RemoveAt(0); } Save(); Entries.Add(entry); SaveLast(); HistoryChanged?.Invoke(this, EventArgs.Empty); return(existIndex != -1); } }
static void Use(Color color) { if (History.Contains(color)) { History.Remove(color); } History.Insert(0, color); HistoryChanged?.Invoke(); }
private void MakeTextBufferReadOnly() { using (var edit = _historyTextBuffer.CreateReadOnlyRegionEdit()) { var span = new Span(0, edit.Snapshot.Length); _readOnlyRegion = edit.CreateReadOnlyRegion(span, SpanTrackingMode.EdgeInclusive, EdgeInsertionMode.Deny); edit.Apply(); } _currentEntry = null; HistoryChanged?.Invoke(this, new EventArgs()); }
public static void RemoveAfter(LinkedListNode <Command> currentNext) { LinkedListNode <Command> cur = _commands.Last; while (cur != currentNext) { _commands.RemoveLast(); cur = _commands.Last; } HistoryChanged?.Invoke(); }
public async Task RefreshHistoryInfo() { var info = await PlotContentProvider.GetHistoryInfoAsync(); ActivePlotIndex = info.ActivePlotIndex; PlotCount = info.PlotCount; VsAppShell.Current.DispatchOnUIThread(() => { // We need to push creation of the tool window // so it appears on the first plot if (!VsAppShell.Current.IsUnitTestEnvironment) { ToolWindowUtilities.ShowWindowPane <PlotWindowPane>(0, false); } HistoryChanged?.Invoke(this, EventArgs.Empty); }); }
public void Clear() { lock (locker) { Entries.Clear(); if (File.Exists(Path.Combine(Folder, "History.xml"))) { File.Delete(Path.Combine(Folder, "History.xml")); } if (File.Exists(Path.Combine(Folder, "HistoryLast.xml"))) { File.Delete(Path.Combine(Folder, "HistoryLast.xml")); } HistoryChanged?.Invoke(this, EventArgs.Empty); } }
public static void AddCommand(Command newCommand) { if (_current == null) { _current = new LinkedListNode <Command>(newCommand); _commands.AddFirst(_current); } else { if (_current.Next != null) { RemoveAfter(_current); } _commands.AddAfter(_current, newCommand); _current = _commands.Last; } HistoryChanged?.Invoke(); }
public static void Redo() { if (_current == null) { return; } if (_current.Value.Executed) { if (_current.Next == null) { return; } _current = _current.Next; } ICommand command = _current.Value; command.Execute(); HistoryChanged?.Invoke(); }
public static void Undo() { if (_current == null) { return; } if (_current.Value.Undid) { if (_current.Previous == null) { return; } _current = _current.Previous; } ICommand command = _current.Value; command.Undo(); HistoryChanged?.Invoke(); }
private void RaiseHistoryChanged() { HistoryChanged?.Invoke(this, new EventArgs()); }
public static void Clear() { History = new List <Color>(); HistoryChanged?.Invoke(); }
public static void Set(List <Color> history) { History = history; HistoryChanged?.Invoke(); }
private void RaiseHistoryChanged() => HistoryChanged?.Invoke(this, EventArgs.Empty);
internal void RaiseHistoryChanged() { HistoryChanged?.Invoke(this, EventArgs.Empty); }
protected virtual void OnHistoryChanged(object sender, EventArgs e) { HistoryChanged?.Invoke(this, e); }
private void Manager_HistoryChanged(object sender, EventArgs e) { HistoryChanged?.Invoke(sender, e); }
private void TRCoord_HistoryChanged(object sender, EventArgs e) { HistoryChanged?.Invoke(this, e); }
private void ClearHistoryInfo() { ActivePlotIndex = -1; PlotCount = 0; HistoryChanged?.Invoke(this, EventArgs.Empty); }
void OnHistoryChanged() { HistoryChanged?.Invoke(null, EventArgs.Empty); }
protected void OnHistoryChanged([CallerMemberName] string propertyName = null) { HistoryChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }
private void OnHistoryChanged() { HistoryChanged?.Invoke(this, EventArgs.Empty); }
protected virtual void OnHistoryChanged() { HistoryChanged?.Invoke(this, EventArgs.Empty); }