Esempio n. 1
0
        protected virtual void Redimension()
        {
            Vector2 fontDimensions = Font.MeasureString(Text);

            int dx = this.offsetX;
            int dy = this.offsetY;
            int dw = (int)fontDimensions.X;
            int dh = (int)fontDimensions.Y;

            DrawRectangle = PanelFactory.CalculateDrawRectangle(this.position, dx, dy, dw, dh, Parent, UserInterface);
        }
Esempio n. 2
0
        public Panel GetInheritedPanel(string inheritedClassName, XmlNode panelXML, UserInterface userInterface)
        {
            Panel panel;

            if (InterfaceFactory.ReferencedTypes.Keys.Contains(inheritedClassName))
            {
                panel = new PanelFactory().CreateNewPanelByTypeWithParent(panelXML, _panelCreate.UserInterface,
                                                                          InterfaceFactory.ReferencedTypes[
                                                                              inheritedClassName],
                                                                          _panelCreate);
            }
            else
            {
                throw new Exception("Get Inherited Panel Failed: Could not find class of type:" + inheritedClassName);
            }

            return(panel);
        }