private bool SetTFSInstance(ref TFSOperation tFSOperation) { string tfsQuery = Utils.GetConfig(AppConstants.TFSQUERY); string tfsURL = Utils.GetConfig(AppConstants.TFSURL); if (Utils.GetConfig(AppConstants.TFS_USERNAME).IsNullOrEmpty() || Utils.GetConfig(AppConstants.TFS_PASSWORD).IsNullOrEmpty() || tfsQuery.IsNullOrEmpty() || tfsURL.IsNullOrEmpty()) { throw new Exception("Please set tfs credential in app.config."); } tFSOperation.QuertStr = tfsQuery; tFSOperation.URL = tfsURL; return(true); }
private void PrepareVKWorkItems() { this.BeginWait(); ThreadPool.QueueUserWorkItem(delegate(object arg) { try { TFSOperation tFSOperation = TFSOperation.Instance; try { if (!SetTFSInstance(ref tFSOperation)) { return; } if (!tFSOperation.ConnectTFS()) { return; } } catch (Exception e) { base._Log.Error("TFS Operation:" + e.Message); } try { body = new StringBuilder(); content = new StringBuilder(); //handle changesets if (Utils.GetConfig(AppConstants.CHANGESETS_ENABLE, "F") == "T") { List <ChangeSetItem> changeSets = new List <ChangeSetItem>(); string[] strChangeSets = Utils.GetConfig(AppConstants.CHANGESETS_PROS).Split(','); foreach (string pro in strChangeSets) { changeSets = tFSOperation.GetChangeItems(pro); HandleCSItems(changeSets, pro.Replace("$/", string.Empty)); } } List <VKWorkItem> vKWorkItems = tFSOperation.GetVKWorkItems(); if (vKWorkItems == null || vKWorkItems.Count <= 0) { return; } HandleWorkItems(vKWorkItems); GetEmailContent(); } catch (Exception e) { base._Log.Error("Items Handle error:" + e.Message); } } finally { this.EndWait(); } }); }