本文整理匯總了C#中System.Collections.Specialized.HybridDictionary.KeyValueString方法的典型用法代碼示例。如果您正苦於以下問題:C# HybridDictionary.KeyValueString方法的具體用法?C# HybridDictionary.KeyValueString怎麽用?C# HybridDictionary.KeyValueString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Collections.Specialized.HybridDictionary
的用法示例。
在下文中一共展示了HybridDictionary.KeyValueString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetParametersForTemplate
private static StringBuilder GetParametersForTemplate(ReportTask task)
{
ReportDef rdef = task.Definition;
NotificationDef ndef = task.Notification;
Dictionary<string, string> map = rdef.ReportParameters.KeyStringMap(false);
IDictionary newmap = new HybridDictionary(false);
foreach (string key in map.Keys)
newmap[key + '$'] = map[key]; // $=indicate that value has to be interpreted as string
string typedReportParameters = newmap.KeyValueString();
_Log.InfoFormat("Typed Report Parameters = {0}", typedReportParameters);
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(task.TimeZoneID);
StringBuilder sb = new StringBuilder()
.AppendKV("StartTime", TimeZoneInfo.ConvertTimeToUtc(task.StartTime, tzi))
.AppendKV("Priority", ndef.Priority)
.AppendKV("FirstDay", TimeZoneInfo.ConvertTimeToUtc(rdef.PeriodBegin, tzi), "z")
.AppendKV("LastDay", TimeZoneInfo.ConvertTimeToUtc(rdef.PeriodEnd.AddHours(-3).Date, tzi), "z")
// make sure before midnight, then take Date
.AppendKV("Offset", rdef.Offset)
.AppendKV("Scale", rdef.TimeScale.ToString())
.AppendKV("Locale", rdef.Locale)
.AppendKV("RepDesc", rdef.Description ?? "")
.AppendKV("Format", rdef.RenderFormat.ToString())
.AppendKV("UnitSys", CultureHelper.EnglishNameExtended(rdef.UnitSystemID))
.Append("||").Append(typedReportParameters); // report specific parameters are concatenated here
return sb;
}