Пример #1
0
        private void VpnNotifyIconContextMenuStrip_Opening(object sender, CancelEventArgs e)
        {
            try
            {
                e.Cancel = false;
                //vpnNotifyIcon.ContextMenuStrip.Items.Clear();
                vpnNotifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator());

                List <ToolStripItem> subitems = new List <ToolStripItem>();
                NetConnUtils.MakeDefaultContextMenu(subitems);
                NetConnUtils.MakeFavoriteContextMenu(subitems);
                NetConnUtils.MakeContextMenuForAllBaseProxyServers(subitems);
                vpnNotifyIcon.ContextMenuStrip.Items.AddRange(subitems.ToArray());
            }
            catch (Exception ex)
            {
                Log.ShowError(ex);
            }
        }