Ejemplo n.º 1
0
        public void ShowPad(IPadContent content)
        {
            if (contentHash[content] == null)
            {
                IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties());
                string      type       = content.GetType().ToString();
                content.Control.Dock = DockStyle.None;
                Content c1;
                if (content.Icon != null)
                {
                    ImageList imgList = new ImageList();
                    imgList.Images.Add(content.Icon);
                    c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0);
                }
                else
                {
                    c1 = dockManager.Contents.Add(content.Control, content.Title);
                }

                c1.DisplaySize = new Size(270, 200);

                contentHash[content] = c1;


                if (properties.GetProperty(type, "Left") == "Left")
                {
                    if (leftContent == null)
                    {
                        leftContent = dockManager.AddContentWithState(c1, State.DockLeft);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, leftContent);
                    }
                }
                else if (properties.GetProperty(type, "Left") == "Bottom")
                {
                    if (bottomContent == null)
                    {
                        bottomContent = dockManager.AddContentWithState(c1, State.DockBottom);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, bottomContent);
                    }
                }
            }
            else
            {
                Content c = (Content)contentHash[content];
                if (c != null)
                {
                    dockManager.ShowContent(c);
                }
            }
        }
Ejemplo n.º 2
0
		public void ShowPad(IPadContent content)
		{
			if (contentHash[content] == null) 
			{
				IProperties properties = (IProperties)propertyService.GetProperty("Workspace.ViewMementos", new DefaultProperties());
				string type = content.GetType().ToString();
				content.Control.Dock = DockStyle.None;
				Content c1;
				if (content.Icon != null) 
				{
					ImageList imgList = new ImageList();
					imgList.Images.Add(content.Icon);
					c1 = dockManager.Contents.Add(content.Control, content.Title, imgList, 0);
				} 
				else 
				{
					c1 = dockManager.Contents.Add(content.Control, content.Title);
				}

                c1.DisplaySize = new Size(270, 200);

				contentHash[content] = c1;


                if (properties.GetProperty(type, "Left") == "Left")
                {
                    if (leftContent == null)
                    {
                        leftContent = dockManager.AddContentWithState(c1, State.DockLeft);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, leftContent);
                    }
                }
                else if (properties.GetProperty(type, "Left") == "Bottom")
                {
                    if (bottomContent == null)
                    {
                        bottomContent = dockManager.AddContentWithState(c1, State.DockBottom);
                    }
                    else
                    {
                        dockManager.AddContentToWindowContent(c1, bottomContent);
                    }
                }
			} 
			else 
			{
				Content c = (Content)contentHash[content];
				if (c != null) 
				{
					dockManager.ShowContent(c);
				}
			}
		}