/// <summary> /// Constructor /// </summary> public IPLabel() : base() { /*copyIPAndSubnetshortToolStripMenuItem = new ToolStripMenuItem( Program.res.GetString("DIALOG_IP_CopyAll")); copyIPAndSubnetshortToolStripMenuItem.Click += new System.EventHandler(copyIPAndSubnetshortToolStripMenuItem_Click);*/ copyIPToolStripMenuItem = new ToolStripMenuItem( Program.res.GetString("DIALOG_IP_Copy")); copyIPToolStripMenuItem.Click += new System.EventHandler(copyIPToolStripMenuItem_Click); /*copyIPAndSubnetToolStripMenuItem = new ToolStripMenuItem( Program.res.GetString("DIALOG_IP_CopySN")); copyIPAndSubnetToolStripMenuItem.Click += new System.EventHandler(copyIPAndSubnetToolStripMenuItem_Click);*/ contextMenu = new ContextMenuStrip(); contextMenu.Items.AddRange(new ToolStripItem[] { //copyIPAndSubnetshortToolStripMenuItem, copyIPToolStripMenuItem, //copyIPAndSubnetToolStripMenuItem }); ContextMenuStrip = contextMenu; VisitedLinkColor = System.Drawing.Color.Blue; ActiveLinkColor = System.Drawing.Color.Blue; Text = ""; Visible = false; LinkClicked += new LinkLabelLinkClickedEventHandler(IPLabel_LinkClicked); }
/// <summary> /// Constructor /// </summary> public IPLabel() : base() { /*copyIPAndSubnetshortToolStripMenuItem = new ToolStripMenuItem( * Program.res.GetString("DIALOG_IP_CopyAll")); * copyIPAndSubnetshortToolStripMenuItem.Click += * new System.EventHandler(copyIPAndSubnetshortToolStripMenuItem_Click);*/ copyIPToolStripMenuItem = new ToolStripMenuItem( Program.res.GetString("DIALOG_IP_Copy")); copyIPToolStripMenuItem.Click += new System.EventHandler(copyIPToolStripMenuItem_Click); /*copyIPAndSubnetToolStripMenuItem = new ToolStripMenuItem( * Program.res.GetString("DIALOG_IP_CopySN")); * copyIPAndSubnetToolStripMenuItem.Click += * new System.EventHandler(copyIPAndSubnetToolStripMenuItem_Click);*/ contextMenu = new ContextMenuStrip(); contextMenu.Items.AddRange(new ToolStripItem[] { //copyIPAndSubnetshortToolStripMenuItem, copyIPToolStripMenuItem, //copyIPAndSubnetToolStripMenuItem }); ContextMenuStrip = contextMenu; VisitedLinkColor = System.Drawing.Color.Blue; ActiveLinkColor = System.Drawing.Color.Blue; Text = ""; Visible = false; LinkClicked += new LinkLabelLinkClickedEventHandler(IPLabel_LinkClicked); }
public ClickableCustomMessageBox(string title, string message, string firstLinkText, LinkLabelLinkClickedEventHandler LinkHandler, CustomMessageBoxStyle style) : base(title, message, style, false) { this._firstLinkText = firstLinkText; if (string.IsNullOrEmpty(this._firstLinkText)) this._firstLinkText = string.Empty; this._linkHandler = LinkHandler; }
public ClickableCustomMessageBox(string message, string firstLinkText, LinkLabelLinkClickedEventHandler LinkHandler, CustomMessageBoxStyle style, DontShowThisMessageAgainOptions dontShowThisMessageAgainOption) : base(message, style, dontShowThisMessageAgainOption, false) { this._firstLinkText = firstLinkText; if (string.IsNullOrEmpty(this._firstLinkText)) this._firstLinkText = string.Empty; this._linkHandler = LinkHandler; }
/// <summary> /// <inheritdoc cref="MessageWidget()"/> /// </summary> /// <param name="exception">要显示的异常。</param> /// <param name="onLinkClicked">单击“More”时引发 <see cref="LinkLabel.LinkClicked"/> 事件的事件处理程序。</param> public MessageWidget(Exception exception, LinkLabelLinkClickedEventHandler onLinkClicked) : this(exception) { if (onLinkClicked != null) { linkMore.LinkClicked += onLinkClicked; linkMore.LinkClicked -= LinkMore_LinkClicked; } }
protected virtual void OnLinkClicked(LinkLabelLinkClickedEventArgs e) { LinkLabelLinkClickedEventHandler eh = (LinkLabelLinkClickedEventHandler)(Events [LinkClickedEvent]); if (eh != null) { eh(this, e); } }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// linklabellinkclickedeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this LinkLabelLinkClickedEventHandler linklabellinkclickedeventhandler, Object sender, LinkLabelLinkClickedEventArgs e, AsyncCallback callback) { if (linklabellinkclickedeventhandler == null) { throw new ArgumentNullException("linklabellinkclickedeventhandler"); } return(linklabellinkclickedeventhandler.BeginInvoke(sender, e, callback, null)); }
public ClickableCustomMessageBox(string message, string firstLinkText, string secondLinkText, LinkLabelLinkClickedEventHandler LinkHandler, CustomMessageBoxStyle style, int toAvoidMethodSignatureClash) : base(message, style, false) { this._firstLinkText = firstLinkText; if (string.IsNullOrEmpty(this._firstLinkText)) this._firstLinkText = string.Empty; this._secondLinkText = secondLinkText; if (string.IsNullOrEmpty(this._secondLinkText)) this._secondLinkText = string.Empty; this._linkHandler = LinkHandler; }
public ClickableCustomMessageBox(string message, string firstLinkText, string secondLinkText, LinkLabelLinkClickedEventHandler LinkHandler) : base(message, false) { this._firstLinkText = firstLinkText; if (string.IsNullOrEmpty(this._firstLinkText)) this._firstLinkText = string.Empty; this._secondLinkText = secondLinkText; if (string.IsNullOrEmpty(this._secondLinkText)) this._secondLinkText = string.Empty; this._linkHandler = LinkHandler; }
public void SetMessageText(string message, string textToMakeClickable, LinkLabelLinkClickedEventHandler handler) { this.TabStop = false; if (this.MessageLinkLbl.Links.Count > 0) this.MessageLinkLbl.Links.Clear(); this.MessageLinkLbl.Text = message; if (string.IsNullOrEmpty(textToMakeClickable)) return; this.MessageLinkLbl.LinkClicked -= handler; this.MessageLinkLbl.LinkClicked += handler; this.MessageLinkLbl.Links.Add(this.MessageLinkLbl.Text.IndexOf(textToMakeClickable), textToMakeClickable.Length); this.TabStop = true; }
/// <summary> /// クリック時にメッセージボックスを表示する /// </summary> /// <param name="linklabel">ボタン</param> static void LinkClickEvent(LinkLabel linklabel) { LinkLabelLinkClickedEventHandler handler = null; handler = delegate { MessageBox.Show(""); linklabel.BeginInvoke((MethodInvoker) delegate { linklabel.LinkClicked -= handler; }); }; linklabel.LinkClicked += handler; }
private LinkLabel TagLabelLink(string name, object tag, LinkLabelLinkClickedEventHandler onClick) { var link = new LinkLabel() { AutoSize = true, LinkColor = SystemColors.GrayText, LinkBehavior = LinkBehavior.HoverUnderline, Margin = new Padding(2), Text = name, Tag = tag, }; link.LinkClicked += onClick; return(link); }
///<summary> /// Создается экземпляр ссылки, заправшивающей спарвку ///</summary> public HelpRequestingLink() { LinkClicked += new LinkLabelLinkClickedEventHandler(HelpRequestingLink_LinkClicked); }
private DialogResult PromptUser(APDOEventHandler.PromptType promptType) { string promptText = string.Empty; string clickableText = string.Empty; LinkLabelLinkClickedEventHandler linkClickedEventHandler = (LinkLabelLinkClickedEventHandler) null; if (promptType == APDOEventHandler.PromptType.PackageDownload) { clickableText = DashboardStringHelper.GetString("CapitalClickHere_Clickable"); promptText = string.Format(DashboardStringHelper.GetString("APDO_PromptUserPackageDownload"), (object) clickableText); linkClickedEventHandler = new LinkLabelLinkClickedEventHandler(this.OnPackageDownloadHelpLinkClicked); } else if (promptType == APDOEventHandler.PromptType.PackageInstall) promptText = DashboardStringHelper.GetString("APDO_PromptUserPackageInstall"); this._callSetPackageUpdateState = true; DialogResult dialogResult = this.ShowPromptDialog(promptText, clickableText, linkClickedEventHandler, CustomMessageBoxStyle.YesRemindMeLater); int num; switch (dialogResult) { case DialogResult.Ignore: return dialogResult; case DialogResult.Yes: num = 1; break; default: num = 0; break; } bool userApprovedAction = num != 0; if (this._callSetPackageUpdateState && (promptType == APDOEventHandler.PromptType.PackageDownload || promptType == APDOEventHandler.PromptType.PackageInstall)) { int errorCode = APDOHandler.Singleton.SetPackageUpdateState(userApprovedAction); if (errorCode != 0) { ErrorHelper.ShowErrorDialog((Control) AppFramework.Dashboard, ErrorStringsHelper.GetString("General_SetPackageUpdateStateFailed"), ErrorHelper.TranslateErrorCodeToMessage(errorCode), (string) null, "SetPackageUpdateStateFailed"); dialogResult = DialogResult.Abort; } else if (userApprovedAction && promptType == APDOEventHandler.PromptType.PackageDownload) Eventing.GenerateUIEvent("WiMAXSP.OnAPDO", (object) this, new object[1] { (object) APDOEventType.PackageDownloadStarted }); } return dialogResult; }
internal LinkData(int linkStart, int linkLength, LinkLabelLinkClickedEventHandler handler) { LinkStart = linkStart; LinkLength = linkLength; LinkClickedHandler = handler; }
private static bool IsOkToTurnWiMAXRadioOnCoExCheck() { if (DashboardAndTaskTray._turningWiMAXOnWillBreakYourWiFiConnectionCMB.Visible) return false; if (CurrentUserSettings.GetShowCoExPopups() && WiFiHandler.Singleton.IsWiFiAvailable() && WiFiHandler.Singleton.IsWiFiReady()) { WiFiCoEx_ConnectionState eConnectionState = WiFiCoEx_ConnectionState.WIFI_NOT_CONNECTED; if (WiFiHandler.Singleton.GetConnectionState(ref eConnectionState) == 0 && eConnectionState != WiFiCoEx_ConnectionState.WIFI_NOT_CONNECTED) { string @string = DashboardStringHelper.GetString("CapitalClickHere_Clickable"); LinkLabelLinkClickedEventHandler clickedEventHandler = new LinkLabelLinkClickedEventHandler(DashboardAndTaskTray.OnWiFiConnectionWillBeBrokenPopupClicked); string message; LinkLabelLinkClickedEventHandler LinkHandler; if (WiFiCoEx_ConnectionState.WIFI_STA_CP_CONNECTED == eConnectionState || WiFiCoEx_ConnectionState.WIFI_STA_HN_CONNECTED == eConnectionState) { message = string.Format(DashboardStringHelper.GetString("Prompt_WiFiAndDeviceConnectionWillBeBroken_Ver2"), (object) @string); LinkHandler = new LinkLabelLinkClickedEventHandler(DashboardAndTaskTray.OnWiFiAndDeviceConnectionWillBeBrokenPopupClicked); } else if (WiFiCoEx_ConnectionState.WIFI_CP_CONNECTED == eConnectionState || WiFiCoEx_ConnectionState.WIFI_HN_CONNECTED == eConnectionState) { message = string.Format(DashboardStringHelper.GetString("Prompt_WiFiDeviceConnectionWillBeBroken_Ver2"), (object) @string); LinkHandler = new LinkLabelLinkClickedEventHandler(DashboardAndTaskTray.OnDeviceConnectionWillBeBrokenPopupClicked); } else { message = string.Format(DashboardStringHelper.GetString("Prompt_WiFiConnectionWillBeBroken_Ver2"), (object) @string); LinkHandler = new LinkLabelLinkClickedEventHandler(DashboardAndTaskTray.OnWiFiConnectionWillBeBrokenPopupClicked); } DashboardAndTaskTray._turningWiMAXOnWillBreakYourWiFiConnectionCMB = new ClickableCustomMessageBox(message, @string, LinkHandler, CustomMessageBoxStyle.YesNo, DontShowThisMessageAgainOptions.TurningRadioOnWillBreakYourConnectionPopup); DashboardAndTaskTray._turningWiMAXOnWillBreakYourWiFiConnectionCMB.AccessibleName = "TurningWiMAXOnWillBreakYourWiFiConnectionMB"; DashboardAndTaskTray._turningWiMAXOnWillBreakYourWiFiConnectionCMB.LocationOfMessageBox = CustomMessageBoxLocation.CenterOfDashboardOrInTaskTrayOnTop; if (DashboardAndTaskTray._turningWiMAXOnWillBreakYourWiFiConnectionCMB.CustomShowDialog((IWin32Window) AppFramework.Dashboard, true) != DialogResult.Yes) return false; } } return true; }
private DialogResult ShowPromptDialog(string promptText, string clickableText, LinkLabelLinkClickedEventHandler linkClickedEventHandler, CustomMessageBoxStyle promptStyle) { if (this._fumoPromptCMB != null && this._fumoPromptCMB.Visible) return DialogResult.Ignore; this._fumoPromptCMB = new ClickableCustomMessageBox(promptText, clickableText, linkClickedEventHandler, promptStyle); this._fumoPromptCMB.AccessibleName = "FUMODownloadMB"; this._fumoPromptCMB.LocationOfMessageBox = CustomMessageBoxLocation.AlwaysInTaskTrayBottom; return this._fumoPromptCMB.CustomShowDialog((IWin32Window) AppFramework.Dashboard, true); }
void AddWarningLink(string formatText, string linkText, LinkLabelLinkClickedEventHandler linkEvent, WarningBoxType type) { LinkLabel label = new LinkLabel(); label.AutoSize = true; label.Text = String.Format(formatText, linkText); label.Links.Clear(); label.Links.Add(formatText.IndexOf("{0}"), linkText.Length); label.LinkBehavior = LinkBehavior.HoverUnderline; label.LinkClicked += linkEvent; AddWarningCore(label, type); }