private void DeleteDdlBtn_Click(object sender, RoutedEventArgs e) { if (isDeleteComfirmed) { FlowWindow dfw = FlowWindowOperation.flowWindows.Find(d => d.ddl.Id == ddl.Id); if (dfw != null) { dfw.Close(); FlowWindowOperation.flowWindows.Remove(dfw); } DatabaseOperation.Delete(ddl.Id); DdlOperation.RefreshDdls(); DdlPage.self.ReloadDdlStackPanel(); DdlPage.self.ShowSnackbar("删除成功"); } else { isDeleteComfirmed = true; PackIcon icon = new PackIcon(); icon.Kind = PackIconKind.CheckBold; icon.Height = 24; icon.Width = 24; DeleteDdlBtn.Content = icon; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.DdlFlowWindow = ((DDLM.FlowWindow)(target)); #line 19 "..\..\..\..\Windows\FlowWindow.xaml" this.DdlFlowWindow.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.DdlFlowWindow_MouseLeftButtonDown); #line default #line hidden #line 20 "..\..\..\..\Windows\FlowWindow.xaml" this.DdlFlowWindow.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.DdlFlowWindow_MouseDoubleClick); #line default #line hidden #line 21 "..\..\..\..\Windows\FlowWindow.xaml" this.DdlFlowWindow.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.DdlFlowWindow_MouseRightButtonDown); #line default #line hidden #line 22 "..\..\..\..\Windows\FlowWindow.xaml" this.DdlFlowWindow.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.DdlFlowWindow_MouseWheel); #line default #line hidden return; case 2: this.Container = ((System.Windows.Controls.Grid)(target)); return; case 3: this.Bg = ((System.Windows.Shapes.Rectangle)(target)); return; case 4: this.ProgressRect = ((System.Windows.Shapes.Rectangle)(target)); return; case 5: this.DdlNameTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.NullTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.LeftTimeTextBlock = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }
private void FlowDdlBtn_Click(object sender, RoutedEventArgs e) { if (FlowWindowOperation.flowWindows.Exists(d => d.ddl.Id == ddl.Id)) { return; } else { FlowWindow fw = new FlowWindow(ddl, 1); double[] d = { 0, 0, 1 }; fw.Left = 0; fw.Top = 0; FlowWindowOperation.flowWindows.Add(fw); fw.Show(); } }
public FlowWindowOperation() { XmlDocument xml = new XmlDocument(); try { xml.Load(App.path + "FlowWindowPosition.xml"); } catch (Exception) { xml.AppendChild(xml.CreateXmlDeclaration("1.0", "UTF-8", null)); xml.AppendChild(xml.CreateElement("", "root", "")); xml.Save(App.path + "FlowWindowPosition.xml"); } XmlNodeList xnl = xml.SelectSingleNode("root").ChildNodes; foreach (XmlNode xn in xnl) { XmlElement xe = (XmlElement)xn; int id = int.Parse(xe.GetAttribute("id")); XmlNodeList xeXnl = xe.ChildNodes; double x = double.Parse(xeXnl.Item(0).InnerText); double y = double.Parse(xeXnl.Item(1).InnerText); double size = double.Parse(xeXnl.Item(2).InnerText); double[] d = { x, y, size }; try { FlowWindow dfw = new FlowWindow(DdlOperation.ddls.Find(ddl => ddl.Id == id), size); dfw.Left = x; dfw.Top = y; flowWindows.Add(dfw); } catch (Exception) { continue; } } App.dt.Tick += RefreshFlowWindowsEvent; }