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

              this.theme = theme;
        }
        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);
            }
        }
Example #3
0
        public ColorThemeEventArgs(ColorTheme theme)
        {
            if (theme == null)
            {
                throw new ArgumentNullException("theme");
            }

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

            var handler = this.ThemeRemoved;

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

              var handler = this.ThemeRemoved;

              if (handler != null)
            handler(this, new ColorThemeEventArgs(theme));
        }
        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);
        }