当前位置: 首页>>代码示例>>C#>>正文


C# IReadOnlyDictionary.ToString方法代码示例

本文整理汇总了C#中IReadOnlyDictionary.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IReadOnlyDictionary.ToString方法的具体用法?C# IReadOnlyDictionary.ToString怎么用?C# IReadOnlyDictionary.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IReadOnlyDictionary的用法示例。


在下文中一共展示了IReadOnlyDictionary.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Build

 public string Build(IReadOnlyDictionary<IParameterType, IParameter> parameters)
 {
     string parametersStr = parameters.ToString();
     string url = [email protected]"{Domain}/epz/order/extendedsearch/results.html?{parametersStr}searchString=&openMode=USE_DEFAULT_PARAMS&sortDirection=false&showLotsInfoHidden=false&orderNumber=&placingWaysList=&placingWaysList223=&currencyId=1&orderName=&participantName=&updateDateFrom=&updateDateTo=&customerTitle=&customerCode=&customerFz94id=&customerFz223id=&customerInn=&agencyTitle=&agencyCode=&agencyFz94id=&agencyFz223id=&agencyInn=&districts=&regions=&af=on&ca=on&deliveryAddress=&sortBy=RELEVANCE";
     return url;
 }
开发者ID:WakeDown,项目名称:Un1t_MarketplacesParser,代码行数:6,代码来源:ZakupkiUrlBuilder.cs

示例2: InsertRow

        private async Task<IRow> InsertRow(string key, IReadOnlyDictionary<string, string> columns)
        {
            logger.Info("inserting row to file: " + columns.ToString());

            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException(CommaDelimitedFileAdapter.ArgumentNameRow);
            }

            if (null == columns)
            {
                throw new ArgumentNullException(CommaDelimitedFileAdapter.ArgumentNameColumns);
            }

            IDictionary<string, string> valuesByNormalizedNames =
                columns
                .ToDictionary(
                    (KeyValuePair<string, string> item) =>
                        new Value(item.Key).ToString().ToUpperInvariant(),
                    (KeyValuePair<string, string> item) =>
                        item.Value);

            IList<string> values = new List<string>(this.headers.Count);

            string keyNormalized = new Value(key).ToString();
            values.Add(keyNormalized);

            IEnumerable<string> normalizedHeaders = this.headersNormalized.Skip(1);
            foreach (string normalizedHeader in normalizedHeaders)
            {
                string value = null;
                if (!valuesByNormalizedNames.TryGetValue(normalizedHeader, out value))
                {
                    values.Add(string.Empty);
                    continue;
                }

                string normalizedValue = new Value(value).ToString();
                values.Add(normalizedValue);
            }

            string row =
                string.Join(CommaDelimitedFileAdapter.Comma, values);

            AsyncSemaphore.Releaser? releaser = null;
            try
            {
                releaser = await this.semaphore.EnterAsync();

                StreamWriter writer = null;
                try
                {
                    writer = File.AppendText(this.FilePath);
                    logger.Info("inserting row: " + row);
                    await writer.WriteLineAsync(row);
                }
                finally
                {
                    if (writer != null)
                    {
                        writer.Close();
                        writer = null;
                    }
                }
            }
            finally
            {
                if (releaser.HasValue)
                {
                    releaser.Value.Dispose();
                    releaser = null;
                }
            }

            IRow result = new Row(keyNormalized, columns);
            return result;
        }
开发者ID:sunilkrpv,项目名称:AzureTestProvisioning,代码行数:77,代码来源:CommaDelimitedFileAdapter.cs


注:本文中的IReadOnlyDictionary.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。