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


C# IPropertySet.ContainsKey方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:RickSaling,项目名称:azure-mobile-services,代码行数:11,代码来源:LocalStorageManager.cs

示例3: ReadContent

        private static string ReadContent(IPropertySet set, string key)
        {
            if (set.ContainsKey(key))
            {
                return set[key] as string;
            }

            return string.Empty;
        }
开发者ID:RickSaling,项目名称:azure-mobile-services,代码行数:9,代码来源:LocalStorageManager.cs


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