internal static JitSchedulingPolicy DeserializeJitSchedulingPolicy(JsonElement element)
        {
            JitSchedulingType type      = default;
            TimeSpan          duration  = default;
            DateTimeOffset    startTime = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("type"))
                {
                    type = new JitSchedulingType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("duration"))
                {
                    duration = property.Value.GetTimeSpan("P");
                    continue;
                }
                if (property.NameEquals("startTime"))
                {
                    startTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
            }
            return(new JitSchedulingPolicy(type, duration, startTime));
        }
 public JitSchedulingPolicy(JitSchedulingType schedulingType, TimeSpan duration, DateTimeOffset startOn)
 {
     SchedulingType = schedulingType;
     Duration       = duration;
     StartOn        = startOn;
 }
Ejemplo n.º 3
0
 public JitSchedulingPolicy(JitSchedulingType jitSchedulingType, TimeSpan duration, DateTimeOffset startTime)
 {
     JitSchedulingType = jitSchedulingType;
     Duration          = duration;
     StartTime         = startTime;
 }