コード例 #1
0
ファイル: TsRow.cs プロジェクト: SomeZyla/TsGui
        private new void LoadXml(XElement InputXml)
        {
            base.LoadXml(InputXml);

            IEnumerable <XElement> xlist;
            int colIndex = 0;

            xlist = InputXml.Elements("Column");
            if (xlist != null)
            {
                foreach (XElement xColumn in xlist)
                {
                    TsColumn c = new TsColumn(xColumn, colIndex, this);

                    this._columns.Add(c);

                    ColumnDefinition coldef = new ColumnDefinition();
                    coldef.Width = GridLength.Auto;
                    this._rowpanel.ColumnDefinitions.Add(coldef);
                    Grid.SetColumn(c.Panel, colIndex);

                    this._rowpanel.Children.Add(c.Panel);
                    this._options.AddRange(c.Options);

                    colIndex++;
                }
            }
        }
コード例 #2
0
ファイル: TsTrafficLight.cs プロジェクト: SomeZyla/TsGui
 //constructor
 public TsTrafficLight(XElement InputXml, TsColumn Parent) : base(Parent)
 {
     this.Control = new TsTrafficLightUI();
     this._validationtooltiphandler.SetTarget(this.Control);
     this.LoadXml(InputXml);
     this.RefreshValue();
 }
コード例 #3
0
 //constructor
 public TsHeading(XElement InputXml, TsColumn Parent) : base(Parent)
 {
     this.ControlText             = string.Empty;
     this.Control                 = new TsHeadingUI();
     this.Label                   = new TsLabelUI();
     this.UserControl.DataContext = this;
     this.LoadXml(InputXml);
 }
コード例 #4
0
ファイル: TsInfoBox.cs プロジェクト: SomeZyla/TsGui
 //constructor
 public TsInfoBox(XElement InputXml, TsColumn Parent) : base(Parent)
 {
     this.Control = new TsInfoBoxUI();
     this.Label   = new TsLabelUI();
     this.UserControl.DataContext = this;
     this.SetDefaults();
     this._setvaluequerylist = new QueryPriorityList(this);
     this.LoadXml(InputXml);
     this.RefreshControlText();
 }
コード例 #5
0
ファイル: TsTickCross.cs プロジェクト: SomeZyla/TsGui
        public TsTickCross(TsColumn Parent, IDirector MainController) : base(Parent)
        {
            this._contentchanger = new ContentChanger();
            this._crossui        = new TsCrossUI();
            this._tickui         = new TsTickUI();
            this._warnui         = new TsWarnUI();

            this.Control = this._contentchanger;
            this._validationtooltiphandler.SetTarget(this.UserControl);
            this.SetDefaults();
        }
コード例 #6
0
ファイル: TsTickCross.cs プロジェクト: SomeZyla/TsGui
        //constructor
        public TsTickCross(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this._contentchanger = new ContentChanger();
            this._crossui        = new TsCrossUI();
            this._tickui         = new TsTickUI();
            this._warnui         = new TsWarnUI();

            this.Control = this._contentchanger;
            this._validationtooltiphandler.SetTarget(this.UserControl);
            this.SetDefaults();
            this.LoadXml(InputXml);
            this.RefreshValue();
        }
コード例 #7
0
        //Constructor
        public TsComplianceRefreshButton(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this._rootelement = this.GetComplianceRootElement();

            this.UserControl.DataContext = this;
            this._ui               = new TsButtonUI();
            this.Control           = this._ui;
            this._ui.button.Click += this.OnButtonClick;

            this.Label = new TsLabelUI();
            this.SetDefaults();
            this.LoadXml(InputXml);
        }
コード例 #8
0
ファイル: TsImage.cs プロジェクト: SomeZyla/TsGui
        //Constructor
        public TsImage(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this.Control = new TsImageUI();
            this.Label   = new TsLabelUI();
            this.UserControl.DataContext = this;
            this.SetDefaults();
            this.LoadXml(InputXml);

            if (this.Image != null)
            {
                this.Image.MultiImage.ImageScalingUpdate += this.OnImageScalingUpdate;
            }
        }
コード例 #9
0
ファイル: TsCheckBox.cs プロジェクト: SomeZyla/TsGui
        //Constructor
        public TsCheckBox(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this.UserControl.DataContext = this;
            TsCheckBoxUI cbui = new TsCheckBoxUI();

            this.Control            = cbui;
            this._checkboxui        = cbui;
            this.InteractiveControl = cbui.CheckBox;
            this.Label                     = new TsLabelUI();
            this.ValidationHandler         = new ValidationHandler(this);
            this._validationtooltiphandler = new ValidationToolTipHandler(this);

            this.SetDefaults();
            this._setvaluequerylist = new QueryPriorityList(this);
            this.LoadXml(InputXml);
        }
コード例 #10
0
ファイル: GuiFactory.cs プロジェクト: SomeZyla/TsGui
        public static IGuiOption CreateGuiOption(XElement OptionXml, TsColumn Parent)
        {
            XElement prebuiltx = PrebuiltFactory.GetPrebuiltXElement(OptionXml);

            if (prebuiltx == null)
            {
                return(GetGuiOption(OptionXml, Parent));
            }
            else
            {
                XAttribute xtype = OptionXml.Attribute("Type");
                prebuiltx.Add(xtype);
                IGuiOption g = GetGuiOption(prebuiltx, Parent);
                g.LoadXml(OptionXml);
                return(g);
            }
        }
コード例 #11
0
        //constructor
        public ComplianceOptionBase(TsColumn Parent) : base(Parent)
        {
            this.Label        = new TsLabelUI();
            this._rootelement = this.GetComplianceRootElement();
            if (this._rootelement == null)
            {
                throw new TsGuiKnownException("There is prooblem in the compliance tree. Root is null", string.Empty);
            }
            this._rootelement.ComplianceRetry += this.OnComplianceRetry;

            this.FillColor                 = new SolidColorBrush(Colors.Blue);
            this.StrokeColor               = new SolidColorBrush(Colors.Blue);
            this._compliancehandler        = new ComplianceHandler(this);
            this._validationtooltiphandler = new ValidationToolTipHandler(this);
            this._setvaluequerylist        = new QueryPriorityList(this);
            this.UserControl.DataContext   = this;
            this.SetDefaults();
        }
コード例 #12
0
        //Constructor
        public TsPasswordBox(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this._setvaluequerylist = null;

            this._passwordboxui = new TsPasswordBoxUI();
            this.Control        = this._passwordboxui;
            this.Label          = new TsLabelUI();
            this._passwordboxui.PasswordBox.KeyDown += this.OnKeyDown;

            this.UserControl.DataContext = this;
            this.SetDefaults();

            this.ValidationHandler         = new ValidationHandler(this);
            this._validationtooltiphandler = new ValidationToolTipHandler(this);

            this.LoadXml(InputXml);
            Director.Instance.ConfigLoadFinished += this.OnConfigLoadFinished;
        }
コード例 #13
0
ファイル: TsTreeView.cs プロジェクト: SomeZyla/TsGui
        //Constructor
        public TsTreeView(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this._treeviewui               = new TsTreeViewUI();
            this.Control                   = this._treeviewui;
            this.Label                     = new TsLabelUI();
            this.Icon                      = new TsFolderUI();
            this.UserControl.DataContext   = this;
            this.ValidationHandler         = new ValidationHandler(this);
            this._validationtooltiphandler = new ValidationToolTipHandler(this);

            this.SetDefaults();
            this.LoadXml(InputXml);
            this._builder.Rebuild();
            this.SetListViewDefault();

            this._treeviewui.TreeView.SelectedItemChanged += this.OnTreeViewSelectedItemChanged;
            this.UserControl.IsEnabledChanged             += this.OnActiveChanged;
            this.UserControl.IsVisibleChanged             += this.OnActiveChanged;
        }
コード例 #14
0
        //Constructor
        public TsDropDownList(XElement InputXml, TsColumn Parent) : base(Parent)
        {
            this._dropdownlistui    = new TsDropDownListUI();
            this.Control            = this._dropdownlistui;
            this.InteractiveControl = this._dropdownlistui.Control;
            this.Label                     = new TsLabelUI();
            this.ValidationHandler         = new ValidationHandler(this);
            this._validationtooltiphandler = new ValidationToolTipHandler(this);
            this.UserControl.DataContext   = this;

            this.SetDefaults();
            this.LoadXml(InputXml);
            this._builder.Rebuild();
            this.RegisterForItemGroupEvents();
            this.SetComboBoxDefault();

            Director.Instance.WindowLoaded += this.OnLoadReload;
            this._dropdownlistui.Control.SelectionChanged += this.OnSelectionChanged;
            this._dropdownlistui.Control.LostFocus        += this.OnLostFocus;
            this.UserControl.IsEnabledChanged             += this.OnActiveChanged;
            this.UserControl.IsVisibleChanged             += this.OnActiveChanged;
        }
コード例 #15
0
ファイル: GuiFactory.cs プロジェクト: SomeZyla/TsGui
        private static IGuiOption GetGuiOption(XElement OptionXml, TsColumn Parent)
        {
            XAttribute xtype = OptionXml.Attribute("Type");

            if (xtype == null)
            {
                throw new ArgumentException("Missing Type attribute on GuiOption" + Environment.NewLine);
            }

            LoggerFacade.Info("Creating GuiOption, type: " + xtype.Value);

            IGuiOption newoption = null;

            #region
            if (xtype.Value == "DropDownList")
            {
                newoption = new TsDropDownList(OptionXml, Parent);
            }

            else if (xtype.Value == "CheckBox")
            {
                newoption = new TsCheckBox(OptionXml, Parent);
            }
            else if (xtype.Value == "FreeText")
            {
                newoption = new TsFreeText(OptionXml, Parent);
            }

            else if (xtype.Value == "ComputerName")
            {
                newoption = new TsComputerName(OptionXml, Parent);
            }
            else if (xtype.Value == "Heading")
            {
                newoption = new TsHeading(OptionXml, Parent);
                return(newoption);
            }
            else if (xtype.Value == "InfoBox")
            {
                newoption = new TsInfoBox(OptionXml, Parent);
            }
            else if (xtype.Value == "TrafficLight")
            {
                newoption = new TsTrafficLight(OptionXml, Parent);
            }
            else if (xtype.Value == "TickCross")
            {
                newoption = new TsTickCross(OptionXml, Parent);
            }
            else if (xtype.Value == "Image")
            {
                newoption = new TsImage(OptionXml, Parent);
                return(newoption);
            }
            else if (xtype.Value == "ComplianceRefreshButton")
            {
                newoption = new TsComplianceRefreshButton(OptionXml, Parent);
                return(newoption);
            }
            else if (xtype.Value == "PasswordBox")
            {
                newoption = new TsPasswordBox(OptionXml, Parent);
            }
            else if (xtype.Value == "UsernameBox")
            {
                newoption = new TsUsernameBox(OptionXml, Parent);
            }
            else if (xtype.Value == "ActionButton")
            {
                newoption = new TsActionButton(OptionXml, Parent);
            }
            else if (xtype.Value == "TreeView")
            {
                newoption = new TsTreeView(OptionXml, Parent);
            }
            else if (xtype.Value == "Timeout")
            {
                if (GuiTimeout.Instance == null)
                {
                    throw new TsGuiKnownException("No Timeout section defined in config. Timeout GuiOption type not available", string.Empty);
                }
                newoption = new TsTimeout(OptionXml, Parent);
            }
            else
            {
                return(null);
            }
            #endregion

            Director.Instance.AddOptionToLibary(newoption);
            return(newoption);
        }
コード例 #16
0
 public GuiOptionBase(TsColumn Parent) : base(Parent)
 {
     this.UserControl         = new GuiOptionBaseUI();
     this.UserControl.Loaded += this.OnRendered;
 }
コード例 #17
0
 public TsUsernameBox(XElement InputXml, TsColumn parent) : base(parent)
 {
     this.SetDefaults();
     this.LoadXml(InputXml);
     this.RefreshValue();
 }
コード例 #18
0
ファイル: TsFreeText.cs プロジェクト: SomeZyla/TsGui
 protected TsFreeText(TsColumn Parent) : base(Parent)
 {
     this.Init();
 }
コード例 #19
0
ファイル: TsFreeText.cs プロジェクト: SomeZyla/TsGui
 //Constructor
 public TsFreeText(XElement InputXml, TsColumn Parent) : base(Parent)
 {
     this.Init();
     this.LoadXml(InputXml);
     this.RefreshValue();
 }
コード例 #20
0
 public TsComputerName(XElement InputXml, TsColumn Parent) : base(Parent)
 {
     base.LoadXml(this.BuildDefaultXml());
     base.LoadXml(InputXml);
     this.RefreshValue();
 }
コード例 #21
0
ファイル: TsTrafficLight.cs プロジェクト: SomeZyla/TsGui
 public TsTrafficLight(TsColumn Parent, IDirector MainController) : base(Parent)
 {
     this.Control = new TsTrafficLightUI();
     this._validationtooltiphandler.SetTarget(this.Control);
 }
コード例 #22
0
 //Constructor
 public CollectionViewGuiOptionBase(TsColumn Parent) : base(Parent)
 {
     this._setvaluequerylist = new QueryPriorityList(this);
     this._builder           = new ListBuilder(this);
 }