Пример #1
0
 public SettingsStub(ToolStripSettings toolStripSettings)
 {
     this.ToolStripPanelName = toolStripSettings.ToolStripPanelName;
     this.Visible            = toolStripSettings.Visible;
     this.Size      = toolStripSettings.Size;
     this.Location  = toolStripSettings.Location;
     this.Name      = toolStripSettings.Name;
     this.ItemOrder = toolStripSettings.ItemOrder;
 }
Пример #2
0
        internal void Load()
        {
            ArrayList toolStripSettingsToApply = new ArrayList();

            foreach (ToolStrip strip in this.FindToolStrips(true, this.form.Controls))
            {
                if ((strip != null) && !string.IsNullOrEmpty(strip.Name))
                {
                    ToolStripSettings toolStripSettings = new ToolStripSettings(this.GetSettingsKey(strip));
                    if (!toolStripSettings.IsDefault)
                    {
                        toolStripSettingsToApply.Add(new SettingsStub(toolStripSettings));
                    }
                }
            }
            this.ApplySettings(toolStripSettingsToApply);
        }
Пример #3
0
 internal void Save()
 {
     foreach (ToolStrip strip in this.FindToolStrips(true, this.form.Controls))
     {
         if ((strip != null) && !string.IsNullOrEmpty(strip.Name))
         {
             ToolStripSettings settings = new ToolStripSettings(this.GetSettingsKey(strip));
             SettingsStub      stub     = new SettingsStub(strip);
             settings.ItemOrder          = stub.ItemOrder;
             settings.Name               = stub.Name;
             settings.Location           = stub.Location;
             settings.Size               = stub.Size;
             settings.ToolStripPanelName = stub.ToolStripPanelName;
             settings.Visible            = stub.Visible;
             settings.Save();
         }
     }
 }
Пример #4
0
        internal void Load()
        {
            ArrayList savedToolStripSettingsObjects = new ArrayList();

            foreach (ToolStrip toolStrip in FindToolStrips(true, form.Controls))
            {
                if (toolStrip != null && !string.IsNullOrEmpty(toolStrip.Name))
                {
                    ToolStripSettings toolStripSettings = new ToolStripSettings(GetSettingsKey(toolStrip));

                    // Check if we have settings saved out for this toolstrip. If so, add it to our apply list.
                    if (!toolStripSettings.IsDefault)
                    {
                        savedToolStripSettingsObjects.Add(new SettingsStub(toolStripSettings));
                    }
                }
            }

            ApplySettings(savedToolStripSettingsObjects);
        }
Пример #5
0
        internal void Save()
        {
            foreach (ToolStrip toolStrip in FindToolStrips(true, form.Controls))
            {
                if (toolStrip != null && !string.IsNullOrEmpty(toolStrip.Name))
                {
                    ToolStripSettings toolStripSettings = new ToolStripSettings(GetSettingsKey(toolStrip));
                    SettingsStub      stub = new SettingsStub(toolStrip);

                    toolStripSettings.ItemOrder          = stub.ItemOrder;
                    toolStripSettings.Name               = stub.Name;
                    toolStripSettings.Location           = stub.Location;
                    toolStripSettings.Size               = stub.Size;
                    toolStripSettings.ToolStripPanelName = stub.ToolStripPanelName;
                    toolStripSettings.Visible            = stub.Visible;

                    toolStripSettings.Save();
                }
            }
        }
 public SettingsStub(ToolStripSettings toolStripSettings)
 {
     this.ToolStripPanelName = toolStripSettings.ToolStripPanelName;
     this.Visible = toolStripSettings.Visible;
     this.Size = toolStripSettings.Size;
     this.Location = toolStripSettings.Location;
     this.Name = toolStripSettings.Name;
     this.ItemOrder = toolStripSettings.ItemOrder;
 }
 internal void Save()
 {
     foreach (ToolStrip strip in this.FindToolStrips(true, this.form.Controls))
     {
         if ((strip != null) && !string.IsNullOrEmpty(strip.Name))
         {
             ToolStripSettings settings = new ToolStripSettings(this.GetSettingsKey(strip));
             SettingsStub stub = new SettingsStub(strip);
             settings.ItemOrder = stub.ItemOrder;
             settings.Name = stub.Name;
             settings.Location = stub.Location;
             settings.Size = stub.Size;
             settings.ToolStripPanelName = stub.ToolStripPanelName;
             settings.Visible = stub.Visible;
             settings.Save();
         }
     }
 }
 internal void Load()
 {
     ArrayList toolStripSettingsToApply = new ArrayList();
     foreach (ToolStrip strip in this.FindToolStrips(true, this.form.Controls))
     {
         if ((strip != null) && !string.IsNullOrEmpty(strip.Name))
         {
             ToolStripSettings toolStripSettings = new ToolStripSettings(this.GetSettingsKey(strip));
             if (!toolStripSettings.IsDefault)
             {
                 toolStripSettingsToApply.Add(new SettingsStub(toolStripSettings));
             }
         }
     }
     this.ApplySettings(toolStripSettingsToApply);
 }
Пример #9
0
 private void SaveWindowState()
 {
     if(!Settings.ToolbarsLocked)
     {
         //ToolStripManager.SaveSettings(this);
         ToolStripSettings newSettings = new ToolStripSettings();
         SaveToolStripPanel(this.toolStripContainer.TopToolStripPanel, "Top", newSettings);
         SaveToolStripPanel(this.toolStripContainer.LeftToolStripPanel, "Left", newSettings);
         SaveToolStripPanel(this.toolStripContainer.RightToolStripPanel, "Right", newSettings);
         SaveToolStripPanel(this.toolStripContainer.BottomToolStripPanel, "Bottom", newSettings);
         Settings.ToolbarSettings = newSettings;
     }
 }
Пример #10
0
 private void SaveToolStripRow(ToolStripPanelRow Row, ToolStripSettings newSettings, string Position, int rowIndex)
 {
     foreach(ToolStrip strip in Row.Controls)
     {
         //if(strip != menuStrip) {
         ToolStripSetting setting = new ToolStripSetting();
         setting.Dock = Position;
         setting.Row = rowIndex;
         setting.Left = strip.Left;
         setting.Top = strip.Top;
         setting.Name = strip.Name;
         setting.Visible = strip.Visible;
         newSettings.Add(setting);
         //}
     }
 }
 private static void SaveToolStripRow(ToolStripPanelRow row, ToolStripSettings newSettings, String position, int rowIndex)
 {
     foreach (ToolStrip strip in row.Controls)
     {
         ToolStripSetting setting = new ToolStripSetting();
         setting.Dock = position;
         setting.Row = rowIndex;
         setting.Left = strip.Left;
         setting.Top = strip.Top;
         setting.Name = strip.Name;
         setting.Visible = strip.Visible;
         newSettings.Add(newSettings.Count, setting);
     }
 }
        internal void Save() {
            foreach (ToolStrip toolStrip in FindToolStrips(true, form.Controls)) {
                if (toolStrip != null && !string.IsNullOrEmpty(toolStrip.Name)) {
                    ToolStripSettings toolStripSettings = new ToolStripSettings(GetSettingsKey(toolStrip));
                    SettingsStub stub = new SettingsStub(toolStrip);

                    toolStripSettings.ItemOrder = stub.ItemOrder;
                    toolStripSettings.Name = stub.Name;
                    toolStripSettings.Location = stub.Location;
                    toolStripSettings.Size = stub.Size;
                    toolStripSettings.ToolStripPanelName = stub.ToolStripPanelName;
                    toolStripSettings.Visible = stub.Visible;
                    
                    toolStripSettings.Save();
                }
            }
        }
        internal void Load() {
            ArrayList savedToolStripSettingsObjects = new ArrayList();

            foreach (ToolStrip toolStrip in FindToolStrips(true, form.Controls)) {
                if (toolStrip != null && !string.IsNullOrEmpty(toolStrip.Name)) {
                    ToolStripSettings toolStripSettings = new ToolStripSettings(GetSettingsKey(toolStrip));
                    
                    // Check if we have settings saved out for this toolstrip. If so, add it to our apply list.
                    if (!toolStripSettings.IsDefault) {
                        savedToolStripSettingsObjects.Add(new SettingsStub(toolStripSettings));
                    }
                }
            }

            ApplySettings(savedToolStripSettingsObjects);
        }
 private void SaveAllPanels()
 {
     var newSettings = new ToolStripSettings();
     SaveToolStripPanel(this.TopToolStripPanel, "Top", newSettings);
     SaveToolStripPanel(this.LeftToolStripPanel, "Left", newSettings);
     SaveToolStripPanel(this.RightToolStripPanel, "Right", newSettings);
     SaveToolStripPanel(this.BottomToolStripPanel, "Bottom", newSettings);
     newSettings.Save();
 }
        private void ReJoinAllPanels(ToolStripSettings newSettings)
        {
            foreach (ToolStripSetting setting in newSettings.Values)
            {
                ToolStrip strip = this.FindToolStripForSetting(setting);
                ToolStripMenuItem menuItem = this.FindMenuForSetting(setting);

                if (menuItem != null)
                {
                    menuItem.Checked = setting.Visible;
                }

                this.RestoreStripLayout(setting, strip);
            }
        }
 private void AplyAllPanelPositions(ToolStripSettings newSettings)
 {
     foreach (ToolStripSetting setting in newSettings.Values)
     {
         ToolStrip strip = this.FindToolStripForSetting(setting);
         strip.GripStyle = ToolStripGripStyle.Visible;
         //ChangeToolStripLock(strip);
         ApplyLastPosition(setting, strip);
     }
 }
Пример #17
0
 private void SaveToolStripPanel(ToolStripPanel Panel, string Position, ToolStripSettings newSettings)
 {
     int rowIndex = 0;
     foreach(ToolStripPanelRow row in Panel.Rows)
     {
         SaveToolStripRow(row, newSettings, Position, rowIndex);
         rowIndex++;
     }
 }
 private static void SaveToolStripPanel(ToolStripPanel panel, String position, ToolStripSettings newSettings)
 {
     for (Int32 rowIndex = 0; rowIndex < panel.Rows.Length; rowIndex++)
     {
         ToolStripPanelRow row = panel.Rows[rowIndex];
         SaveToolStripRow(row, newSettings, position, rowIndex);
     }
 }