/// <summary> /// Loads the current Docking Layout if exists, or creates the default layout. /// Generates all the Events that we need to watch for. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { m_deserializeDockContent = new DeserializeDockContent(GetDockContentFromPersistString); string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config"); if (File.Exists(configFile)) // Load DockingPanel Layout. { try { DockingPanel.LoadFromXml(configFile, m_deserializeDockContent); } catch (Exception ex) { if (ConsoleWindow != null) { ConsoleWindow.Log("Error: " + ex.Message); } } } else // Create default layout. { ConsoleWindow.Show(DockingPanel, DockState.DockBottom); FileLoader.Show(DockingPanel, DockState.DockLeft); Histogram.Show(DockingPanel, DockState.DockLeft); Statistics.Show(DockingPanel, DockState.DockLeft); ModificationTypes.Show(DockingPanel, DockState.DockRight); ModificationProperties.Show(DockingPanel, DockState.DockRight); ImageDisplay.Show(DockingPanel, DockState.DockRight); CommandBox.Show(DockingPanel, DockState.DockBottom); } ImageDisplay.FormClosing += ImageDisplay_FormClosing; ImageDisplay.MediaFailedToLoad += ImageDisplay_MediaFailedToLoad; ImageDisplay.MediaLoaded += ImageDisplay_MediaLoaded; ImageDisplay.MediaPixelColour += ImageDisplay_MediaPixelColour; ImageDisplay.MediaPixelCoordinates += ImageDisplay_MediaPixelCoordinates; ImageDisplay.ImageDisplayLog += ImageDisplay_ImageDisplayLog; Histogram.histogramLog += Histogram_histogramStatus; Histogram.histogramCompleted += Histogram_histogramCompleted; Statistics.StatisticsLog += Statistics_StatisticsLog; FileLoader.ThumbnailSelected += FileLoader_ThumbnailSelected; ModificationTypes.SusanSelected += ModificationTypes_SusanSelected; ModificationTypes.HarrisSelected += ModificationTypes_HarrisSelected; ModificationTypes.MoravecSelected += ModificationTypes_MoravecSelected; ModificationTypes.FASTSelected += ModificationTypes_FASTSelected; ModificationProperties.ModificationPropertiesLog += ModificationProperties_ModificationPropertiesLog; ModificationProperties.UpdateImage += ModificationProperties_UpdateImage; ModificationProperties.CurrentImage = CurrentImage; }
private void Start(string args, string sPackName) { Configuration C = new Configuration(); #pragma warning disable IDE0067 // Objekte verwerfen, bevor Bereich verloren geht Process minecraft = new Process(); #pragma warning restore IDE0067 // Objekte verwerfen, bevor Bereich verloren geht // check for "minecraft" folder if (!Directory.Exists(_sPacksDir + @"\" + sPackName + @"\minecraft")) { Directory.CreateDirectory(_sPacksDir + @"\" + sPackName + @"\minecraft"); } minecraft.StartInfo.FileName = C.GetJavaPath(); minecraft.StartInfo.WorkingDirectory = _sPacksDir + @"\" + sPackName + @"\minecraft"; minecraft.StartInfo.Arguments = args; minecraft.StartInfo.RedirectStandardOutput = true; minecraft.StartInfo.RedirectStandardError = true; minecraft.StartInfo.UseShellExecute = false; minecraft.StartInfo.CreateNoWindow = true; minecraft.OutputDataReceived += new DataReceivedEventHandler(Minecraft_OutputDataReceived); minecraft.ErrorDataReceived += new DataReceivedEventHandler(Minecraft_ErrorDataReceived); minecraft.Exited += new EventHandler(Minecraft_Exited); minecraft.EnableRaisingEvents = true; // load console if (C.ShowConsole == 1) { CloseOldConsole(); _console = new FrmConsole(); _console.Show(); _console.Clear(); _console.AddLine(String.Format("UglyLauncher-Version: {0}", Application.ProductVersion), Color.Blue); _console.AddLine("Using Java-Version: " + C.GetJavaPath() + " (" + C.GetJavaArch() + "bit)", Color.Blue); _console.AddLine("Startparameter:" + args, Color.Blue); } // start minecraft minecraft.Start(); minecraft.BeginOutputReadLine(); minecraft.BeginErrorReadLine(); // raise event EventHandler <FormWindowStateEventArgs> handler = RestoreWindow; FormWindowStateEventArgs args2 = new FormWindowStateEventArgs { WindowState = FormWindowState.Minimized, MCExitCode = -1 }; handler?.Invoke(this, args2); }
public MainForm() { InitializeComponent(); CurrentForm = this; statusStrip1.BackgroundImage = Itop.Client.Resources.ImageListRes.GetBottomPhoto(); //ProjectTreeList pl = new ProjectTreeList(); //if (pl.ShowDialog() != DialogResult.OK) //{ // bl = true; // this.Close(); // return; //} this.Text = MIS.ApplicationCaption; this.FormClosing += delegate { Login.UserLogoutCommand.Exec(false); }; SetStatusLabel(); MIS.MainFormInterface = this; //创建控制台 m_mainConsoleForm = new FrmConsole(); //m_mainConsoleForm = new FrmMain(); //m_mainConsoleForm.PJ = pl.PJ; m_mainConsoleForm.MdiParent = this; m_mainConsoleForm.WindowState = FormWindowState.Maximized; m_mainConsoleForm.TopMost = true; m_mainConsoleForm.Show(); m_mainMenu.Visible = false; // 创建主菜单 ////////RefreshMainMenu(); this.Shown += delegate { // TODO 下面的代码是临时性质的代码 //Itop.Server.Interface.Forms.IFormsAction fa = // Itop.Common.RemotingHelper.GetRemotingService<Itop.Server.Interface.Forms.IFormsAction>(); //fa.CreateStoredProc(MIS.UserInfo); }; timer1.Start(); }
/// <summary> /// If the console window is not displayed show it, Create and show if necessary /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void consoleMenuItem_Click(object sender, EventArgs e) { if (ConsoleWindow != null && consoleMenuItem.Checked == false) { consoleMenuItem.Checked = true; ConsoleWindow.Show(DockingPanel, DockState.DockBottom); } else if (ConsoleWindow != null && consoleMenuItem.Checked == true) { consoleMenuItem.Checked = false; ConsoleWindow.Close(); } else { ConsoleWindow = new FrmConsole(); consoleMenuItem.Checked = true; ConsoleWindow.Show(DockingPanel, DockState.DockBottom); } }