示例#1
0
        private void Controller_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            try
            {
                _addinsItemToDisplay   = sender as AddinsKey;
                _disabledItemToDisplay = sender as DisabledKey;
                _displayedException    = sender as Exception;

                if (null != _addinsItemToDisplay)
                {
                    this.Invoke(new MethodInvoker(Controller_AddinsKeyChangedInvoke));
                }
                else if (null != _disabledItemToDisplay)
                {
                    this.Invoke(new MethodInvoker(Controller_DisabledKeyChangedInvoke));
                }
                else if (sender is WatchController)
                {
                    this.Invoke(new MethodInvoker(Controller_PropertyChangedInvoke));
                }
                else if (sender is Exception)
                {
                    this.Invoke(new MethodInvoker(WatchNotify_ExceptionThrownInvoke));
                }
            }
            catch (Exception exception)
            {
                Forms.ErrorForm.ShowError(exception, ErrorCategory.NonCritical, Host.CurrentLanguageID);
            }
        }
示例#2
0
 public DisabledKey Add(string name, RegistryKey rootPath, string registryPath)
 {
     DisabledKey newItem = new DisabledKey(_parent, name, rootPath, registryPath);
     _items.Add(newItem);
     _parent.StopFlag = false;
     return newItem;
 }
示例#3
0
        public void ShowNotification(DisabledKey item, NotifyKind notfiyKind, RegistryChangeInfo changeInfo)
        {
            if (_parent.FirstRun)
                return;
            string message = GetMessage(notfiyKind);
            switch (notfiyKind )
            {
                case NotifyKind.DisabledItemNew:
                    NewDeactivatedElementInfo newInfo = (NewDeactivatedElementInfo)changeInfo;
                    message = string.Format(message, newInfo.OfficeProductVersion, newInfo.Name, Environment.NewLine);
                    break;
                case NotifyKind.DisabledItemDelete:
                    DeleteDeactivatedElementInfo deleteInfo = (DeleteDeactivatedElementInfo)changeInfo;
                    message = string.Format(message, deleteInfo.OfficeProductVersion, deleteInfo.Name, Environment.NewLine);
                    break;
                default:
                    throw new ArgumentOutOfRangeException(notfiyKind.ToString() + " is not valid in this context");
            }

            if (_parent.NotifyType == NotificationType.MessageBox)
                MessageBox.Show(message, "NetOffice.DeveloperToolbox", MessageBoxButtons.OK, MessageBoxIcon.Information);
            else
                _trayIcon.ShowBalloonTip(2000, message, "NetOffice.DeveloperToolbox " + notfiyKind.ToString(), ToolTipIcon.Info);

            if (null != MessageFired)
                MessageFired(message, new EventArgs());
        }
 internal void RaisePropertyChanged(DisabledKey item)
 {
     if (null != PropertyChanged)
     {
         PropertyChanged(item, new PropertyChangedEventArgs(""));
     }
 }
示例#5
0
        public DisabledKey Add(string name, RegistryKey rootPath, string registryPath)
        {
            DisabledKey newItem = new DisabledKey(_parent, name, rootPath, registryPath);

            _items.Add(newItem);
            _parent.StopFlag = false;
            return(newItem);
        }
 internal DisabledValue(WatchController root, DisabledKey item, string valueName, object value)
 {
     _root             = root;
     _parent           = item;
     _valueName        = valueName;
     _disabledItemName = GetDisabledItemName(value as string);
     _value            = value;
 }
示例#7
0
 internal DisabledValue(WatchController root, DisabledKey item, string valueName, object value)
 {
     _root = root;
     _parent = item;
     _valueName = valueName;
     _disabledItemName = GetDisabledItemName(value as string);
     _value = value;
 }
示例#8
0
        public void ShowNotification(DisabledKey item, NotifyKind notfiyKind, RegistryChangeInfo changeInfo)
        {
            if (_parent.FirstRun)
            {
                return;
            }
            string message = GetMessage(notfiyKind);

            switch (notfiyKind)
            {
            case NotifyKind.DisabledItemNew:
                NewDeactivatedElementInfo newInfo = (NewDeactivatedElementInfo)changeInfo;
                message = string.Format(message, newInfo.OfficeProductVersion, newInfo.Name, Environment.NewLine);
                break;

            case NotifyKind.DisabledItemDelete:
                DeleteDeactivatedElementInfo deleteInfo = (DeleteDeactivatedElementInfo)changeInfo;
                message = string.Format(message, deleteInfo.OfficeProductVersion, deleteInfo.Name, Environment.NewLine);
                break;

            default:
                throw new ArgumentOutOfRangeException(notfiyKind.ToString() + " is not valid in this context");
            }

            if (_parent.NotifyType == NotificationType.MessageBox)
            {
                MessageBox.Show(message, "NetOffice.DeveloperToolbox", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                _trayIcon.ShowBalloonTip(2000, message, "NetOffice.DeveloperToolbox " + notfiyKind.ToString(), ToolTipIcon.Info);
            }

            if (null != MessageFired)
            {
                MessageFired(message, new EventArgs());
            }
        }
示例#9
0
 internal void RaisePropertyChanged(DisabledKey item)
 {
     if (null != PropertyChanged)
         PropertyChanged(item, new PropertyChangedEventArgs(""));
 }
示例#10
0
        private void Controller_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            try
            {
                _addinsItemToDisplay = sender as AddinsKey;
                _disabledItemToDisplay = sender as DisabledKey;
                _displayedException = sender as Exception;

                if (null != _addinsItemToDisplay)
                    this.Invoke(new MethodInvoker(Controller_AddinsKeyChangedInvoke));
                else if (null != _disabledItemToDisplay)
                    this.Invoke(new MethodInvoker(Controller_DisabledKeyChangedInvoke));
                else if (sender is WatchController)
                    this.Invoke(new MethodInvoker(Controller_PropertyChangedInvoke));
                else if (sender is Exception)
                    this.Invoke(new MethodInvoker(WatchNotify_ExceptionThrownInvoke));
            }
            catch (Exception exception)
            {
                Forms.ErrorForm.ShowError(exception,ErrorCategory.NonCritical, Host.CurrentLanguageID);
            }
        }