Пример #1
0
        public CockpitPanel(CockpitForm form, ControlManager manager, IImageCache imageCache, CockpitXML.CockpitLayoutPanel layout)
        {
            this.name = layout.Name;
            this.form = form;

            if (layout.ControlLayout != null)
            {
                // Now construct the list of controls that are actually used in the layout
                foreach (CockpitXML.CockpitLayoutPanelControlLayout controlLayout in layout.ControlLayout)
                {
                    if (manager.HasControl(controlLayout.ControlName))
                    {
                        ICockpitControl        control  = manager.GetControl(controlLayout.ControlName);
                        CockpitControlInstance formItem = new CockpitControlInstance(this, control, new Point(controlLayout.X, controlLayout.Y));
                        controlInstances.Add(formItem);
                        control.AddInstance(formItem);
                    }
                }
            }

            this.Location        = new Point(layout.X, layout.Y);
            this.Size            = new Size(layout.Width, layout.Height);
            this.backgroundImage = imageCache.getImage(layout.BackgroundImage);
            if (layout.VisibleSpecified)
            {
                this.Visible = layout.Visible;
            }
            else
            {
                this.Visible = true;
            }
        }
Пример #2
0
 public CockpitControlInstance(CockpitPanel panel, ICockpitControl control, Point location)
 {
     this.panel     = panel;
     this.control   = control;
     this.location  = location;
     this.rectangle = new Rectangle(location, control.Size);
 }