Exemplo n.º 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;
 }
Exemplo n.º 2
0
		/// <summary>
		/// Creates new instance of side bar control.
		/// </summary>
		public ExplorerBar()
		{
			if(!ColorFunctions.ColorsLoaded)
			{
				NativeFunctions.RefreshSettings();
				NativeFunctions.OnDisplayChange();
				ColorFunctions.LoadColors();
			}
			m_ColorScheme=new ColorScheme(eDotNetBarStyle.Office2003);

			m_ItemContainer=new ExplorerBarContainerItem();
			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.SetStyle(ControlStyles.ContainerControl,true);
			this.SetStyle(ControlStyles.SupportsTransparentBackColor,true);

			this.TabStop=true;

			#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;
			}

			ApplyDefaultSettings();
			m_BackStyle.StyleChanged+=new EventHandler(this.VisualPropertyChanged);

			this.AccessibleRole=AccessibleRole.ToolBar;

            m_BackgroundStyle = new ItemStyleMapper(m_BackStyle);
		}
Exemplo n.º 3
0
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(m_ClickTimer!=null)
				{
					m_ClickTimer.Stop();
					m_ClickTimer.Dispose();
					m_ClickTimer=null;
				}
                if (m_ItemContainer != null)
                    m_ItemContainer.Dispose();
                m_ItemContainer = null;

                DisposeCursor(ref m_MoveCursor);
                DisposeCursor(ref m_CopyCursor);
                DisposeCursor(ref m_NACursor);
			}
            if (BarUtilities.DisposeItemImages && !this.DesignMode)
            {
                BarUtilities.DisposeImage(ref m_GroupButtonCollapseHot);
                BarUtilities.DisposeImage(ref m_GroupButtonCollapseNormal);
                BarUtilities.DisposeImage(ref m_GroupButtonCollapsePressed);
                BarUtilities.DisposeImage(ref m_GroupButtonExpandHot);
                BarUtilities.DisposeImage(ref m_GroupButtonExpandNormal);
                BarUtilities.DisposeImage(ref m_GroupButtonExpandPressed);
            }
			base.Dispose( disposing );
		}
Exemplo n.º 4
0
		/// <summary>
		/// Returns copy of ExplorerBarContainerItem item
		/// </summary>
		public override BaseItem Copy()
		{
			ExplorerBarContainerItem objCopy=new ExplorerBarContainerItem();
			this.CopyToItem(objCopy);
			return objCopy;
		}