Ejemplo n.º 1
0
 private void SaveSubWindowsLayout(Stream stream)
 {
     try {
         MainDockPanel.SaveAsXml(stream, Encoding.UTF8);
     } catch (Exception ex) {
         Utility.ErrorReporter.SendErrorReport(ex, "サブウィンドウ レイアウトの保存に失敗しました。");
     }
 }
Ejemplo n.º 2
0
 private void SaveSubWindowsLayout(Stream stream)
 {
     try {
         MainDockPanel.SaveAsXml(stream, Encoding.UTF8);
     } catch (Exception ex) {
         Utility.ErrorReporter.SendErrorReport(ex, LoggerRes.FailedSaveLayout);
     }
 }
Ejemplo n.º 3
0
        private bool Shutdown(bool allowPrevent)
        {
            var shutdown = true;

            try
            {
                string dockConfigFileName = _startupPath + DOCK_CONFIG_FILE;

                IMyGenContent         mygenContent          = null;
                DockContentCollection dockContentCollection = MainDockPanel.Contents;
                var canClose = true;

                if (allowPrevent && !ZeusProcessManager.IsDormant)
                {
                    return(false);
                }

                foreach (IDockContent dockContent in dockContentCollection)
                {
                    mygenContent = dockContent as IMyGenContent;

                    // We need the MetaDataBrowser window to be closed last
                    // because it houses the UserMetaData
                    if (!(mygenContent is MetaDataBrowser))
                    {
                        canClose = mygenContent.CanClose(allowPrevent);

                        if (allowPrevent && !canClose)
                        {
                            shutdown = false;
                            break;
                        }
                    }

                    if (dockContent.DockHandler.IsHidden)
                    {
                        dockContent.DockHandler.Close();
                    }
                }

                if (shutdown)
                {
                    MainDockPanel.SaveAsXml(dockConfigFileName);
                }
            }
            catch
            {
                shutdown = true;
            }

            return(shutdown);
        }
Ejemplo n.º 4
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                if (ClosingControl == "ToolStripMenuItem")
                {
                    CloseAllTab();
                    var fi = new FileInfo(Config.DockSettingFileName);
                    if (fi.Directory != null && !fi.Directory.Exists)
                    {
                        fi.Directory.Create();
                    }
                    if (!_hasDockSettingExceptioin)
                    {
                        MainDockPanel.SaveAsXml(Config.DockSettingFileName);
                    }
                    if (!_hasViewSettingException)
                    {
                        SaveViewSetting();
                    }

                    var ph = new ProxyHelper();
                    ph.SetIEProxy("", 0);

                    try
                    {
                        XmlHelper.XmlSerialize(Config.LastProxyFileName, ProxyData.ProxyList, typeof(List <ProxyServer>));
                        //设置最后的列表
                    }
                    catch
                    {
                    }

                    notifyIconMain.Dispose();
                    Process.GetCurrentProcess().Kill();
                }
                else
                {
                    WindowState = FormWindowState.Minimized;
                    e.Cancel    = true;
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowExceptionMessage(ex);
            }
        }
Ejemplo n.º 5
0
 private void saveLayoutToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MainDockPanel.SaveAsXml(LAYOUT_FILE);
 }