本文整理汇总了C#中IPropertySet.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertySet.ContainsKey方法的具体用法?C# IPropertySet.ContainsKey怎么用?C# IPropertySet.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertySet
的用法示例。
在下文中一共展示了IPropertySet.ContainsKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCacheValue
internal static byte[] GetCacheValue(IPropertySet containerValues)
{
if (!containerValues.ContainsKey(CacheValueLength))
{
return null;
}
int encyptedValueLength = (int)containerValues[CacheValueLength];
int segmentCount = (int)containerValues[CacheValueSegmentCount];
byte[] encryptedValue = new byte[encyptedValueLength];
if (segmentCount == 1)
{
encryptedValue = (byte[])containerValues[CacheValue + 0];
}
else
{
for (int i = 0; i < segmentCount - 1; i++)
{
Array.Copy((byte[])containerValues[CacheValue + i], 0, encryptedValue, i * MaxCompositeValueLength, MaxCompositeValueLength);
}
}
Array.Copy((byte[])containerValues[CacheValue + (segmentCount - 1)], 0, encryptedValue, (segmentCount - 1) * MaxCompositeValueLength, encyptedValueLength - (segmentCount - 1) * MaxCompositeValueLength);
return CryptographyHelper.Decrypt(encryptedValue);
}
开发者ID:ankurchoubeymsft,项目名称:azure-activedirectory-library-for-dotnet,代码行数:26,代码来源:LocalSettingsHelper.cs
示例2: SetContent
private static void SetContent(IPropertySet set, string key, string value)
{
if (set.ContainsKey(key))
{
set[key] = value;
}
else
{
set.Add(key, value);
}
}
示例3: ReadContent
private static string ReadContent(IPropertySet set, string key)
{
if (set.ContainsKey(key))
{
return set[key] as string;
}
return string.Empty;
}