Example #1
0
        public Systray()
        {
            InitializeComponent();
            xgs = Program.GetXGS();
            alertList = Program.GetAlertList();
            initRunOnStartup();

            //Event handlers
            this.notifyIcon1.BalloonTipClicked += new EventHandler(notifyIcon1_BalloonTipClicked);
        }
Example #2
0
        public Systray()
        {
            InitializeComponent();
            xgs       = Program.GetXGS();
            alertList = Program.GetAlertList();
            initRunOnStartup();

            //Event handlers
            this.notifyIcon1.BalloonTipClicked += new EventHandler(notifyIcon1_BalloonTipClicked);
        }
Example #3
0
        public static void Initialize()
        {
            Program.AssertOffEventThread();
            Thread thread;
            string evname;
            EventWaitHandleSecurity evsec;
            EventWaitHandleAccessRule evrule;
            string user;

            xgs = Program.GetXGS();
            systray = Program.GetSystray();
            alertList = Program.GetAlertList();

            evname = xgs.GetAlertsEventName();
            user = Environment.UserDomainName + "\\" + Environment.UserName;
            evalerts = EventWaitHandle.OpenExisting(evname,
                EventWaitHandleRights.ReadPermissions | EventWaitHandleRights.ChangePermissions);
            evsec = evalerts.GetAccessControl();
            evrule = new EventWaitHandleAccessRule(user,
                EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                AccessControlType.Deny);
            evsec.RemoveAccessRule(evrule);

            evrule = new EventWaitHandleAccessRule(user,
                EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                AccessControlType.Allow);
            evsec.AddAccessRule(evrule);
            evalerts.SetAccessControl(evsec);

            evalerts = EventWaitHandle.OpenExisting(evname);

            thread = new Thread(alertUpdater);
            thread.Name = "XenClient Alert Thread";
            thread.IsBackground = true;

            thread.Start();
        }
Example #4
0
        public static void Initialize()
        {
            Program.AssertOffEventThread();
            Thread thread;
            string evname;
            EventWaitHandleSecurity   evsec;
            EventWaitHandleAccessRule evrule;
            string user;

            xgs       = Program.GetXGS();
            systray   = Program.GetSystray();
            alertList = Program.GetAlertList();

            evname   = xgs.GetAlertsEventName();
            user     = Environment.UserDomainName + "\\" + Environment.UserName;
            evalerts = EventWaitHandle.OpenExisting(evname,
                                                    EventWaitHandleRights.ReadPermissions | EventWaitHandleRights.ChangePermissions);
            evsec  = evalerts.GetAccessControl();
            evrule = new EventWaitHandleAccessRule(user,
                                                   EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                                                   AccessControlType.Deny);
            evsec.RemoveAccessRule(evrule);

            evrule = new EventWaitHandleAccessRule(user,
                                                   EventWaitHandleRights.Synchronize | EventWaitHandleRights.Modify,
                                                   AccessControlType.Allow);
            evsec.AddAccessRule(evrule);
            evalerts.SetAccessControl(evsec);

            evalerts = EventWaitHandle.OpenExisting(evname);

            thread              = new Thread(alertUpdater);
            thread.Name         = "XenClient Alert Thread";
            thread.IsBackground = true;

            thread.Start();
        }