Esempio n. 1
0
        /// <summary>
        ///     Called when [startup profile changed].
        /// </summary>
        /// <param name="profile">The profile.</param>
        /// <param name="startupProjects">The startup projects.</param>
        public void OnStartupProfileChanged(Profile profile, string[] startupProjects)
        {
            // Skip update if explicitly requested (e.g.: startup projects being set through our combo box)
            if (_startupProjectChangeNotificationsSuspended)
            {
                return;
            }

            if (IsOpening)
            {
                return;
            }

            if (startupProjects == null)
            {
                return;
            }

            if (ProfileEqualityComparer.Instance.Equals(_currentProfile, profile))
            {
                return;
            }

            SuspendStartupProjectChangeNotifications();
            _currentProfile = profile;
            CurrentProfileChanged?.Invoke(this, new ProfileEventArgs(profile, startupProjects));
            ResumeStartupProjectChangeNotifications();
        }
 protected virtual void OnCurrentProfileChanged(object sender, PropertyChangedEventArgs propertyChangedEventArgs)
 {
     _dispatcher?.BeginInvoke(() =>
     {
         CurrentProfileChanged?.Invoke(this, EventArgs.Empty);
         RaisePropertyChanged(nameof(CurrentProfile));
     });
 }