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