Inheritance: ObservableObject
コード例 #1
0
        public ColorThemeEventArgs(ColorTheme theme)
        {
            if (theme == null)
            throw new ArgumentNullException("theme");

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

            this.theme = theme;
        }
コード例 #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));
            }
        }
コード例 #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));
        }
コード例 #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);
        }