private void RenameFileName(object sender, RoutedEventArgs e) { GetNeedControl(sender); BaseUserControl baseUserControl = null; if (!needControlFileName.EndsWith(".lightScript")) { for (int i = 0; i < userControls.Count; i++) { if (needControlFileName.EndsWith(userControls[i]._fileExtension)) { baseUserControl = userControls[i]; break; } } } else { baseUserControl = userControls[3] as BaseUserControl; } if (baseUserControl == null) { return; } needControlBaseUserControl = baseUserControl; baseUserControl.filePath = needControlFileName; String _filePath = baseUserControl.GetFileDirectory(); UserControlDialog.NewFileDialog newFileDialog = new UserControlDialog.NewFileDialog(mw, true, baseUserControl._fileExtension, FileBusiness.CreateInstance().GetFilesName(baseUserControl.filePath, new List <string>() { baseUserControl._fileExtension }), baseUserControl._fileExtension, "", NewFileResult); mw.ShowMakerDialog(newFileDialog); }
private void ChangeLanguage(object sender, RoutedEventArgs e) { if (mw.hintModelDictionary.ContainsKey(0)) { if (mw.hintModelDictionary[0].IsHint == false) { ChangeLanguage(); return; } } HintDialog hintDialog = new HintDialog("更改语言", "您是否要更改语言?", delegate(System.Object _o, RoutedEventArgs _e) { ChangeLanguage(); foo(); // .net 4.5 async void foo() { await Task.Delay(50); //mw.projectUserControl.SetSpFilePosition(mw.projectUserControl.filePosition); } mw.RemoveDialog(); }, delegate(System.Object _o, RoutedEventArgs _e) { mw.RemoveDialog(); }, delegate(System.Object _o, RoutedEventArgs _e) { mw.NotHint(0); } ); mw.ShowMakerDialog(hintDialog); }
private void tbOpen_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { String SetupFilePath = AppDomain.CurrentDomain.BaseDirectory; System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog(); openFileDialog.InitialDirectory = fatherPath; //注意这里写路径时要用c:\\而不是c:\ openFileDialog.Filter = "DLL文件|*.dll"; openFileDialog.FilterIndex = 1; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!openFileDialog.FileName.StartsWith(fatherPath)) { mw.ShowMakerDialog(new ErrorDialog(mw, "InvalidPath")); return; } tbDll.Text = openFileDialog.FileName.Substring(fatherPath.Length); } }
private void bShortcut_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (tbShortcut.Text.Equals("添加快捷方式")) { mw.ShowMakerDialog(new NewShortcutDialog(mw, this, blogContentModel, shortcut)); } else { tbShortcut.Text = "添加快捷方式"; bShortcut.Background = new SolidColorBrush(Color.FromRgb(45, 200, 76)); for (int i = mw.blogConfigModel.Shortcuts.Count - 1; i >= 0; i--) { if (mw.blogConfigModel.Shortcuts[i].url == shortcut.url) { mw.blogConfigModel.Shortcuts.RemoveAt(i); } } shortcut.dll = ""; LoadUrl(shortcut.url); //suc.SaveShortcuts(); } //suc.UpdateShortcuts(); }
private void Button_Click(object sender, RoutedEventArgs e) { mw.ShowMakerDialog(new MailDialog(mw, 1)); }