当前位置: 首页>>代码示例>>C#>>正文


C# ContextMenuStrip.Invoke方法代码示例

本文整理汇总了C#中System.Windows.Forms.ContextMenuStrip.Invoke方法的典型用法代码示例。如果您正苦于以下问题:C# ContextMenuStrip.Invoke方法的具体用法?C# ContextMenuStrip.Invoke怎么用?C# ContextMenuStrip.Invoke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ContextMenuStrip的用法示例。


在下文中一共展示了ContextMenuStrip.Invoke方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ServerNotifyIcon


//.........这里部分代码省略.........
            
            // 
            // notifyIcon1
            // 
            notifyIcon1.ContextMenuStrip = contextMenuStrip1;
            notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            notifyIcon1.Text = "Emby";
            notifyIcon1.Visible = true;
            // 
            // contextMenuStrip1
            // 
            contextMenuStrip1.Items.AddRange(new ToolStripItem[] {
            cmdBrowse,
            cmdConfigure,
            toolStripSeparator2,
            cmdRestart,
            toolStripSeparator1,
            cmdApiDocs,
            cmdCommunity,
            cmdExit});
            contextMenuStrip1.Name = "contextMenuStrip1";
            contextMenuStrip1.ShowCheckMargin = true;
            contextMenuStrip1.ShowImageMargin = false;
            contextMenuStrip1.Size = new System.Drawing.Size(209, 214);
            // 
            // cmdExit
            // 
            cmdExit.Name = "cmdExit";
            cmdExit.Size = new System.Drawing.Size(208, 22);
            // 
            // cmdCommunity
            // 
            cmdCommunity.Name = "cmdCommunity";
            cmdCommunity.Size = new System.Drawing.Size(208, 22);
            // 
            // toolStripSeparator1
            // 
            toolStripSeparator1.Name = "toolStripSeparator1";
            toolStripSeparator1.Size = new System.Drawing.Size(205, 6);
            // 
            // cmdRestart
            // 
            cmdRestart.Name = "cmdRestart";
            cmdRestart.Size = new System.Drawing.Size(208, 22);
            // 
            // toolStripSeparator2
            // 
            toolStripSeparator2.Name = "toolStripSeparator2";
            toolStripSeparator2.Size = new System.Drawing.Size(205, 6);
            // 
            // cmdConfigure
            // 
            cmdConfigure.Name = "cmdConfigure";
            cmdConfigure.Size = new System.Drawing.Size(208, 22);
            // 
            // cmdBrowse
            // 
            cmdBrowse.Name = "cmdBrowse";
            cmdBrowse.Size = new System.Drawing.Size(208, 22);
            // 
            // cmdApiDocs
            // 
            cmdApiDocs.DropDownItems.AddRange(new ToolStripItem[] {
            cmdSwagger,
            cmdGtihub});
            cmdApiDocs.Name = "cmdApiDocs";
            cmdApiDocs.Size = new System.Drawing.Size(208, 22);
            // 
            // cmdSwagger
            // 
            cmdSwagger.Name = "cmdSwagger";
            cmdSwagger.Size = new System.Drawing.Size(136, 22);
            // 
            // cmdGtihub
            // 
            cmdGtihub.Name = "cmdGtihub";
            cmdGtihub.Size = new System.Drawing.Size(136, 22);

            cmdExit.Click += cmdExit_Click;
            cmdRestart.Click += cmdRestart_Click;
            cmdConfigure.Click += cmdConfigure_Click;
            cmdCommunity.Click += cmdCommunity_Click;
            cmdBrowse.Click += cmdBrowse_Click;

            cmdSwagger.Click += cmdSwagger_Click;
            cmdGtihub.Click += cmdGtihub_Click;

            _configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;

            LocalizeText();

            if (_appHost.IsFirstRun)
            {
                Action action = () => notifyIcon1.ShowBalloonTip(5000, "Emby", "Welcome to Emby Server!", ToolTipIcon.Info);

                contextMenuStrip1.Invoke(action);
            }

            notifyIcon1.DoubleClick += notifyIcon1_DoubleClick;
        }
开发者ID:jrags56,项目名称:MediaBrowser,代码行数:101,代码来源:ServerNotifyIcon.cs

示例2: ServerNotifyIcon


//.........这里部分代码省略.........
            //
            // contextMenuStrip1
            //
            contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            cmdBrowse,
            cmdConfigure,
            toolStripSeparator2,
            cmdRestart,
            toolStripSeparator1,
            cmdApiDocs,
            cmdLogWindow,
            cmdCommunity,
            cmdExit});
            contextMenuStrip1.Name = "contextMenuStrip1";
            contextMenuStrip1.ShowCheckMargin = true;
            contextMenuStrip1.ShowImageMargin = false;
            contextMenuStrip1.Size = new System.Drawing.Size(209, 214);
            //
            // cmdExit
            //
            cmdExit.Name = "cmdExit";
            cmdExit.Size = new System.Drawing.Size(208, 22);
            //
            // cmdCommunity
            //
            cmdCommunity.Name = "cmdCommunity";
            cmdCommunity.Size = new System.Drawing.Size(208, 22);
            //
            // cmdLogWindow
            //
            cmdLogWindow.CheckOnClick = true;
            cmdLogWindow.Name = "cmdLogWindow";
            cmdLogWindow.Size = new System.Drawing.Size(208, 22);
            //
            // toolStripSeparator1
            //
            toolStripSeparator1.Name = "toolStripSeparator1";
            toolStripSeparator1.Size = new System.Drawing.Size(205, 6);
            //
            // cmdRestart
            //
            cmdRestart.Name = "cmdRestart";
            cmdRestart.Size = new System.Drawing.Size(208, 22);
            //
            // toolStripSeparator2
            //
            toolStripSeparator2.Name = "toolStripSeparator2";
            toolStripSeparator2.Size = new System.Drawing.Size(205, 6);
            //
            // cmdConfigure
            //
            cmdConfigure.Name = "cmdConfigure";
            cmdConfigure.Size = new System.Drawing.Size(208, 22);
            //
            // cmdBrowse
            //
            cmdBrowse.Name = "cmdBrowse";
            cmdBrowse.Size = new System.Drawing.Size(208, 22);
            //
            // cmdApiDocs
            //
            cmdApiDocs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            cmdSwagger,
            cmdGtihub});
            cmdApiDocs.Name = "cmdApiDocs";
            cmdApiDocs.Size = new System.Drawing.Size(208, 22);
            //
            // cmdSwagger
            //
            cmdSwagger.Name = "cmdSwagger";
            cmdSwagger.Size = new System.Drawing.Size(136, 22);
            //
            // cmdGtihub
            //
            cmdGtihub.Name = "cmdGtihub";
            cmdGtihub.Size = new System.Drawing.Size(136, 22);

            cmdExit.Click += cmdExit_Click;
            cmdRestart.Click += cmdRestart_Click;
            cmdLogWindow.Click += cmdLogWindow_Click;
            cmdConfigure.Click += cmdConfigure_Click;
            cmdCommunity.Click += cmdCommunity_Click;
            cmdBrowse.Click += cmdBrowse_Click;

            cmdSwagger.Click += cmdSwagger_Click;
            cmdGtihub.Click += cmdGtihub_Click;

            LoadLogWindow(null, EventArgs.Empty);
            _logManager.LoggerLoaded += LoadLogWindow;
            _configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;

            LocalizeText();

            if (_appHost.IsFirstRun)
            {
                Action action = () => notifyIcon1.ShowBalloonTip(5000, "Media Browser", "Welcome to Media Browser Server!", ToolTipIcon.Info);

                contextMenuStrip1.Invoke(action);
            }
        }
开发者ID:bigjohn322,项目名称:MediaBrowser,代码行数:101,代码来源:ServerNotifyIcon.cs


注:本文中的System.Windows.Forms.ContextMenuStrip.Invoke方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。