예제 #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());
        }
예제 #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
 internal void RaisePropertyChanged(DisabledKey item)
 {
     if (null != PropertyChanged)
     {
         PropertyChanged(item, new PropertyChangedEventArgs(""));
     }
 }
예제 #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;
 }
예제 #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;
 }
예제 #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);
        }
예제 #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);
            }
        }
예제 #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
        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);
            }
        }  
예제 #10
0
 internal void RaisePropertyChanged(DisabledKey item)
 {
     if (null != PropertyChanged)
         PropertyChanged(item, new PropertyChangedEventArgs(""));
 }