private void CenterEllipse_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (System.Windows.Browser.HtmlPage.Document.QueryString.ContainsKey("WorkID") || System.Windows.Browser.HtmlPage.Document.QueryString.ContainsKey("FK_Flow")) { return; } if (isDeleted) { return; } e.Handled = true; if (_doubleClickTimer.IsEnabled) { _doubleClickTimer.Stop(); _container.ShowFlowNodeSetting(this); } else { _doubleClickTimer.Start(); if (!_container.CurrentSelectedControlCollection.Contains(this)) { if (_container.CurrentTemporaryDirection == null) { //if (this.Type != FlowNodeType.COMPLETION) //{ _container.CurrentTemporaryDirection = new Direction(_container, true); _container.AddDirection(_container.CurrentTemporaryDirection); _container.CurrentTemporaryDirection.BeginFlowNode = this; _container.CurrentTemporaryDirection.BeginPointPosition = this.CenterPoint; _container.CurrentTemporaryDirection.EndPointPosition = _container.CurrentTemporaryDirection.BeginPointPosition; _container.CurrentTemporaryDirection.ZIndex = _container.NextMaxIndex; _container.IsNeedSave = true; // _container.CurrentTemporaryDirection.DirectionName = Text.NewDirection; //} } } else { FrameworkElement element = sender as FrameworkElement; mousePosition = e.GetPosition(null); trackingMouseMove = true; if (null != element) { element.CaptureMouse(); element.Cursor = Cursors.Hand; } } } }
private void AddLine_Click() { Direction r = new Direction(_container); r.SetValue(Canvas.ZIndexProperty, _container.NextMaxIndex); r.DirectionName = "Line" + _container.NextNewDirectionIndex.ToString(); _container.AddDirection(r); r.SetDirectionPosition(new Point(CenterPoint.X - 20, CenterPoint.Y - 20), new Point(CenterPoint.X + 30, CenterPoint.Y + 30), null, null); _container.SaveChange(HistoryType.New); _container.IsNeedSave = true; }