Beispiel #1
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());
        }
 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;
 }
Beispiel #3
0
 internal void RaisePropertyChanged(DisabledKey item)
 {
     if (null != PropertyChanged)
     {
         PropertyChanged(item, new PropertyChangedEventArgs(""));
     }
 }
Beispiel #4
0
 internal DisabledValue(WatchController root, DisabledKey item, string valueName, object value)
 {
     _root             = root;
     _parent           = item;
     _valueName        = valueName;
     _disabledItemName = GetDisabledItemName(value as string);
     _value            = value;
 }
Beispiel #5
0
 internal DisabledValue(WatchController root, DisabledKey item, string valueName, object value)
 {
     _root = root;
     _parent = item;
     _valueName = valueName;
     _disabledItemName = GetDisabledItemName(value as string);
     _value = value;
 }
Beispiel #6
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);
        }
Beispiel #7
0
        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));
                }

                /*
                 *              if (null != _addinsItemToDisplay)
                 *              {
                 *              if (_addinsItemToDisplay.Name == "Outlook")
                 *              {
                 *                  stopFlag = true;
                 *                  _controller.Enabled = false;
                 *              }
                 *              }
                 * */
            }
            catch (Exception exception)
            {
                ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.NonCritical, _currentLanguageID);
                errorForm.ShowDialog(this);
            }
        }
Beispiel #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());
            }
        }
Beispiel #9
0
        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));
                /*
                                if (null != _addinsItemToDisplay)
                                { 
                                if (_addinsItemToDisplay.Name == "Outlook")
                                {
                                    stopFlag = true;
                                    _controller.Enabled = false;
                                }
                                }
                 * */
            }
            catch (Exception exception)
            {
                ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.NonCritical, _currentLanguageID);
                errorForm.ShowDialog(this);
            }
        }  
Beispiel #10
0
 internal void RaisePropertyChanged(DisabledKey item)
 {
     if (null != PropertyChanged)
         PropertyChanged(item, new PropertyChangedEventArgs(""));
 }