Exemple #1
0
        public MainForm()
        {
            InitializeComponent();

            // log
            foreach (string arg in Environment.GetCommandLineArgs())
            {
                if (arg == "--log")
                {
                    useLog = true;
                }
            }
            ILog log;

            miLog.Visible = useLog;
            if (useLog)
            {
                logForm = new LogForm();
                log     = new TextBoxLog(logForm.TextBox);
            }
            else
            {
                log = new NullLog();
            }

            // version string
            lbVersion.Text = GetVersion();

            // ip address
            try
            {
                lbIpAddr.Text = GetIpAddress();
            }
            catch
            {
                lbIpAddr.Text = "Unknown";
            }

            // input controller
            inputController = new WinInputController();

            // services
            dserver = new DiscoveryServer(log);
            iserver = new InputServer.InputServer(log, inputController);

            // hide window
            WindowState   = FormWindowState.Minimized;
            ShowInTaskbar = false;
        }
        public MainForm()
        {
            InitializeComponent();

            // log
            foreach (string arg in Environment.GetCommandLineArgs())
                if (arg == "--log")
                    useLog = true;
            ILog log;
            miLog.Visible = useLog;
            if (useLog)
            {
                logForm = new LogForm();
                log = new TextBoxLog(logForm.TextBox);
            }
            else
                log = new NullLog();

            // version string
            lbVersion.Text = GetVersion();

            // ip address
            try
            {
                lbIpAddr.Text = GetIpAddress();
            }
            catch
            {
                lbIpAddr.Text = "Unknown";
            }

            // input controller
            inputController = new WinInputController();

            // services
            dserver = new DiscoveryServer(log);
            iserver = new InputServer.InputServer(log, inputController);

            // hide window
            WindowState = FormWindowState.Minimized;
            ShowInTaskbar = false;
        }