示例#1
0
        public static int Main(string[] args)
        {
            ParseArgs(args);

            if (isVncFileSpec)
            {
                NewConn(vncFileName);
            }
            else if (File.Exists(App.AutostartFileName))
            {
                NewConn(App.AutostartFileName);
            }
            else
            {
                if (DevCap.Lvl >= DevCapLvl.Desktop)
                {
                    NewConn();
                }
                else
                {
                    // This is a hack. If we don't have at least one window visible,
                    // new windows wil be created in the background on Pocket PCs.
                    // TODO: Is this necessary for Smartphones?
                    Form dummy = new DummyForm();
                    dummy.Show();
                    NewConn();

                    // By now a View should have been created so we can close the dummy.
                    dummy.Close();
                }
            }

            while (connList.Count > 0)
            {
                try
                {
                    Application.DoEvents();
                    Thread.Sleep(Delta);
                }
                catch (ObjectDisposedException)
                {
                    // Catching ObjectDisposedException to work around a bug in .NET CF prior to SP3.
                    // This exception is thrown when the server drops a connection.
                }
            }

            return(0);
        }
示例#2
0
        public static int Main(string[] args)
        {
            string ip = "";

            try
            {
                ip = args[0];
            }
            catch { }

            string port = "";

            try
            {
                port = args[1];
            }
            catch { }

            bool readOnly = false;

            try
            {
                readOnly = Convert.ToBoolean(args[2]);
            }
            catch { }

            string info = "";

            try
            {
                info = args[3];
            }
            catch { }

            //ParseArgs(args);
            if (isVncFileSpec)
            {
                //NewConn(vncFileName);
            }
            else
            {
                if (DevCap.Lvl >= DevCapLvl.Desktop)
                {
                    NewConn(ip, port, readOnly, info);
                }
                //NewConn();
                else
                {
                    // This is a hack. If we don't have at least one window visible,
                    // new windows wil be created in the background on Pocket PCs.
                    // TODO: Is this necessary for Smartphones?
                    Form dummy = new DummyForm();
                    dummy.Show();
                    NewConn();

                    // By now a View should have been created so we can close the dummy.
                    dummy.Close();
                }
            }

            while (connList.Count > 0)
            {
                try
                {
                    Application.DoEvents();
                    Thread.Sleep(Delta);
                }
                catch (ObjectDisposedException)
                {
                    // Catching ObjectDisposedException to work around a bug in .NET CF prior to SP3.
                    // This exception is thrown when the server drops a connection.
                }
            }

            return(0);
        }