Ejemplo n.º 1
0
        private void listViewContexts_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            StackHashContextStatus contextStatus = listViewContexts.SelectedItem as StackHashContextStatus;

            if (contextStatus != null)
            {
                _reselectContextId         = contextStatus.ContextId;
                _reselectContextIdIsActive = contextStatus.IsActive;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shows the result of the last synchronization attempt
        /// </summary>
        /// <param name="contextStatus">Current context status</param>
        public SyncReport(StackHashContextStatus contextStatus)
        {
            // Ok for contextStatus to be null
            _contextStatus = contextStatus;

            InitializeComponent();

            if (UserSettings.Settings.HaveWindow(WindowKey))
            {
                UserSettings.Settings.RestoreWindow(WindowKey, this);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Wrapper class for context settings and status
        /// </summary>
        /// <param name="stackHashContextSettings">Context settings</param>
        /// <param name="stackHashContextStatus">Context status (optional)</param>
        public DisplayContext(StackHashContextSettings stackHashContextSettings, StackHashContextStatus stackHashContextStatus)
        {
            if (stackHashContextSettings == null)
            {
                throw new ArgumentNullException("stackHashContextSettings");
            }
            if (stackHashContextSettings.WinQualSettings == null)
            {
                throw new ArgumentNullException("stackHashContextSettings", "stackHashContextSettings.WinQualSettings is null");
            }

            // ok for stackHashContextStatus to be null
            _stackHashContextSettings = stackHashContextSettings;
            _stackHashContextStatus   = stackHashContextStatus;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Updates the status portion of the display context
        /// </summary>
        /// <param name="stackHashContextStatus">Context status</param>
        public void UpdateStatus(StackHashContextStatus stackHashContextStatus)
        {
            if (stackHashContextStatus == null)
            {
                throw new ArgumentNullException("stackHashContextStatus");
            }
            if (_stackHashContextSettings.Id != stackHashContextStatus.ContextId)
            {
                throw new InvalidOperationException("Cannot update from a context with a different ID");
            }

            if (_stackHashContextStatus == null)
            {
                // first update (the status isn't necessarily provided in the constructor)
                _stackHashContextStatus = stackHashContextStatus;
                RaisePropertyChanged("CurrentError");
                RaisePropertyChanged("CurrentErrorText");
                RaisePropertyChanged("LastContextException");
            }
            else
            {
                // normal update

                // save the new settings
                StackHashContextStatus oldStatus = _stackHashContextStatus;
                _stackHashContextStatus = stackHashContextStatus;

                if (oldStatus.CurrentError != _stackHashContextStatus.CurrentError)
                {
                    RaisePropertyChanged("CurrentError"); RaisePropertyChanged("CurrentErrorText");
                }
                if (oldStatus.LastContextException != _stackHashContextStatus.LastContextException)
                {
                    RaisePropertyChanged("LastContextException");
                }
            }
        }