Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It really does seem like this is a tough cookie to crack. Thanks to @keyboardP for his suggestion as it is a viable alternative, but I ended up creating a special method and enum (as SO didn't email me when I got answers or comments ... I need to check my prefs ...):</p> <pre><code>internal static void ShowTip(Int32 timeout, String tipTitle, String tipText, ToolTipIcon tipIcon = ToolTipIcon.None, ShowTipAction tipAction = ShowTipAction.STA_Shown_WriteReg, String linkToOpen = "") { if ((tipAction &amp; ShowTipAction.STA_Nothing) == 0) // if STA_Nothing has not been passed { if ((tipAction &amp; ShowTipAction.STA_Clicked_Nothing) == 0 &amp;&amp; ((tipAction &amp; ShowTipAction.STA_Clicked_OpenLink) &gt; 0 || (tipAction &amp; ShowTipAction.STA_Clicked_WriteReg) &gt; 0)) trayIcon.BalloonTipClicked += (s, e) =&gt; // if STA_Clicked_Nothing has not been passed and either STA_Clicked_OpenLink or STA_Clicked_WriteReg has been passed { // when this balloon tip is clicked if ((tipAction &amp; ShowTipAction.STA_Clicked_OpenLink) &gt; 0) // open passed link MethodorProcessToLaunchSite(linktoOpen); if ((tipAction &amp; ShowTipAction.STA_Clicked_WriteReg) &gt; 0) // write notification indicator to registry RegWriteMethod; }; if ((tipAction &amp; ShowTipAction.STA_Closed_Nothing) == 0 &amp;&amp; (tipAction &amp; ShowTipAction.STA_Closed_WriteReg) &gt; 0) // if STA_Closed_Nothing has not been passed and STA_Closed_WriteReg has been passed trayIcon.BalloonTipClosed += (s, e) =&gt; { RegWriteMethod; }; // when this balloon tip is closed, write notification indicator to registry if ((tipAction &amp; ShowTipAction.STA_Shown_Nothing) == 0 &amp;&amp; (tipAction &amp; ShowTipAction.STA_Shown_WriteReg) &gt; 0) // if STA_Shown_Nothing has not been passed and STA_Shown_WriteReg has been passed trayIcon.BalloonTipShown += (s, e) =&gt; { RegWriteMethod; }; // when this balloon tip is shown, write notification indicator to registry } // Show the balloon tip trayIcon.ShowBalloonTip(timeout, tipTitle, tipText, tipIcon); } </code></pre> <p>... and the enum:</p> <pre><code>[Flags] internal enum ShowTipAction { STA_Nothing = 1, STA_Clicked_Nothing = 2, STA_Clicked_OpenLink = 4, STA_Clicked_WriteReg = 8, STA_Closed_Nothing = 16, STA_Closed_WriteReg = 32, STA_Shown_Nothing = 64, STA_Shown_WriteReg = 128 } </code></pre> <p>Between the lambdas and the enum, I can make this as extensible as I like. I know it's not really the prettiest solution, but it works; surprisingly well!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload