Exemple #1
0
        /// <summary>
        /// KNXSwitch 转 SwitchNode
        /// </summary>
        /// <param name="knx"></param>
        public SwitchNode(KNXSwitch knx)
            : base(knx)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSwitchType;

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            this.ImageOn  = knx.ImageOn;
            this.ColorOn  = FrmMainHelp.HexStrToColor(knx.ColorOn);  // knx.ColorOn;
            this.ImageOff = knx.ImageOff;
            this.ColorOff = FrmMainHelp.HexStrToColor(knx.ColorOff); //knx.ColorOff;
        }
        public SceneButtonNode(KNXSceneButton knx)
            : base(knx)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxSceneButtonType;

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            this.ImageOn      = knx.ImageOn;
            this.ColorOn      = FrmMainHelp.HexStrToColor(knx.ColorOn);  // knx.ColorOn;
            this.ImageOff     = knx.ImageOff;
            this.ColorOff     = FrmMainHelp.HexStrToColor(knx.ColorOff); // knx.ColorOff;
            this.IsGroup      = (EBool)Enum.ToObject(typeof(EBool), knx.IsGroup);
            this.DefaultValue = knx.DefaultValue;
        }
Exemple #3
0
        /// <summary>
        /// KNXBlinds 转 BlindsNode
        /// </summary>
        /// <param name="knx"></param>
        public BlindsNode(KNXBlinds knx)
            : base(knx)
        {
            this.Name = ImageKey = SelectedImageKey = MyConst.Controls.KnxBlindsType;

            this.ReadAddressId   = knx.ReadAddressId ?? new Dictionary <string, KNXSelectedAddress>();
            this.WriteAddressIds = knx.WriteAddressIds ?? new Dictionary <string, KNXSelectedAddress>();

            this.LeftImage          = knx.LeftImage;
            this.LeftText           = knx.LeftText;
            this.LeftTextFontSize   = knx.LeftTextFontSize;
            this.LeftTextFontColor  = FrmMainHelp.HexStrToColor(knx.LeftTextFontColor); //knx.LeftTextFontColor;
            this.RightImage         = knx.RightImage;
            this.RightText          = knx.RightText;
            this.RightTextFontSize  = knx.RightTextFontSize;
            this.RightTextFontColor = FrmMainHelp.HexStrToColor(knx.RightTextFontColor);// knx.RightTextFontColor;
        }
Exemple #4
0
        /// <summary>
        /// KNXView 转 ViewNode
        /// </summary>
        /// <param name="knx"></param>
        public ViewNode(KNXView knx)
        {
            this.Id     = knx.Id;
            this.Text   = knx.Text;
            this.X      = knx.Left;
            this.Y      = knx.Top;
            this.Width  = knx.Width;
            this.Height = knx.Height;
            //this.Location = new Point(knx.Left, knx.Top);
            //this.Size = new Size(knx.Width, knx.Height);
            this.DisplayBorder   = (EBool)Enum.ToObject(typeof(EBool), knx.DisplayBorder);
            this.BorderColor     = FrmMainHelp.HexStrToColor(knx.BorderColor);
            this.Alpha           = knx.Alpha;
            this.Radius          = knx.Radius;
            this.FlatStyle       = (EFlatStyle)Enum.ToObject(typeof(EFlatStyle), knx.FlatStyle);
            this.BackgroundColor = FrmMainHelp.HexStrToColor(knx.BackgroundColor ?? "#FFFFFF");
            this.BackgroundImage = knx.BackgroundImage;
            this.FontColor       = FrmMainHelp.HexStrToColor(knx.FontColor ?? "#000000");
            this.FontSize        = knx.FontSize;

            this.State = ControlState.Normal;
        }