void da_FtpMethodCompleted(object sender, FtpMethodCompletedEventArgs e) { if (e.Result == null || e.Result.Contains("@") == false) { MessageBox.Show("无法连接ftp://templete.ccflow.org,无法获取共享表单模板资源。"); return; } string[] strs = e.Result.Split('@'); int idx = 0; foreach (string s in strs) { BPDir img = new BPDir(); img.Cursor = Cursors.Hand; img.SetValue(Canvas.LeftProperty, (double)30); img.SetValue(Canvas.TopProperty, (double)30); img.Width = 32; img.Height = 32; MouseDragElementBehavior mdeImg = new MouseDragElementBehavior(); Interaction.GetBehaviors(img).Add(mdeImg); this.canvas1.Children.Add(img); img.MouseLeftButtonDown += new MouseButtonEventHandler(img_MouseLeftButtonDown); img.MouseRightButtonDown += new MouseButtonEventHandler(img_MouseLeftButtonDown); } }
void loadTemplete_FtpMethodCompleted(object sender, FtpMethodCompletedEventArgs e) { loadingWindow.DialogResult = false; if (e.Result != null) { loadingWindow.DialogResult = false; MessageBox.Show(e.Result, "错误", MessageBoxButton.OK); return; } this.HisMainPage.BindFrm(); this.DialogResult = true; }
void da_Fls_FtpMethodCompleted(object sender, FtpMethodCompletedEventArgs e) { this.loadingWindow.Close(); if (e.Result == null || e.Result.Contains("Err") == true) { MessageBox.Show(e.Result, "连接到网络错误", MessageBoxButton.OK); return; } this.OKButton.Visibility = System.Windows.Visibility.Visible; this.canvas1.Children.Clear(); string[] strs = e.Result.Split('@'); int colIdx = 0; int rowIdx = 0; foreach (string s in strs) { if (string.IsNullOrEmpty(s)) { continue; } colIdx++; if (colIdx == 5) { rowIdx++; colIdx = 0; } TempleteFile tempFile = new TempleteFile(); tempFile.BindText(s); tempFile.SetValue(Canvas.LeftProperty, (double)100 * colIdx); tempFile.SetValue(Canvas.TopProperty, (double)100 * rowIdx); tempFile.Tag = s; MouseDragElementBehavior mdeImg = new MouseDragElementBehavior(); Interaction.GetBehaviors(tempFile).Add(mdeImg); this.canvas1.Children.Add(tempFile); tempFile.MouseLeftButtonDown += new MouseButtonEventHandler(tempFile_MouseLeftButtonDown); } }