Inheritance: ObservableObject
        public ColorThemeEventArgs(ColorTheme theme)
        {
            if (theme == null)
            throw new ArgumentNullException("theme");

              this.theme = theme;
        }
Esempio n. 2
0
        public void AddTheme(ColorTheme theme)
        {
            if (theme == null)
            {
                throw new ArgumentNullException("theme");
            }

            if (string.IsNullOrWhiteSpace(theme.Name))
            {
                throw new ArgumentException("Key cannot be null or whitespace.", "version");
            }

            var alreadyExists = colorThemes.ContainsKey(theme.Name);

            colorThemes[theme.Name] = theme;

            if (alreadyExists)
            {
                OnThemeChanged(theme);
            }
            else
            {
                OnThemeAdded(theme);
            }
        }
Esempio n. 3
0
        public ColorThemeEventArgs(ColorTheme theme)
        {
            if (theme == null)
            {
                throw new ArgumentNullException("theme");
            }

            this.theme = theme;
        }
Esempio n. 4
0
        void OnThemeRemoved(ColorTheme theme)
        {
            if (theme == null)
            {
                throw new ArgumentNullException("theme");
            }

            var handler = this.ThemeRemoved;

            if (handler != null)
            {
                handler(this, new ColorThemeEventArgs(theme));
            }
        }
Esempio n. 5
0
        void OnThemeRemoved(ColorTheme theme)
        {
            if (theme == null)
            throw new ArgumentNullException("theme");

              var handler = this.ThemeRemoved;

              if (handler != null)
            handler(this, new ColorThemeEventArgs(theme));
        }
Esempio n. 6
0
        public void AddTheme(ColorTheme theme)
        {
            if (theme == null)
            throw new ArgumentNullException("theme");

              if (string.IsNullOrWhiteSpace(theme.Name))
            throw new ArgumentException("Key cannot be null or whitespace.", "version");

              var alreadyExists = colorThemes.ContainsKey(theme.Name);
              colorThemes[theme.Name] = theme;

              if (alreadyExists)
            OnThemeChanged(theme);
              else
            OnThemeAdded(theme);
        }