Beispiel #1
0
 internal static BaseItem CreateItemFromXml(System.Xml.XmlElement xmlItem)
 {
     string cl = xmlItem.GetAttribute("class");
     BaseItem returnItem = null;
     switch (cl)
     {
         case "DevComponents.DotNetBar.ButtonItem":
             returnItem = new ButtonItem();
             break;
         case "DevComponents.DotNetBar.TextBoxItem":
             returnItem = new TextBoxItem();
             break;
         case "DevComponents.DotNetBar.ComboBoxItem":
             returnItem = new ComboBoxItem();
             break;
         case "DevComponents.DotNetBar.LabelItem":
             returnItem = new LabelItem();
             break;
         case "DevComponents.DotNetBar.CustomizeItem":
             returnItem = new CustomizeItem();
             break;
         case "DevComponents.DotNetBar.ControlContainerItem":
             returnItem = new ControlContainerItem();
             break;
         case "DevComponents.DotNetBar.DockContainerItem":
             returnItem = new DockContainerItem();
             break;
         case "DevComponents.DotNetBar.MdiWindowListItem":
             returnItem = new MdiWindowListItem();
             break;
         case "DevComponents.DotNetBar.SideBarContainerItem":
             returnItem = new SideBarContainerItem();
             break;
         case "DevComponents.DotNetBar.SideBarPanelItem":
             returnItem = new SideBarPanelItem();
             break;
         case "DevComponents.DotNetBar.ExplorerBarGroupItem":
             returnItem = new ExplorerBarGroupItem();
             break;
         case "DevComponents.DotNetBar.ExplorerBarContainerItem":
             returnItem = new ExplorerBarContainerItem();
             break;
         case "DevComponents.DotNetBar.ProgressBarItem":
             returnItem = new ProgressBarItem();
             break;
         case "DevComponents.DotNetBar.ColorPickerDropDown":
             returnItem = new ColorPickerDropDown();
             break;
         default:
             {
                 try
                 {
                     //System.Windows.Forms.MessageBox.Show("Loading custom: "+xmlItem.GetAttribute("assembly")+"   "+xmlItem.GetAttribute("class"));
                     System.Reflection.Assembly a = System.Reflection.Assembly.Load(xmlItem.GetAttribute("assembly"));
                     if (a == null)
                         return null;
                     BaseItem item = a.CreateInstance(xmlItem.GetAttribute("class")) as BaseItem;
                     returnItem = item;
                 }
                 catch (Exception e)
                 {
                     throw new ArgumentException("Could not create item from XML. Assembly=" + xmlItem.GetAttribute("assembly") + ", Class=" + xmlItem.GetAttribute("class") + ", Inner Exception: " + e.Message + ", Source=" + e.Source);
                 }
                 break;
             }
     }
     return returnItem;
 }
Beispiel #2
0
		/// <summary>
		/// Returns copy of SideBarContainerItem item
		/// </summary>
		public override BaseItem Copy()
		{
			SideBarContainerItem objCopy=new SideBarContainerItem();
			this.CopyToItem(objCopy);
			return objCopy;
		}
Beispiel #3
0
		/// <summary>
		/// Creates new instance of side bar control.
		/// </summary>
		public SideBar()
		{
			m_ItemContainer=new SideBarContainerItem();
			m_ItemContainer.GlobalItem=false;
			m_ItemContainer.ContainerControl=this;
			m_ItemContainer.Stretch=false;
			m_ItemContainer.Displayed=true;
			m_ItemContainer.SetOwner(this);

			//this.SetStyle(ControlStyles.Selectable,false);
			this.SetStyle(ControlStyles.UserPaint,true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint,true);
			this.SetStyle(ControlStyles.Opaque,true);
			this.SetStyle(ControlStyles.ResizeRedraw,true);
			this.SetStyle(DisplayHelp.DoubleBufferFlag,true);

			//this.TabStop=false;
			//this.Font=System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font;

			if(!ColorFunctions.ColorsLoaded)
			{
				NativeFunctions.RefreshSettings();
				NativeFunctions.OnDisplayChange();
				ColorFunctions.LoadColors();
			}

			#if TRIAL
				RemindForm frm=new RemindForm();
				frm.ShowDialog();
			#endif

			try
			{
				m_MoveCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGMOVE.CUR");
				m_CopyCursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGCOPY.CUR");
				m_NACursor=new Cursor(typeof(DevComponents.DotNetBar.DotNetBarManager),"DRAGNONE.CUR");
			}
			catch(Exception)
			{
				m_MoveCursor=null;
				m_CopyCursor=null;
				m_NACursor=null;
			}
			this.AccessibleRole=AccessibleRole.ToolBar;

			m_ColorScheme=new ColorScheme();
            StyleManager.Register(this);
		}