private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdDeleteSuspendedAC": DeleteSuspendedActivity(); break; case "cmdResume": ResumeActivity(); break; case "cmdJumpToFile": ACEState aces = ACEStateDictionnary[CurrentRow().ActivityId]; fFile f = MainForm.OpenFile(aces.FileId); break; case "cmdRefresh": LoadData(); break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void ResumeActivity() { //if (listBox1.SelectedIndex != -1) if (CurrentRow() != null) { if (CurrentRow().HasErrors) { pnlCannotResume.Closed = false; throw new LMException(CurrentRow().RowError); } else { //restores aces object ACEState aces = ACEStateDictionnary[CurrentRow().ActivityId]; //check for latest on resume if (DocumentIsLatest(aces, CurrentRow())) { Close(); //get fm FileManager fm = AtMng.GetFile(aces); fFile f = MainForm.OpenFile(fm.CurrentFile.FileId); f.RestoreWizard(aces); } else if (CurrentRow().HasErrors) { pnlCannotResume.Closed = false; throw new LMException(CurrentRow().RowError); } } } }
private void buttonOpen_Click(object sender, EventArgs e) { if (parent.OpenFile()) { Close(); } }
private static void Main(string[] args) { #if WINDOWS && DEBUG AllocConsole(); #endif Logger.Log += (s, e) => { var fmt = $"{DateTime.Now} {e.Severity} {e.Message}\n"; #if WINDOWS && DEBUG Console.WriteLine(fmt); #endif File.AppendAllTextAsync("GFDStudio.log", fmt); }; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var mainForm = new MainForm()) { if (args.Length > 0 && File.Exists(args[0])) { mainForm.OpenFile(args[0]); } Application.Run(mainForm); } }
public void OpenCommand() { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.DefaultExt = ".sm"; openFileDialog.CheckFileExists = true; openFileDialog.CheckPathExists = true; openFileDialog.AutoUpgradeEnabled = true; openFileDialog.AddExtension = true; openFileDialog.DereferenceLinks = true; openFileDialog.FileName = string.Empty; openFileDialog.Filter = "Smile scripts (*.sm)|*.sm" + "|JSON documents (*.json)|*.json" + "|XML documents (*.xml)|*.xml" + "|Text files (*.txt)|*.txt" + "|All files (*.*)|*.*"; openFileDialog.FilterIndex = 1; openFileDialog.RestoreDirectory = true; openFileDialog.Multiselect = true; openFileDialog.Title = "Open File"; openFileDialog.ValidateNames = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { foreach (string filePath in openFileDialog.FileNames) { MainForm.OpenFile(filePath); } } }
static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var form = new MainForm()) { form.OpenFile(@"C:\PDAFT\MDATA\MZZZ\rom\objset\rinitm1002.farc"); if (args.Length > 0 && File.Exists(args[0])) { form.OpenFile(args[0]); } Application.Run(form); } }
private void openFileToolStripMenuItem_Click(object sender, EventArgs e) { string docBasePath = GR.Path.RemoveFileSpec(DocumentFilename); if (DocumentInfo.Element != null) { docBasePath = DocumentInfo.Project.Settings.BasePath; } MainForm.OpenFile(GR.Path.Append(docBasePath, m_FilenameToOpen)); }
private void ucRecordList1_ColumnButtonClicked(object sender, Janus.Windows.GridEX.ColumnActionEventArgs e) { try { docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)this.documentBindingSource.Current).Row; MainForm.OpenFile(dr.FileId); } catch (Exception x) { UIHelper.HandleUIException(x); } }
public void LaunchEditor(FileSystem fs, File file) { if (fs is RealFileSystem) { var form = new MainForm(); form.Show(); DirectoryInfo parent = new DirectoryInfo((fs as RealFileSystem).RealDirectory).Parent; string archiveFilename = parent == null ? file.FullName : Path.Combine(parent.FullName, file.FullName); form.OpenFile(archiveFilename, null); } }
private void ucRecordList1_RowDoubleClicked(object sender, Janus.Windows.GridEX.RowActionEventArgs e) { try { docDB.DocumentRow dr = (docDB.DocumentRow)((DataRowView)this.documentBindingSource.Current).Row; fFile f = MainForm.OpenFile(dr.FileId); f.MoreInfo("document", dr.DocId); } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void PlaySelectedLocalFile() { mainfrm.b_PlayTV = false; DSkinGridListRow dr = dSkinGridList_PlayList_LocalList.SelectedItem; if (dr == null) { mainfrm.OpenFile(); } else { string str_LocalURL = dr.Cells[2].Text; if (str_LocalURL == "") { return; } mainfrm.str_NowPlaying = Path.GetFileName(str_LocalURL); //int nPosition = Convert.ToInt32(dr.Cells[3].Text); mainfrm.OpenFile(str_LocalURL, -1); Console.WriteLine(str_LocalURL); } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var form = new MainForm()) { if (args.Length > 0 && File.Exists(args[0])) { form.OpenFile(args[0]); } Application.Run(form); } }
private void tvTemplates_DoubleClick(object sender, EventArgs e) { switch (tvTemplates.SelectedNode.Level) { case 2: FileInfo fi = tvTemplates.SelectedNode.Tag as FileInfo; MainForm.OpenFile(fi); break; default: break; } }
private void projectTree_OpenProjectTemplate(object sender, ProjectNodeEventArgs e) { try { //get the top form MainForm mainform = this.TopLevelControl as MainForm; if (mainform != null) { mainform.OpenFile(e.Project.FileName, e.Project.ProjectName); } } catch (Exception ex) { Program.ShowMessageBox("FrmVSManager.projectTree_OpenProjectTemplate", ex); } }
private void templateTree_OpenModule(object sender, ModuleNodeEventArgs e) { try { //get the top form MainForm mainform = this.TopLevelControl as MainForm; if (mainform != null) { mainform.OpenFile(e.Module.FullName, e.Module.ModuleName); } } catch (Exception ex) { Program.ShowMessageBox("FrmTemplateManager.templateTree_OpenXsltTemplate", ex); } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm mainForm = new MainForm(); object location = null; if (args.Length > 0) { if (args[0].StartsWith("prev_instance:")) { // User clicked "New". Get location of previous // instance and open new form slightly lower // and to the right of previous form, unless // previous form's Window State is maximized. Point prevLoc = new Point(); try { PointConverter pc = new PointConverter(); prevLoc = (Point)(pc.ConvertFromString(args[0].Substring(14))); } catch (Exception ex) { MessageBox.Show("Error: " + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } // if (prevLoc.X > 0) { // Open new form slightly lower and // to the right of previous form. location = new Point(prevLoc.X + 35, prevLoc.Y + 35); mainForm.StartPosition = FormStartPosition.Manual; // mainForm.GetSettings(new Point(prevLoc.X + 35, prevLoc.Y + 35)); } } else { mainForm.GetSettings(null); // Windows Explorer selected this application // to open a file. The first argument should // be the path of the file to open. mainForm.OpenFile(args[0]); } } mainForm.GetSettings(location); Application.Run(mainForm); }
private void openFileButton_Click(object sender, EventArgs e) { try { if (m_Parent.OpenFile()) { DialogResult = DialogResult.OK; Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message); Trace.Write(ex.StackTrace); } }
private static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.AddMessageFilter(new AltKeyFilter()); using (var form = new MainForm()) { if (args.Length > 0 && File.Exists(args[0])) { form.OpenFile(args[0]); } Application.Run(form); } }
private void TreeViewSolutionDoubleClick(object sender, EventArgs e) { if (treeViewSolution.SelectedNode.Tag != null) { IProjectFile file = treeViewSolution.SelectedNode.Tag as CrcsProject; if (file == null) { file = treeViewSolution.SelectedNode.Tag as CrcsSolution; } if (file != null) { MainForm.OpenFile(file); treeViewSolution.SelectedNode = treeViewSolution.SelectedNode.Parent; return; } } if (SelectedItems.Count() == 0) { return; } if (SelectedItems.OfType <CrcsProject>().Count() > 0) { return; } if (SelectedItems.OfType <CrcsSolution>().Count() > 0) { return; } try { Cursor = Cursors.WaitCursor; MainForm.OpenSelectedFiles(); } finally { Cursor = Cursors.Default; } }
private void mnuEdit_Click(object sender, EventArgs e) { FileInfo fi = tvTemplates.SelectedNode.Tag as FileInfo; MainForm.OpenFile(fi); }
private void uiCommandManager1_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { try { switch (e.Command.Key) { case "cmdPrintGrid": if (gridEXPrintDocument1.GridEX == null) { gridEXPrintDocument1.GridEX = ucRecordList1.RecordsGridEx; } UIHelper.GridExPrintDocument(gridEXPrintDocument1); break; case "cmdPrintPreview": if (gridEXPrintDocument1.GridEX == null) { gridEXPrintDocument1.GridEX = ucRecordList1.RecordsGridEx; } UIHelper.GridExPrintPreview(gridEXPrintDocument1); break; case "cmdFirstHit": MoveToDoc(FullTextNavigation.MoveFirst, false); break; case "cmdPrevHit": MoveToHit(MoveHit.MovePrevious); break; case "cmdNextHit": MoveToHit(MoveHit.MoveNext); break; case "cmdLastHit": MoveToDoc(FullTextNavigation.MoveLast, true); break; case "cmdFirst": MoveToDoc(FullTextNavigation.MoveFirst, false); break; case "cmdPrev": MoveToDoc(FullTextNavigation.MovePrevious, false); break; case "cmdNext": MoveToDoc(FullTextNavigation.MoveNext, false); break; case "cmdLast": MoveToDoc(FullTextNavigation.MoveLast, false); break; case "tsJump": fFile f = MainForm.OpenFile(CurrentRow().FileId); f.MoreInfo("document", CurrentRow().DocId); break; case "tsRevise": lmWinHelper.ReviseDocument(AtMng.GetFile(CurrentRow().FileId), CurrentRow().DocId); break; case "cmdGridExFilter": if (e.Command.IsChecked) { ucRecordList1.RecordsGridEx.FilterMode = Janus.Windows.GridEX.FilterMode.Automatic; } else { ucRecordList1.RecordsGridEx.FilterMode = Janus.Windows.GridEX.FilterMode.None; } break; case "cmdGridExGroupBy": if (e.Command.IsChecked) { ucRecordList1.RecordsGridEx.GroupByBoxVisible = true; } else { ucRecordList1.RecordsGridEx.RootTable.Groups.Clear(); ucRecordList1.RecordsGridEx.GroupByBoxVisible = false; } break; case "cmdFldChooser": ucRecordList1.RecordsGridEx.ShowFieldChooser(this); break; case "tsCloseResults": this.Close(); break; case "tsHitHilite": SetPreview(tsHitHilite.IsChecked); break; case "tsPreview": SetPreview(tsPreview1.IsChecked); break; case "tsReviseSearchCriteria": if (!myfAS.IsDisposed) { MainForm.Focus(); myfAS.Activate(); } else { MessageBox.Show(LawMate.Properties.Resources.TheAdvancedSearchScreenIsNoLongerAccessible, LawMate.Properties.Resources.AdvancedSearchScreenNotAccessible, MessageBoxButtons.OK, MessageBoxIcon.Information); tsReviseSearchCriteria.Enabled = Janus.Windows.UI.InheritableBoolean.False; } break; case "tsShowDetails": if (tsShowDetails.IsChecked) { pnlResultDetails.Closed = false; } else { pnlResultDetails.Closed = true; } break; case "cmdJumptToActivity": MainForm.OpenFile(CurrentRow().FileId); break; case "cmdToggleHighlight": if (!cmdToggleHighlight.IsChecked) { IsFullTextSearch = false; //Suspend IsFullTextSearch so preview shows doc in proper ucdoc doc display control PreviewCurrentDoc(); IsFullTextSearch = true; //Set IsFullTextSearch back to original value } else { PreviewCurrentDoc(); } break; } } catch (Exception x) { UIHelper.HandleUIException(x); } }
public void OpenCommand(string filePath) => MainForm.OpenFile(filePath);
private void ControlFrm_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.O: if (e.Control) { mainfrm.OpenFile(); } break; case Keys.S: if (e.Control) { mainfrm.CallSettings(); } break; case Keys.U: if (e.Control) { mainfrm.CallTV(); } break; case Keys.F7: case Keys.D1: //ControlBox = !ControlBox; //if (ControlBox) // toolStripMenuItem_Mini.Image = null; //else // toolStripMenuItem_Mini.Checked = true; //if (this.FormBorderStyle == FormBorderStyle.Sizable) // this.FormBorderStyle = FormBorderStyle.None; //else // this.FormBorderStyle = FormBorderStyle.Sizable; break; case Keys.Enter: case Keys.F11: mainfrm.MaxScreen(); break; case Keys.F5: mainfrm.axPlayer1.Close(); mainfrm.axPlayer1.Open(mainfrm.axPlayer1.GetConfig(4)); //AfterOpenFile(); mainfrm.ResetControlPanel(); break; case Keys.Space: case Keys.MediaPlayPause: if (mainfrm.axPlayer1.GetState() == (int)PublicClass.PLAY_STATE.PS_READY) { mainfrm.OpenFile(); break; } if (mainfrm.axPlayer1.GetState() == (int)PublicClass.PLAY_STATE.PS_PLAY) { mainfrm.axPlayer1.Pause(); mainfrm.toolStripMenuItem_PlayPause.Text = "播放"; Bitmap bmp = (Properties.Resources.Play24); Icon ico = Icon.FromHandle(bmp.GetHicon()); mainfrm.buttonPlayPause.Icon = ico; mainfrm.buttonPlayPause.Tooltip = "播放"; } else { mainfrm.axPlayer1.Play(); mainfrm.toolStripMenuItem_PlayPause.Text = "暂停"; Bitmap bmp = (Properties.Resources.Pause24); Icon ico = Icon.FromHandle(bmp.GetHicon()); mainfrm.buttonPlayPause.Icon = ico; mainfrm.buttonPlayPause.Tooltip = "暂停"; } break; case Keys.F8: mainfrm.CallScreenShot(); break; case Keys.F9: mainfrm.b_EnhanceImageQuality = !mainfrm.b_EnhanceImageQuality; mainfrm.EnhanceImageQuality(); break; case Keys.F10: mainfrm.str_TopMost = "TopMostWhilePlay"; mainfrm.SetTopMost(); break; case Keys.Escape: { if (mainfrm.b_isFullScreen) { mainfrm.MaxScreen(); } } break; case Keys.ShiftKey: mainfrm.EnhanceContrast(); break; case Keys.Up: case Keys.VolumeUp: { mainfrm.VolumnUp(); } break; case Keys.Down: case Keys.VolumeDown: { mainfrm.VolumnDown(); } break; case Keys.Left: //{ // if (!mainfrm.b_PlayTV) // { // int nPosition = axPlayer1.GetPosition(); // if (nPosition - n_FastBack * 1000 > 0) // axPlayer1.SetPosition(nPosition - n_FastBack * 1000); // else // axPlayer1.SetPosition(0); // } //} break; case Keys.Right: //{ // if (!b_PlayTV) // { // int nPosition = axPlayer1.GetPosition(); // if (nPosition + n_FastForward * 1000 < axPlayer1.GetDuration()) // axPlayer1.SetPosition(nPosition + n_FastForward * 1000); // else // axPlayer1.Close(); // } //} break; case Keys.VolumeMute: Mute(); break; default: break; } }