/// <summary> /// Parses the specified configuration if <paramref name="repositoryGroup"/> is not empty, otherwise parse it . /// </summary> /// <param name="repositoryGroup">The configuration.</param> /// <returns>AzureDeviceParameters.</returns> /// <exception cref="NotImplementedException">parse string</exception> internal static AzureDeviceParameters ParseRepositoryGroup(string repositoryGroup) { AzureDeviceParameters ret = new AzureDeviceParameters(); if (String.IsNullOrEmpty(repositoryGroup)) { return(ret); } string[] args = repositoryGroup.Split(' '); using (Parser parserInstance = new Parser(x => { x.AutoHelp = false; x.AutoVersion = false; x.HelpWriter = null; })) parserInstance.ParseArguments <AzureDeviceParameters>(args).WithParsed <AzureDeviceParameters>(opts => ret = opts).WithNotParsed <AzureDeviceParameters>(X => ReportErrors(X)); return(ret); }
internal CommunicationContext(IDTOProvider dataProvider, string repositoryGroup, AzureDeviceParameters azureDeviceParameters) { _Logger.EnteringMethodAzure(nameof(CommunicationContext)); _dataProvider = dataProvider ?? throw new ArgumentNullException($"{nameof(dataProvider)}"); _repositoryGroup = repositoryGroup; _azureDeviceParameters = azureDeviceParameters ?? throw new ArgumentNullException($"{nameof(azureDeviceParameters)}"); }