mirror of
https://github.com/actions/runner.git
synced 2025-12-29 12:57:29 +08:00
GitHub Actions Runner
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.Serialization;
|
||||
using GitHub.DistributedTask.Expressions2.Sdk;
|
||||
using GitHub.Services.WebApi.Internal;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace GitHub.DistributedTask.Pipelines.ContextData
|
||||
{
|
||||
[DataContract]
|
||||
[ClientIgnore]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public sealed class BooleanContextData : PipelineContextData, IBoolean
|
||||
{
|
||||
public BooleanContextData(Boolean value)
|
||||
: base(PipelineContextDataType.Boolean)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
|
||||
public Boolean Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
}
|
||||
|
||||
public override PipelineContextData Clone()
|
||||
{
|
||||
return new BooleanContextData(m_value);
|
||||
}
|
||||
|
||||
public override JToken ToJToken()
|
||||
{
|
||||
return (JToken)m_value;
|
||||
}
|
||||
|
||||
public override String ToString()
|
||||
{
|
||||
return m_value ? "true" : "false";
|
||||
}
|
||||
|
||||
Boolean IBoolean.GetBoolean()
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
|
||||
public static implicit operator Boolean(BooleanContextData data)
|
||||
{
|
||||
return data.Value;
|
||||
}
|
||||
|
||||
public static implicit operator BooleanContextData(Boolean data)
|
||||
{
|
||||
return new BooleanContextData(data);
|
||||
}
|
||||
|
||||
[DataMember(Name = "b", EmitDefaultValue = false)]
|
||||
private Boolean m_value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user