| 0: | // SideBarView.cs | |
| 1: | // Copyright (C) 2000 Mike Krueger | |
| 2: | // | |
| 3: | // This program is free software; you can redistribute it and/or modify | |
| 4: | // it under the terms of the GNU General Public License as published by | |
| 5: | // the Free Software Foundation; either version 2 of the License, or | |
| 6: | // (at your option) any later version. | |
| 7: | // | |
| 8: | // This program is distributed in the hope that it will be useful, | |
| 9: | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 10: | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 11: | // GNU General Public License for more details. | |
| 12: | // | |
| 13: | // You should have received a copy of the GNU General Public License | |
| 14: | // along with this program; if not, write to the Free Software | |
| 15: | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 16: | ||
| 17: | using System; | |
| 18: | using System.IO; | |
| 19: | using System.Windows.Forms; | |
| 20: | using System.Xml; | |
| 21: | ||
| 22: | using SharpDevelop.Gui; | |
| 23: | using SharpDevelop.Gui.Components; | |
| 24: | using SharpDevelop.Tool.Data; | |
| 25: | ||
| 26: | using TimeSprint.Alexandria.UI.SideBar; | |
| 27: | ||
| 28: | namespace SharpDevelop.Gui.Navigation { | |
| 29: | ||
| 30: | public class SideBarView : UserControl | |
| 31: | { | |
| 32: | SharpDevelopSideBar sideBar; | |
| 33: | public SideBarView(MainWindow mainwindow) | |
| 34: | { | |
| 35: | try { | |
| 36: | XmlDocument doc = new XmlDocument(); | |
| 37: | doc.Load(Options.ConfigDirectory + Path.DirectorySeparatorChar + "SideBarConfig.xml"); | |
| 38: | sideBar = new SharpDevelopSideBar(mainwindow, doc.DocumentElement["SideBar"]); | |
| 39: | } catch (Exception) { | |
| 40: | sideBar = new SharpDevelopSideBar(mainwindow); | |
| 41: | AxSideTab tab = new AxSideTab(sideBar, "General"); | |
| 42: | sideBar.Tabs.Add(tab); | |
| 43: | sideBar.ActiveTab = tab; | |
| 44: | tab = new AxSideTab(sideBar, "Clipboard Ring"); | |
| 45: | tab.CanBeDeleted = false; | |
| 46: | tab.CanDragDrop = false; | |
| 47: | sideBar.Tabs.Add(tab); | |
| 48: | } | |
| 49: | ||
| 50: | sideBar.Dock = DockStyle.Fill; | |
| 51: | ||
| 52: | this.Controls.Add(sideBar); | |
| 53: | } | |
| 54: | ||
| 55: | public void PutInClipboardRing(string text) | |
| 56: | { | |
| 57: | sideBar.PutInClipboardRing(text); | |
| 58: | } | |
| 59: | ||
| 60: | public void SaveSideBarViewConfig() | |
| 61: | { | |
| 62: | XmlDocument doc = new XmlDocument(); | |
| 63: | doc.LoadXml("<SideBarConfig/>"); | |
| 64: | doc.DocumentElement.AppendChild(sideBar.ToXmlElement(doc)); | |
| 65: | doc.Save(Options.ConfigDirectory + Path.DirectorySeparatorChar + "SideBarConfig.xml"); | |
| 66: | } | |
| 67: | } | |
| 68: | } | |
| 69: |
This page was automatically generated by SharpDevelop.