protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            Properties.Settings.Default.CollapseClipboard = clipboard.Collapsed;
            OperatorsSidebar operatorsSidebar = MainFormManager.MainForm.Views.OfType <OperatorsSidebar>().FirstOrDefault();

            if (operatorsSidebar != null)
            {
                Properties.Settings.Default.CollapseOperatorsSidebar = operatorsSidebar.Collapsed;
            }
            Properties.Settings.Default.Save();
        }
Ejemplo n.º 2
0
        public override void Execute()
        {
            var view = MainFormManager.MainForm.Views.OfType <OperatorsSidebar>().FirstOrDefault();

            if (view == null)
            {
                OperatorsSidebar operatorsSidebar = new OperatorsSidebar();
                operatorsSidebar.Dock = DockStyle.Left;
                operatorsSidebar.Show();
                operatorsSidebar.Collapsed = Properties.Settings.Default.CollapseOperatorsSidebar;
            }
            else if (view.IsShown)
            {
                view.Hide();
            }
            else
            {
                view.Show();
            }
        }
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            AssemblyFileVersionAttribute version = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).
                                                   Cast <AssemblyFileVersionAttribute>().FirstOrDefault();

            title = "HeuristicLab Optimizer";
            if (version != null)
            {
                title += " " + version.Version;
            }
            Title = title;

            ContentManager.Initialize(new PersistenceContentManager());

            clipboard           = new Clipboard <IItem>();
            clipboard.Dock      = DockStyle.Left;
            clipboard.Collapsed = Properties.Settings.Default.CollapseClipboard;
            if (Properties.Settings.Default.ShowClipboard)
            {
                clipboard.Show();
            }
            if (Properties.Settings.Default.ShowOperatorsSidebar)
            {
                OperatorsSidebar operatorsSidebar = new OperatorsSidebar();
                operatorsSidebar.Dock = DockStyle.Left;
                operatorsSidebar.Show();
                operatorsSidebar.Collapsed = Properties.Settings.Default.CollapseOperatorsSidebar;
            }
            if (Properties.Settings.Default.ShowStartPage)
            {
                StartPage startPage = new StartPage();
                startPage.Show();
            }

            WindowState = Properties.Settings.Default.ShowMaximized ? FormWindowState.Maximized : FormWindowState.Normal;
        }