public override void Run() { try { var apiInstance = new RequestsDirectoryAdminApi(Configuration.Default); var result = new List <AllRequestList>(); var nl = new NextLink(); while (nl != null) { var pageResult = apiInstance.GetAllRequests(nl.Filter, nl.OrderBy, nl.Search, nl.Top, nl.Skip); nl = null; if (pageResult != null && pageResult.Value != null) { result.AddRange(pageResult.Value); if (!String.IsNullOrEmpty(pageResult.NextLink)) { nl = new NextLink(pageResult.NextLink); } } } Console.WriteLine(result); } catch (ApiException e) { Console.WriteLine("Exception when calling RequestsApi.SubmitLockSiteRequest: " + e.Message); Console.WriteLine("Status Code: " + e.ErrorCode); Console.WriteLine(e.StackTrace); } }
protected override void Move() { _timer.Stop(); if (CanMove()) { if (LastBaggage != null) { NextLink.PassBaggage(LastBaggage); _conveyorBelt[LastIndex] = null; } for (int i = LastIndex; i > 0; i--) { _conveyorBelt[i] = _conveyorBelt[i - 1]; _conveyorBelt[i - 1] = null; } NextLink.OnStatusChangedToFree -= Move; Status = NodeState.Free; _timer.Start(); } else { NextLink.OnStatusChangedToFree += Move; } }
protected override void Move() { _timer.Stop(); if (CanMove()) { if (LastBaggage != null) { NextLink.PassBaggage(LastBaggage); _conveyorBelt[LastIndex] = null; } for (int i = LastIndex; i > 0; i--) { _conveyorBelt[i] = _conveyorBelt[i - 1]; _conveyorBelt[i - 1] = null; } NextLink.OnStatusChangedToFree -= Move; foreach (var kvp in _statusChangedToFreeEvents) { if (_conveyorBelt[kvp.Key] == null) { kvp.Value?.Invoke(); } } _timer.Start(); } else { NextLink.OnStatusChangedToFree += Move; } }
private void Move() { if (NextLink.Status == NodeState.Free && _currentBaggage != null) { NextLink.OnStatusChangedToFree -= Move; NextLink.PassBaggage(_currentBaggage); Status = NodeState.Free; } else if (NextLink.Status != NodeState.Free) { NextLink.OnStatusChangedToFree += Move; } }
public void DistributeBaggage() { if (Baggages.Count > 0) { if (NextLink.Status == NodeState.Free) { var _currentBaggage = Baggages.Dequeue(); _currentBaggage.Destination = typeof(Mpa).Name; NextLink.PassBaggage(_currentBaggage); } } }
public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) { var attribute = apiDescription.ActionDescriptor .GetCustomAttributes <NonPageableAttribute>() .FirstOrDefault(); if (attribute == null) { return; } var nullNextLink = new NextLink { NextLinkName = null }; operation.vendorExtensions.Add(PageableKey, nullNextLink); }
/// <summary> /// Serializes this instance of <see cref="OperationDefinitionListResult" /> into a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject"/> container to serialize this object into. If the caller /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param> /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="OperationDefinitionListResult" /> as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode" />. /// </returns> public Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.SerializationMode serializationMode) { container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != (((object)NextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.JsonString(NextLink.ToString()) : null, "nextLink", container.Add); if (null != Value) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.AppConfiguration.Runtime.Json.XNodeArray(); foreach (var __x in Value) { AddIf(__x?.ToJson(null), __w.Add); } container.Add("value", __w); } AfterToJson(ref container); return(container); }
/// <summary> /// select next /// </summary> public void SelectNext() { NextLink.Wait(3).Click(); DriverCommands.WaitAndMeasurePageLoadTime(); }