Beispiel #1
0
        /**
         * Currently to start this from the command line you're going to give the directory, executable,
         * and then any command line args necessary. So,
         *
         * GPIIWindows8.exe "C:\Program Files (x86)\GPII\lgs-station" node.exe lgs_driver.js"
         */
        public GPIIApplicationContext(string[] args)
        {
            components = new System.ComponentModel.Container();
            notifyIcon = new NotifyIcon(components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon = new Icon("gpii.ico"),
                Text = "GPII Windows 8",
                Visible = true
            };
            notifyIcon.ContextMenuStrip.Items.Add(ToolStripMenuItemWithHandler("&Exit", exitItem_Click));

            nodeManager = new GPIINodeManager();
            if (args.Length == 3)
            {
                nodeManager.lgsWorkingDirectory = args[0];
                nodeManager.lgsFileName = args[1];
                nodeManager.lgsArguments = args[2];
            }
            nodeManager.startLocalGPII();

            try
            {
                p = new GPIIProximityListener();
                p.applicationContext = this;
                p.InitializeProximityDevice();
            }
            catch (System.TypeLoadException tle)
            {
                // TODO Log something here in the system log.
            }
        }
Beispiel #2
0
        /**
         * Currently to start this from the command line you're going to give the directory, executable,
         * and then any command line args necessary. So,
         *
         * GPIIWindows8.exe "C:\Program Files (x86)\GPII\lgs-station" node.exe lgs_driver.js"
         */
        public GPIIApplicationContext(string[] args)
        {
            components = new System.ComponentModel.Container();
            notifyIcon = new NotifyIcon(components)
            {
                ContextMenuStrip = new ContextMenuStrip(),
                Icon             = new Icon("gpii.ico"),
                Text             = "GPII Windows 8",
                Visible          = true
            };
            notifyIcon.ContextMenuStrip.Items.Add(ToolStripMenuItemWithHandler("&Exit", exitItem_Click));

            nodeManager = new GPIINodeManager();
            if (args.Length == 3)
            {
                nodeManager.lgsWorkingDirectory = args[0];
                nodeManager.lgsFileName         = args[1];
                nodeManager.lgsArguments        = args[2];
            }
            nodeManager.startLocalGPII();

            try
            {
                p = new GPIIProximityListener();
                p.applicationContext = this;
                p.InitializeProximityDevice();
            }
            catch (System.TypeLoadException tle)
            {
                // TODO Log something here in the system log.
            }
        }