Пример #1
0
        public Settings(Tcp_Client parent, ref ObservableDictionary <string, object> settingsDictionary, NotificationManager notifications)
        {
            InitializeComponent();
            this.parent        = parent;
            this.settings      = settingsDictionary;
            this.notifications = notifications;

            Task.Run(() =>
            {
                ColorSelector.Items.Clear();

                PropertyInfo[] colors = typeof(Color).GetProperties();

                for (int i = 0; i < colors.Length; i++)
                {
                    if (colors[i].PropertyType == typeof(Color))
                    {
                        MethodInfo getMethod = colors[i].GetGetMethod();
                        if ((getMethod != null) && ((getMethod.Attributes & (MethodAttributes.Static | MethodAttributes.Public)) == (MethodAttributes.Static | MethodAttributes.Public)))
                        {
                            object[] index = null;
                            ColorSelector.Items.Add((Color)colors[i].GetValue(null, index));
                        }
                    }
                }
            });
        }
 public NotificationManager(Tcp_Client parent, ref ObservableDictionary <string, object> settingsDictionary)
 {
     this.parent = parent;
 }