public void Add(IMapCommand command) { if (!IsEqual(command)) { _stack.Push(command); } }
private static void ConfigureDitto() { try { var container = new DestinationConfigurationContainer(null, new TestConfigurationFactory()); container.Map <BenchDestinationProps.Int1>().From <BenchSourceProps.Int1>(); container.Map <BenchDestinationProps.Int2>().From <BenchSourceProps.Int2>(); container.Map <BenchDestinationProps>().From <BenchSourceProps>(); var bindable = container.ToBinding(); bindable.Bind(); bindable.Assert(); var contextualizer = new TestContextualizer(); var cacher = new CacheInitializer(contextualizer); bindable.Accept(cacher); dittoMapCommand = bindable.CreateCommand(typeof(BenchSourceProps), typeof(BenchDestinationProps)); } catch (Exception ex) { Console.WriteLine(ex); throw; } }
private bool IsEqual(IMapCommand comamnd) { if (IsEmpty) return false; var current = _stack.Peek(); return current.Equals(comamnd); }
private void ToolbarButton_Click(object sender, RoutedEventArgs e) { IMapCommand cmd = (sender as ToolbarButton).DataContext as IMapCommand; if (cmd != null) { cmd.Click(); if (cmd is IMapTool) { ResetPreviousToolButton(); _previousToolbarButton = sender as ToolbarButton; _previousToolbarButton.IsActived = true; } } }
private void SetMapToolByCurrentType() { IMapCommand cmd = MapToolFactory.GetMapTool(_currentToolType); if (!(cmd is IMapTool)) { return; } if (_currentMapTool != null) { (_currentMapTool as IMapToolInternal).Deactive(); } _currentMapTool = cmd as IMapTool; if (_currentMapTool == null) { _currentToolType = enumMapTools.None; } else { (_currentMapTool as IMapToolInternal).Active(); } }
public CloningMapCommand(IInvoke invoke, IMapCommand inner) { this.inner = inner; this.invoke = invoke; }
private static void ConfigureDitto() { try { var container = new DestinationConfigurationContainer(null, new TestConfigurationFactory()); container.Map<BenchDestinationProps.Int1>().From<BenchSourceProps.Int1>(); container.Map<BenchDestinationProps.Int2>().From<BenchSourceProps.Int2>(); container.Map<BenchDestinationProps>().From<BenchSourceProps>(); var bindable = container.ToBinding(); bindable.Bind(); bindable.Assert(); var contextualizer = new TestContextualizer(); var cacher = new CacheInitializer(contextualizer); bindable.Accept(cacher); dittoMapCommand = bindable.CreateCommand(typeof (BenchSourceProps), typeof (BenchDestinationProps)); } catch (Exception ex) { Console.WriteLine(ex); throw; } }
public void AddUndoCommand(IMapCommand command) { _redo.Clear(); _undo.Add(command); }
public void AddRedoCommand(IMapCommand command) { _redo.Add(command); }
/// <summary> /// 履歴にCommandを追加 /// </summary> /// <param name="command"></param> public void AddHistory(IMapCommand command) { _memento.AddUndoCommand(command); }