本文整理汇总了C#中SettingsDictionary.Add方法的典型用法代码示例。如果您正苦于以下问题:C# SettingsDictionary.Add方法的具体用法?C# SettingsDictionary.Add怎么用?C# SettingsDictionary.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SettingsDictionary
的用法示例。
在下文中一共展示了SettingsDictionary.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EventProcessing
public override void EventProcessing(EventContext context) {
if (!context.Event.IsError())
return;
Error error = context.Event.GetError();
if (error == null)
return;
if (String.IsNullOrWhiteSpace(context.Event.Message))
context.Event.Message = error.Message;
string[] commonUserMethods = { "DataContext.SubmitChanges", "Entities.SaveChanges" };
if (context.HasProperty("CommonMethods"))
commonUserMethods = context.GetProperty<string>("CommonMethods").SplitAndTrim(',');
string[] userNamespaces = null;
if (context.HasProperty("UserNamespaces"))
userNamespaces = context.GetProperty<string>("UserNamespaces").SplitAndTrim(',');
var signature = new ErrorSignature(error, userCommonMethods: commonUserMethods, userNamespaces: userNamespaces);
if (signature.SignatureInfo.Count <= 0)
return;
var targetInfo = new SettingsDictionary(signature.SignatureInfo);
var stackingTarget = error.GetStackingTarget();
if (stackingTarget != null && stackingTarget.Error != null)
targetInfo.Add("Message", error.GetStackingTarget().Error.Message);
error.Data[Error.KnownDataKeys.TargetInfo] = targetInfo;
foreach (var key in signature.SignatureInfo.Keys)
context.StackSignatureData.Add(key, signature.SignatureInfo[key]);
}
示例2: EncodeSettings
internal void EncodeSettings(SettingsProfile profile, SettingsDictionary settingsDictionary)
{
foreach (var entry in profile.Settings.Values)
{
try
{
// Find key
SettingsKey key;
settingsKeys.TryGetValue(entry.Name, out key);
settingsDictionary.Add(entry.Name, entry.GetSerializableValue(key));
}
catch (Exception)
{
}
}
}
示例3: GetSettings
private static SettingsDictionary GetSettings(IDictionary<string, string> values)
{
SettingsDictionary settings = new SettingsDictionary();
settings.Connections.Add("name", new ConnectionSettings("name", "connectionstring"));
foreach (KeyValuePair<string, string> value in values)
{
settings.Add(value.Key, value.Value);
}
return settings;
}