Exemplo n.º 1
0
        static public IReflectInsight Add(RIInstance instance)
        {
            lock (FInstances)
            {
                // this method checks to see if the RI already exists
                // and only updates the category, bkColor and destination binding values.
                // if it doesn't exist then it creates a new RI and adds it to the list
                RILogManagerNode node = GetNode(instance.Name);
                if (node != null)
                {
                    // if the RI already exists, only change the category, color and destination binding groups
                    lock (node.Instance)
                    {
                        node.Instance.ClearDestinationBindingGroup();
                        node.Instance.Category  = instance.Category;
                        node.Instance.BackColor = RIPastelBackColor.GetColorByName(instance.BkColor);
                        node.Instance.SetDestinationBindingGroup(instance.DestinationBindingGroup);
                    }

                    return(node.Instance);
                }

                // create a new instance and add it
                return(Add(instance.Name, CreateInstance(instance)));
            }
        }
Exemplo n.º 2
0
        static private IReflectInsight CreateInstance(RIInstance instance)
        {
            IReflectInsight ri = new ReflectInsight(instance.Category);

            ri.BackColor = RIPastelBackColor.GetColorByName(instance.BkColor);
            ri.SetDestinationBindingGroup(instance.DestinationBindingGroup);

            return(ri);
        }
Exemplo n.º 3
0
        static private void LoadConfigColors()
        {
            lock (MessageColors)
            {
                MessageColors.Clear();
                Type msgType = typeof(MessageType);

                Hashtable configMessageColors = ReflectInsightConfig.Settings.LoadMessageColors();
                foreach (String mType in configMessageColors.Keys)
                {
                    if (!Enum.IsDefined(msgType, mType))
                    {
                        continue;
                    }

                    MessageColors[Enum.Parse(msgType, mType)] = RIPastelBackColor.GetColorByName((String)configMessageColors[mType]);
                }
            }
        }