コード例 #1
0
        public void Initialize()
        {
            try
            {
                prepareCollections();
                trayDelegate     = SysTrayCallback;
                iconDataDelegate = IconDataCallback;

                _explorerTrayService.SetSystrayCallback(trayDelegate);
                _explorerTrayService.Run();

                _trayService.SetSystrayCallback(trayDelegate);
                _trayService.SetIconDataCallback(iconDataDelegate);
                Handle = _trayService.Initialize();
                _trayService.Run();

                // load the shell system tray objects (network, power, etc)
                shellServiceObject = new ShellServiceObject();
                shellServiceObject.Start();
            }
            catch
            {
                IsFailed = true;
            }
        }
コード例 #2
0
        public NotifyIconManager(Func <NOTIFYITEMICON, GUIItem> addNewNotification)
        {
            this.addNewNotification = addNewNotification;

            // from https://github.com/cairoshell/cairoshell/blob/36de406a00e9b6a8907ba088033f309c81ba096b/code/Cairo%20Desktop/Cairo%20Desktop/SystemTray.xaml.cs



            trayDelegate = new SystrayDelegate(SysTrayCallback);
            hooksWrapper.SetSystrayCallback(trayDelegate);
            hooksWrapper.InitializeSystray();
            hooksWrapper.Run();
        }
コード例 #3
0
ファイル: SystemTray.xaml.cs プロジェクト: dremin/cairoshell
 public void InitializeSystemTray()
 {
     try
     {
         trayDelegate = new SystrayDelegate(SysTrayCallback);
         hooksWrapper.SetSystrayCallback(trayDelegate);
         hooksWrapper.InitializeSystray();
         hooksWrapper.Run();
     }
     catch (Exception ex)
     {
         CairoMessage.Show("Error initializing the system tray component.\n\n" + ex.ToString() + "\n\nIf this error continues please report it (including a screen shot of this message) to the Cairo Development Team. \nThank you.", "Error", MessageBoxButton.OK, MessageBoxImage.Asterisk);
     }
 }
コード例 #4
0
 public void Initialize()
 {
     try
     {
         trayDelegate = new SystrayDelegate(SysTrayCallback);
         hooksWrapper.SetSystrayCallback(trayDelegate);
         Handle = hooksWrapper.InitializeSystray();
         hooksWrapper.Run();
     }
     catch
     {
         IsFailed = true;
     }
 }
コード例 #5
0
 public void InitializeSystemTray()
 {
     try
     {
         trayDelegate = new SystrayDelegate(SysTrayCallback);
         hooksWrapper.SetSystrayCallback(trayDelegate);
         hooksWrapper.InitializeSystray();
         hooksWrapper.Run();
     }
     catch (Exception ex)
     {
         CairoMessage.Show("Error initializing the system tray component.\n\n" + ex.ToString() + "\n\nIf this error continues please report it (including a screen shot of this message) to the Cairo Development Team. \nThank you.", "Error", MessageBoxButton.OK, MessageBoxImage.Asterisk);
     }
 }
コード例 #6
0
 public void Initialize()
 {
     try
     {
         setWindowsTaskbarBottommost();
         trayDelegate     = new SystrayDelegate(SysTrayCallback);
         iconDataDelegate = new IconDataDelegate(IconDataCallback);
         hooksWrapper.SetSystrayCallback(trayDelegate);
         hooksWrapper.SetIconDataCallback(iconDataDelegate);
         Handle = hooksWrapper.InitializeSystray();
         hooksWrapper.Run();
     }
     catch
     {
         IsFailed = true;
     }
 }
コード例 #7
0
        public void Initialize()
        {
            try
            {
                setWindowsTaskbarBottommost();
                prepareCollections();
                trayDelegate     = new SystrayDelegate(SysTrayCallback);
                iconDataDelegate = new IconDataDelegate(IconDataCallback);
                hooksWrapper.SetSystrayCallback(trayDelegate);
                hooksWrapper.SetIconDataCallback(iconDataDelegate);
                Handle = hooksWrapper.InitializeSystray();
                hooksWrapper.Run();

                // load the shell system tray objects (network, power, etc)
                startShellServiceObject();
            }
            catch
            {
                IsFailed = true;
            }
        }
コード例 #8
0
        public void Initialize()
        {
            try
            {
                setWindowsTaskbarBottommost();
                prepareCollections();
                trayDelegate        = SysTrayCallback;
                iconDataDelegate    = IconDataCallback;
                menuBarSizeDelegate = MenuBarSizeCallback;
                trayService.SetSystrayCallback(trayDelegate);
                trayService.SetIconDataCallback(iconDataDelegate);
                trayService.SetMenuBarSizeCallback(menuBarSizeDelegate);
                Handle = trayService.Initialize();
                trayService.Run();

                // load the shell system tray objects (network, power, etc)
                startShellServiceObject();
            }
            catch
            {
                IsFailed = true;
            }
        }
コード例 #9
0
ファイル: SystemTray.xaml.cs プロジェクト: moser96/cairoshell
        public void InitializeSystemTray()
        {
            try
            {
                trayDelegate = new SystrayDelegate(SysTrayCallback);
                hooksWrapper.SetSystrayCallback(trayDelegate);
                hooksWrapper.InitializeSystray();
                hooksWrapper.Run();

                if (Configuration.Settings.EnableSysTrayRehook)
                {
                    DispatcherTimer trayRehook = new DispatcherTimer(DispatcherPriority.Background, this.Dispatcher);
                    trayRehook.Interval = new TimeSpan(0, 0, 10);
                    trayRehook.Tick    += trayRehook_Tick;
                    trayRehook.Start();
                }
            }
            catch /*(Exception ex)*/
            {
                Startup.MenuBarWindow.SystemTrayFailure = true;
                //CairoMessage.ShowAlert("Error initializing the system tray component.\n\n" + ex.ToString() + "\n\nIf this error continues please report it (including a screen shot of this message) to the Cairo Development Team. \nThank you.", "Error", MessageBoxImage.Asterisk);
            }
        }
コード例 #10
0
        //private SystrayDelegate trayDelegate;
        //private WndProcDelegate wndProcDelegate;

        /// <summary>
        /// Sets the delegate for the system tray callback.
        /// </summary>
        /// <param name="theDelegate">The system tray callback delegate.</param>
        public void SetSystrayCallback(SystrayDelegate theDelegate)
        {
            InteropCalls.SetSystrayCallback(theDelegate);

            //trayDelegate = theDelegate;
        }
コード例 #11
0
 public void SetSystrayCallback(SystrayDelegate theDelegate)
 {
     trayDelegate = theDelegate;
 }
コード例 #12
0
 internal void SetSystrayCallback(SystrayDelegate theDelegate)
 {
     trayDelegate = theDelegate;
 }