Exemplo n.º 1
0
 /// <summary>
 /// Adds a dummy (for testing purposes)
 /// </summary>
 /// <param name="tab"></param>
 /// <returns></returns>
 private ShapesTab AddDummyShapes(ShapesTab tab)
 {
     try
     {
         tab.LargeImageList = this.imageList;
         for (int k = 0; k < 5; k++)
         {
             imageList.ImageSize  = new Size(48, 48);
             imageList.ColorDepth = ColorDepth.Depth8Bit;
             tab.AddItem("Item" + k);
         }
     }
     catch (Exception exc)
     {
         System.Diagnostics.Trace.WriteLine(exc.Message, "GraphShapesView.AddDummyShapes");
     }
     return(tab);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets a the tabpage with the given name or a new one if it does not yet exist
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        private ShapesTab GetTab(string text)
        {
            ShapesTab tab = null;

            for (int k = 0; k < this.tabControl.TabPages.Count; k++)
            {
                tab = this.tabControl.TabPages[k] as ShapesTab;
                if (tab.Text == text)
                {
                    return(tab);
                }
            }
            //didn't find it, let's make one
            tab      = new ShapesTab(text);
            tab.View = mView;
            this.tabControl.TabPages.Add(tab);
            tab.ShowDescription += new ItemDescription(ShowDescription);
            return(tab);
        }
		private ShapesTab AddDummyShapes(ShapesTab tab)
		{
			
			try
			{
				tab.LargeImageList=this.imageList;
				for(int k=0; k<5;k++)
				{
					imageList.ImageSize=new Size(48,48);
					imageList.ColorDepth=ColorDepth.Depth8Bit;
					tab.AddItem("Item" + k);
				}
			}
			catch(Exception exc)
			{
				System.Diagnostics.Trace.WriteLine(exc.Message);
			}
			return tab;
		}
		/// <summary>
		/// Gets a the tabpage with the given name or a new one if it does not yet exist
		/// </summary>
		/// <param name="text"></param>
		/// <returns></returns>
		private ShapesTab GetTab(string text)
		{
			ShapesTab tab = null;
			for(int k = 0 ; k<this.tabControl.TabPages.Count; k++)
			{
				tab = this.tabControl.TabPages[k] as ShapesTab;
				if(tab.Text == text) return tab;
			}
			//didn't find it, let's make one
			tab=new ShapesTab(text);
			tab.View = mView;
			this.tabControl.TabPages.Add(tab);
			tab.ShowDescription+=new ItemDescription(ShowDescription);
			return tab;

		}