Esempio n. 1
0
        public MainForm()
        {
            mfm = new MainFormModel();
            InitializeComponent();
            foreach (var i in mfm.templates)
            {
                templateList.Items.Add(i.TemplateName);
            }

            #region Load Default Model
            templateName.Text          = DefaultTemplate.TemplateName;
            usingImage.Checked         = DefaultTemplate.UsingImage;
            useDeviceName.Checked      = DefaultTemplate.UseDeviceName;
            loop.Checked               = DefaultTemplate.LoopAnimation;
            assetLocation.Text         = DefaultTemplate.AssetLocation;
            defaultName.Text           = DefaultTemplate.DefaultDeviceName;
            buttonText.Text            = DefaultTemplate.ButtonText;
            windowBackground.BackColor = mfm.FromHex(DefaultTemplate.WindowBackground);
            windowForeground.BackColor = mfm.FromHex(DefaultTemplate.WindowForeground);
            buttonBackground.BackColor = mfm.FromHex(DefaultTemplate.ButtonBackground);
            buttonForeground.BackColor = mfm.FromHex(DefaultTemplate.ButtonForeground);
            tint.BackColor             = mfm.FromHex(DefaultTemplate.Tint);
            #endregion

            foreach (var i in mfm.devices.Devices)
            {
                deviceList.Items.Add(i.DeviceName);
            }
        }
Esempio n. 2
0
 private void UpdateFromTemplate(Template template)
 {
     templateName.Text          = template.TemplateName;
     usingImage.Checked         = template.UsingImage;
     useDeviceName.Checked      = template.UseDeviceName;
     loop.Checked               = template.LoopAnimation;
     assetLocation.Text         = template.AssetLocation;
     defaultName.Text           = template.DefaultDeviceName;
     buttonText.Text            = template.ButtonText;
     windowBackground.BackColor = mfm.FromHex(template.WindowBackground);
     windowForeground.BackColor = mfm.FromHex(template.WindowForeground);
     buttonBackground.BackColor = mfm.FromHex(template.ButtonBackground);
     buttonForeground.BackColor = mfm.FromHex(template.ButtonForeground);
     tint.BackColor             = mfm.FromHex(template.Tint);
 }