private static ObservableCollection <LeftMenu> CreateData() { return(new ObservableCollection <LeftMenu> { new LeftMenu { IsSelected = true, TopMenuVisibility = Visibility.Hidden, IconKind = PackIconKind.StarFace, Text = "Favorite", Manager = null }, new LeftMenu { IsSelected = false, TopMenuVisibility = Visibility.Visible, IconKind = PackIconKind.AlphaKBox, Text = "Kukulu", Manager = KukuluManager.GetInstance() }, new LeftMenu { IsSelected = false, TopMenuVisibility = Visibility.Visible, IconKind = PackIconKind.AlphaTBox, Text = "Twitch", Manager = TwitchManager.GetInstance() }, new LeftMenu { IsSelected = false, TopMenuVisibility = Visibility.Visible, IconKind = PackIconKind.AlphaFBox, Text = "Fc2", Manager = Fc2Manager.GetInstance() }, new LeftMenu { IsSelected = false, TopMenuVisibility = Visibility.Visible, IconKind = PackIconKind.AlphaCBox, Text = "Cavetube", Manager = CavetubeManager.GetInstance() }, new LeftMenu { IsSelected = false, TopMenuVisibility = Visibility.Hidden, IconKind = PackIconKind.ClipboardOutline, Text = "Log", Manager = LogManager.GetInstance() } }); }
/// <summary> /// NotifyIconWrapper クラス を生成、初期化します。 /// </summary> public NotifyIconWrapper() { // コンポーネントの初期化 this.InitializeComponent(); // コンテキストメニューのイベントを設定 this.toolStripMenuItem_Open.Click += this.toolStripMenuItem_Open_Click; this.toolStripMenuItem_Exit.Click += this.toolStripMenuItem_Exit_Click; SystemEvents.SessionEnding += new SessionEndingEventHandler(SystemEvents_SessionEnding); SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; RefreshBridge.RefreshEvent += RefreshBridge_RefreshEvent; EnableManagers.Add(KukuluManager.GetInstance()); EnableManagers.Add(CavetubeManager.GetInstance()); EnableManagers.Add(Fc2Manager.GetInstance()); EnableManagers.Add(TwitchManager.GetInstance()); BalloonManager = new BalloonManager(myNotifyIcon); ContextMenuManager = new ContextMenuManager(myContextMenuStrip); var t = RefreshNotifyIconAsync(); //警告を消すために変数に代入 }