Exemple #1
0
 /// <summary>Refreshes project name if necessary.</summary>
 private void refreshProject()
 {
     //only run if it's not set.
     if ((this.ProjectName == "Project" || string.IsNullOrEmpty(this.ProjectName)) || this.UserID == -1)
     {
         try
         {
             ImportExport client = new ImportExport();
             client.Url             = this.ServerURL.AbsoluteUri + URL_APIADD;
             client.CookieContainer = new System.Net.CookieContainer();
             client.Connection_Authenticate2(this.UserName, this.UserPass, "Spira_VSIDE Label");
             client.Connection_ConnectToProject(this.ProjectID);
             //Get priject name.
             this.ProjectName = client.Project_RetrieveById(this.ProjectID).Name;
             //Get user ID.
             this.UserID = client.User_RetrieveByUserName(this.UserName).UserId.Value;
         }
         catch
         {}
     }
 }