示例#1
0
        public bool logIn()
        {
            // Create the Server object.
            m_bnBuildID = StarTeam.BuildNumber.BuildString;

            if (m_server == null)
            {
                try
                {
                    m_server = new Server(SetServerInfo());//new StarTeam.Server(SetServerInfo());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Server Not Initialized");
                    return false;
                }
            }

            // LogOn to the server.
            try
            {
                m_server.LogOn(m_strUser, m_strPassword);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Login Problem");
                return false;
            }

            // Determine which Item Types to display.
            m_stItemTypes = ResolveItemTypes(m_server, m_strTypeNames);

            return true;
        }
示例#2
0
        // Creates a StarTeam server object, connects to the server, and logs in.
        // Returns the resulting Server object.
        public Server GetServer()
        {
            // Simplest constructor, uses default encryption algorithm and compression level.
            m_bnBuildID = StarTeam.BuildNumber.BuildString;

            if (m_server == null)
            {
                try
                {
                    m_server = new Server(SetServerInfo());//new StarTeam.Server(SetServerInfo());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Server Not Initialized");
                    return null;
                }
            }

            // Optional; logOn() connects if necessary.
            m_server.Connect();

            // Logon using specified user name and password.
            m_server.LogOn(m_strUser, m_strPassword);

            return (m_server);
        }