本文整理汇总了C#中IIntegrationResult.AddIntegrationProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IIntegrationResult.AddIntegrationProperty方法的具体用法?C# IIntegrationResult.AddIntegrationProperty怎么用?C# IIntegrationResult.AddIntegrationProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IIntegrationResult
的用法示例。
在下文中一共展示了IIntegrationResult.AddIntegrationProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public void Run(IIntegrationResult result)
{
// only deal with known integration status
if (result.Status == IntegrationStatus.Unknown)
return;
string LogFileName = this.GetFilename(result);
string LogDirectory = this.LogDirectory(result.ArtifactDirectory);
result.AddIntegrationProperty("CCNetLogFilePath", Path.Combine(LogDirectory, LogFileName));
using (XmlIntegrationResultWriter integrationWriter = new XmlIntegrationResultWriter(CreateWriter(LogDirectory, LogFileName)))
{
integrationWriter.Formatting = Formatting.Indented;
integrationWriter.Write(result);
}
}
示例2: GetSource
public void GetSource(IIntegrationResult result)
{
this.ChangesetQueue.BeginIntegration();
Changeset Set = this.ChangesetQueue.GetCurrentIntegrationSet();
string ChangesetIdTo = ChangesetIdTo = Set.ChangesetId.ToString();
result.AddIntegrationProperty("CCNetVSTSChangeSetId", ChangesetIdTo);
if (AutoGetSource)
{
if (CleanCopy)
{
// If we have said we want a clean copy, then delete old copy before getting.
Log.Debug("Deleting " + this.WorkingDirectory);
this.DeleteDirectory(this.WorkingDirectory);
}
Workspace[] Workspaces = this.SourceControl.QueryWorkspaces(Workspace, this.SourceControl.AuthenticatedUser, Workstation.Current.Name);
Workspace MyWorkspace = null;
if (Workspaces.Length > 0)
{
// The workspace exists.
if (DeleteWorkspace)
{
// We have asked for a new workspace every time, therefore delete the existing one.
Log.Debug("Removing existing workspace " + Workspace);
this.SourceControl.DeleteWorkspace(Workspace, this.SourceControl.AuthenticatedUser);
Workspaces = new Workspace[0];
}
else
{
Log.Debug("Existing workspace detected - reusing");
MyWorkspace = Workspaces[0];
}
}
if (Workspaces.Length == 0)
{
Log.Debug("Creating new workspace name: " + Workspace);
MyWorkspace = this.SourceControl.CreateWorkspace(Workspace, this.SourceControl.AuthenticatedUser, "Created By CCNet vstsbychangesetSourceControl.");
}
try
{
MyWorkspace.Map(ProjectPath, WorkingDirectory);
Log.Debug(String.Format("Getting {0} to {1}", ProjectPath, WorkingDirectory));
GetRequest GetInfo;
GetInfo = new GetRequest(new ItemSpec(ProjectPath, RecursionType.Full), Set.ChangesetId);
this.SourceControl.Getting += new GettingEventHandler(OnGet);
if (CleanCopy || Force)
{
Log.Debug("Forcing a Get Specific with the options \"get all files\" and \"overwrite read/write files\"");
MyWorkspace.Get(GetInfo, GetOptions.GetAll | GetOptions.Overwrite);
}
else
{
Log.Debug("Performing a Get Latest");
MyWorkspace.Get(GetInfo, GetOptions.None);
}
}
finally
{
if (MyWorkspace != null && DeleteWorkspace)
{
Log.Debug("Deleting the workspace");
MyWorkspace.Delete();
}
this.SourceControl.Getting -= new GettingEventHandler(OnGet);
}
}
}
示例3: Run
public void Run(IIntegrationResult result)
{
if (result.Status == IntegrationStatus.Unknown)
return;
result.AddIntegrationProperty("CCNetDashboardServerName", this.DashboardServerName);
EmailMessage emailMessage = new EmailMessage(result, this);
string to = emailMessage.Recipients;
string subject = emailMessage.Subject;
string message = CreateMessage(result);
if (IsRecipientSpecified(to))
{
SendMessage(fromAddress, to, subject, message);
}
}
示例4: ShouldRunIntegration
public bool ShouldRunIntegration(ForceFilterClientInfo[] clientInfo, IIntegrationResult result)
{
UserInformation UserInfo = null;
foreach (ForceFilterClientInfo Info in clientInfo)
{
if (Info is UserInformation)
{
UserInfo = (UserInformation)Info;
break;
}
}
if (UserInfo == null)
throw new InvalidOperationException("No user information was found.");
result.AddIntegrationProperty("CCNetForcedBy", UserInfo.Name);
this.AddUserNameToResults(result, UserInfo);
if (this.DontCheck)
return true;
bool ToRun = false;
if (this.UserList.Contains(UserInfo.Name))
{
return true;
}
foreach (string GroupName in this.Groups)
{
if (UserInfo.Groups.Contains(GroupName))
{
return true;
}
}
Log.Info(string.Format("{0} is not allowed to force the build for project {1}.", UserInfo.Name, result.ProjectName));
return ToRun;
}