public void DeleteMark(Mark mark) { _markList.Remove(mark); if (MarkChanged != null) { MarkChanged(this, new MarkChangedEventArgs() { MarkChangeKind = MarkChangeKind.Delete }); } EventAggregator.OnModelDataChanged(this, new ModelValueChangedEventArgs()); }
public override void ExecuteMouseMoveAsHovering(Point point) { if (_deleteButton != null && _deleteButton.IsMouseOver) { return; } var mark = WritersModel.GetMarkFromPosition(point); CurrentHoveringMark = mark; }
public void AddMark(Mark mark) { mark.MarkChanged += MarkChangedEventHandler; _markList.Add(mark); if (MarkChanged != null) { MarkChanged(this, new MarkChangedEventArgs() { MarkChangeKind = MarkChangeKind.Add }); } EventAggregator.OnModelDataChanged(this, new ModelValueChangedEventArgs()); }
private Control GetAddControl(Mark mark, String document) { MarkReview review = new MarkReview(mark,document); MarkReviewControl control = new MarkReviewControl(); control.BindData(this); _markReviewList.Add(review); control.DataContext = review; return control; }
private void RangeDirectionButtonClicked(object obj, RoutedEventArgs e) { if (obj == _rightRangeButton) { _rangeDirection = RangeDirection.ToRight; } else { _rangeDirection = RangeDirection.ToLeft; } _currentSelectingMark = _currentHoveringMark; _selectingMarkForDraw = new Mark(_currentSelectingMark); _currentHoveringMark = null; _view.ClearUIElement(typeof(Button)); SetRedrawTimer(); }
public override void ResetStatus() { CurrentHoveringMark = null; CurrentSelectingMark = null; SelectingMarkForDraw = null; }
protected void DrawRectangle(Rect rect, Brush brush, Mark mark) { if (rect.X < 0) { rect.Width += rect.X; rect.X = 0; } if (rect.Y < 0) { rect.Height += rect.Y; rect.Y = 0; } Rectangle rectangle = new Rectangle(); rectangle.Width = rect.Width; rectangle.Height = rect.Height; rectangle.Fill = brush; if (mark != null) { rectangle.ContextMenu = new System.Windows.Controls.ContextMenu(); var menuItem = new MenuItem() { Header = "削除" }; menuItem.Click += DeleteMenuItemClicked; menuItem.DataContext = mark; rectangle.ContextMenu.Items.Add(menuItem); } Canvas.SetLeft(rectangle, rect.Left); Canvas.SetTop(rectangle, rect.Top); _view.canvas.Children.Add(rectangle); }
protected void DrawOneMark(int headIndex, int tailIndex, Brush brush, Mark mark) { int visibleHead = WritersModel.GetHeadIndexOfVisibleText(); int visibleTail = WritersModel.GetTailIndexOfVisibleText(); if (visibleHead == -1 || visibleTail == -1) { return; } int headOfRect = (headIndex > visibleHead) ? headIndex : visibleHead; int tailOfRect = (tailIndex < visibleTail) ? tailIndex : visibleTail; var DrawRect = WritersModel.GetRectOfCharIndex(headOfRect, tailOfRect); foreach (var rect in DrawRect) { if (rect.Height < 0 || rect.Width < 0) { continue; } DrawRectangle(rect, brush, mark); } }
public MarkReview(Mark mark, String document) { _mark = mark; _document = document; }
public Mark(Mark mark) { HeadCharIndex = mark.HeadCharIndex; TailCharIndex = mark.TailCharIndex; Brush = mark.Brush.CloneCurrentValue(); }
private bool isTargetMark(int headIndex, int tailIndex, Mark mark, MarkKindEnums kind) { if (GetMarkKind(mark) != kind) { return false; } if (headIndex > mark.TailCharIndex) { return false; } if (tailIndex < mark.HeadCharIndex) { return false; } return true; }
private MarkKindEnums GetMarkKind(Mark mark) { if (mark.GetType() == typeof(CharacterMark)) { return MarkKindEnums.Character; } else if (mark.GetType() == typeof(StoryFrameMark)) { return MarkKindEnums.StoryFrame; } return MarkKindEnums.Character; }
/// <summary> /// Markを削除する /// </summary> /// <param name="mark">削除するMark</param> public void DeleteMark(Mark mark) { ModelsComposite.MarkManager.DeleteMark(mark); }
public override void ResetStatus() { CurrentHoveringMark = null; }