Exemplo n.º 1
0
        /// <summary>
        /// Load widget-specific xml data.  Reads widget attributes
        /// from the xml file
        /// </summary>
        /// <param name="node"></param>
        public virtual void Load(XmlNode node)
        {
            SubClass = XmlUtils.GetXMLAttrString(node, "subclass");
            String colorScheme = XmlUtils.GetXMLAttrString(node, "colorScheme");

            if (!String.IsNullOrEmpty(colorScheme))
            {
                Colors = ThemeManager.Instance.ActiveTheme.Colors.GetColorScheme(colorScheme);
            }

            colorScheme = XmlUtils.GetXMLAttrString(node, "disabledButtonColorScheme");
            if (!String.IsNullOrEmpty(colorScheme))
            {
                DisabledButtonColors = ThemeManager.Instance.ActiveTheme.Colors.GetColorScheme(colorScheme);
            }

            DrawBorder = XmlUtils.GetXMLAttrBool(node, "drawBorder", DrawBorder);

            Panel = XmlUtils.GetXMLAttrString(node, "panel");

            EnabledState = parseEnabledValue(XmlUtils.GetXMLAttrString(node, "enabled", "true"));

            DefaultEnabled = XmlUtils.GetXMLAttrBool(node, "defaultEnabled", false);

            Enabled = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes an instance of the widget class
        /// </summary>
        /// <param name="control">The .NET Control that represents this widget</param>
        public Widget(Control control)
        {
            UIControl = control;

            _children = new List <Widget>();

            Visible  = true;
            Value    = String.Empty;
            Command  = String.Empty;
            SubClass = String.Empty;
            Panel    = String.Empty;

            Colors        = null;
            graphicsPath  = null;
            LayoutXmlNode = null;
            _layout       = null;
            Parent        = null;

            IsCommand             = false;
            AddForAnimation       = true;
            IsHighlightOn         = false;
            DrawBorder            = false;
            IsSelectedHighlightOn = false;
            _enabled = true;

            EnabledState       = EnabledStates.Enabled;
            _contextualWidgets = new List <Widget>();
            _finder            = new WidgetFinder(this);

            if (control != null)
            {
                widgetName = UIControl.Name;
                if (this is IButtonWidget)
                {
                    control.MouseClick += control_MouseClick;
                }

                control.Resize += control_Resize;
            }
            else
            {
                widgetName = string.Empty;
            }
        }
Exemplo n.º 3
0
 public bool CanExecute(Ticket selectedTicket)
 {
     if (string.IsNullOrEmpty(EnabledStates))
     {
         return(true);
     }
     if (EnabledStates.Contains("IsClosed") && selectedTicket.IsClosed)
     {
         return(true);
     }
     if (selectedTicket.IsClosed)
     {
         return(false);
     }
     if (EnabledStates == "*")
     {
         return(true);
     }
     if (DisplayOnOrders)
     {
         return(selectedTicket.Orders.Where(x => x.IsSelected).All(x => IsInState(x, EnabledStates)));
     }
     return(IsInState(selectedTicket, EnabledStates));
 }
Exemplo n.º 4
0
Arquivo: Widget.cs Projeto: glwu/acat
        /// <summary>
        /// Load widget-specific xml data.  Reads widget attributes
        /// from the xml file
        /// </summary>
        /// <param name="node"></param>
        public virtual void Load(XmlNode node)
        {
            SubClass = XmlUtils.GetXMLAttrString(node, "subclass");
            String colorScheme = XmlUtils.GetXMLAttrString(node, "colorScheme");
            if (!String.IsNullOrEmpty(colorScheme))
            {
                Colors = ThemeManager.Instance.ActiveTheme.Colors.GetColorScheme(colorScheme);
            }

            colorScheme = XmlUtils.GetXMLAttrString(node, "disabledButtonColorScheme");
            if (!String.IsNullOrEmpty(colorScheme))
            {
                DisabledButtonColors = ThemeManager.Instance.ActiveTheme.Colors.GetColorScheme(colorScheme);
            }

            DrawBorder = XmlUtils.GetXMLAttrBool(node, "drawBorder", DrawBorder);

            Panel = XmlUtils.GetXMLAttrString(node, "panel");

            EnabledState = parseEnabledValue(XmlUtils.GetXMLAttrString(node, "enabled", "true"));

            DefaultEnabled = XmlUtils.GetXMLAttrBool(node, "defaultEnabled", false);

            Enabled = true;
        }
Exemplo n.º 5
0
Arquivo: Widget.cs Projeto: glwu/acat
        /// <summary>
        /// Initializes an instance of the widget class
        /// </summary>
        /// <param name="control">The .NET Control that represents this widget</param>
        public Widget(Control control)
        {
            UIControl = control;

            _children = new List<Widget>();

            Value = String.Empty;
            SubClass = String.Empty;
            Panel = String.Empty;

            Colors = null;
            graphicsPath = null;
            LayoutXmlNode = null;
            _layout = null;
            Parent = null;

            AddForAnimation = true;
            IsHighlightOn = false;
            DrawBorder = false;
            IsSelectedHighlightOn = false;
            _enabled = true;

            EnabledState = EnabledStates.Enabled;
            _contextualWidgets = new List<Widget>();
            _finder = new WidgetFinder(this);

            if (control != null)
            {
                widgetName = UIControl.Name;
                if (this is IButtonWidget)
                {
                    control.MouseClick += control_MouseClick;
                }

                control.Resize += control_Resize;
            }
            else
            {
                widgetName = string.Empty;
            }
        }