Exemplo n.º 1
0
        private void linkCurrentSchema_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (string.IsNullOrEmpty(linkCurrentSchema.Text))
            {
                return;
            }
            string localLocation = System.Environment.ExpandEnvironmentVariables("%userprofile%/downloads/") + "ColorProfile.json";


            using (StreamReader file = File.OpenText(localLocation))
            {
                JsonSerializer serializer = new JsonSerializer();
                _config = (ColorConfig)serializer.Deserialize(file, typeof(ColorConfig));
            }

            if (_config != null)
            {
                frmManage form = new frmManage();
                form._config               = _config;
                form._create               = false;
                form._readonly             = true;
                form.Text                  = "Busylight Color Schema Editor - READ ONLY";
                form._configurationManager = _configurationManager;

                form.Show();
                RefreshSchemas();
            }
        }
Exemplo n.º 2
0
        private void linkNew_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ColorConfig colorSchema = new ColorConfig();

            frmManage form = new frmManage();

            //lets see if the default exists and pull that in for them to change
            string fileLocation = @"I:\apps\ININColorSchemes\Default.json";

            if (File.Exists(@fileLocation))
            {
                using (StreamReader file = File.OpenText(fileLocation))
                {
                    JsonSerializer serializer = new JsonSerializer();
                    _config      = (ColorConfig)serializer.Deserialize(file, typeof(ColorConfig));
                    _config.Name = "New";
                    form._config = _config;
                }
            }
            else
            {
                colorSchema.Name = "New";
                colorSchema.DefaultBlinkThreshold = 0;

                List <ColorConfigItems> types = new List <ColorConfigItems>();
                types.Add(new ColorConfigItems {
                    Name = "AVAILABLE", BlinkDelay = 0, Color = "GREEN"
                });
                types.Add(new ColorConfigItems {
                    Name = "BREAK", BlinkDelay = 0, Color = "RED"
                });
                types.Add(new ColorConfigItems {
                    Name = "FOLLOWUP", BlinkDelay = 0, Color = "YELLOW"
                });
                types.Add(new ColorConfigItems {
                    Name = "TRAINING", BlinkDelay = 0, Color = "BLUE"
                });
                types.Add(new ColorConfigItems {
                    Name = "UNAVAILABLE", BlinkDelay = 0, Color = "RED"
                });


                colorSchema.StatusTypes = types;

                List <ColorConfigMessageItems> messages = new List <ColorConfigMessageItems>();
                colorSchema.StatusMessages = messages;

                form._config = colorSchema;
            }


            form._create = true;
            form._configurationManager = _configurationManager;

            form.Show();
            RefreshSchemas();
        }
Exemplo n.º 3
0
        private void linkEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (!string.IsNullOrEmpty(cbColorSchema.Text))
            {
                frmManage form = new frmManage();
                form._config = _config;
                form._create = false;
                form._configurationManager = _configurationManager;

                form.Show();
                RefreshSchemas();
            }
        }