public void AddVertGuideLineHandler(object obj) { if (GuideType == GuideType.Global || _page == null || _pageView == null) { return; } var values = (object[])obj; Ruler ruler = values[0] as Ruler; PageEditorViewModel editor = values[1] as PageEditorViewModel; System.Windows.Point point = Mouse.GetPosition(ruler); IGuide guide = _pageView.CreateGuide(Orientation.Vertical, (point.X + ruler.CountShift) / Scale, 0); VerticalGuideLine vLine = new VerticalGuideLine(guide, GuideType.Local, editor.EditorScale); editor.EditorCanvas.Focus(); GuideItems.Add(vLine); _document.IsDirty = true; List <IGuide> guides = new List <IGuide>(); guides.Add(guide); CreatePageGuideCommand cmd = new CreatePageGuideCommand(_pageView, guides); CurrentUndoManager.Push(cmd); ShowGuide(editor); }
private void LoadGlobalGuide() { GuideItems.Clear(); if (_document != null) { foreach (IGuide item in _document.GlobalGuides) { switch (item.Orientation) { case Orientation.Horizontal: GuideItems.Add(new HorizontalGuideLine(item as IGuide, GuideType.Global, scale)); break; case Orientation.Vertical: GuideItems.Add(new VerticalGuideLine(item as IGuide, GuideType.Global, scale)); break; } } } }
private void LoadPageGuide() { GuideItems.Clear(); if (_page != null && _pageView != null) { foreach (IGuide item in _pageView.Guides) { switch (item.Orientation) { case Orientation.Horizontal: GuideItems.Add(new HorizontalGuideLine(item as IGuide, GuideType.Local, scale)); break; case Orientation.Vertical: GuideItems.Add(new VerticalGuideLine(item as IGuide, GuideType.Local, scale)); break; } } } }