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


C# IDictionary.GetEntryIgnoreCase方法代码示例

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


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

示例1: TryGetPlayerXamlThemeSource

 public static bool TryGetPlayerXamlThemeSource(IDictionary<string, string> initParams, out Uri xamlThemeSource)
 {
     if (initParams.ContainsKeyIgnoreCase("XamlThemeSource"))
     {
         if (Uri.TryCreate(initParams.GetEntryIgnoreCase("XamlThemeSource"), UriKind.RelativeOrAbsolute, out xamlThemeSource))
         {
             return true;
         }
     }
     xamlThemeSource = null;
     return false;
 }
开发者ID:nebtrx,项目名称:sidewired,代码行数:12,代码来源:XamlThemeLoader.cs

示例2: TryGetPlayerSettings

        private static bool TryGetPlayerSettings(IDictionary<string, string> initParams, out IPlayerSettings playerSettings)
        {
            if (initParams.ContainsKeyIgnoreCase("InitialSettings"))
            {
                string xmlSettings = initParams.GetEntryIgnoreCase("InitialSettings");
                if (!String.IsNullOrWhiteSpace(xmlSettings))
                {
                    var serializer = new XmlSerializer(typeof(PlayerSettings));
                    playerSettings = (IPlayerSettings)serializer.Deserialize(xmlSettings.AsStream());
                    return true;
                }

            }
            playerSettings = null;
            return false;
        }
开发者ID:nebtrx,项目名称:sidewired,代码行数:16,代码来源:SettingsAdapter.cs

示例3: IsMastStream

        private static bool IsMastStream(IDictionary<string, string> streamAttributes)
        {
            StreamType result;
            string type = streamAttributes.GetEntryIgnoreCase(TypeAttribute);
            string subType = streamAttributes.GetEntryIgnoreCase(SubTypeAttribute);

            return type.EnumTryParse(true, out result) && result == StreamType.Text
                   && AllowedStreamSubTypes.Any(i => string.Equals(i, subType, StringComparison.CurrentCultureIgnoreCase));
        }
开发者ID:rhlbenjamin,项目名称:azure-media-services-samples,代码行数:9,代码来源:InstreamMastMarkerProvider.cs

示例4: LoadInitParams

        /// <summary>
        /// Load settings from init params
        /// </summary>
        /// <param name="initParams"></param>
        public void LoadInitParams(IDictionary<string, string> initParams)
        {
            bool autoPlay;
            FeatureVisibility playerGraphVisibility;

            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.Title))
            {
                MediaTitleContent = initParams.GetEntryIgnoreCase(SupportedInitParams.Title);
            }

            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.ScriptableName)
                && !initParams.GetEntryIgnoreCase(SupportedInitParams.ScriptableName).IsNullOrWhiteSpace())
            {
                ScriptableName = initParams.GetEntryIgnoreCase(SupportedInitParams.ScriptableName);
            }

            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.AutoPlay)
                && bool.TryParse(initParams.GetEntryIgnoreCase(SupportedInitParams.AutoPlay), out autoPlay))
            {
                AutoPlay = autoPlay;
            }

            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.PlayerGraphVisibility)
                && FeatureVisibility.TryParse(initParams.GetEntryIgnoreCase(SupportedInitParams.PlayerGraphVisibility), true, out playerGraphVisibility))
            {
                PlayerGraphVisibility = playerGraphVisibility;
            }

            bool isStartPositionOffset = true;
            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.IsStartPositionOffset) && bool.TryParse(initParams.GetEntryIgnoreCase(SupportedInitParams.IsStartPositionOffset), out isStartPositionOffset))
            {
                IsStartPositionOffset = isStartPositionOffset;
            }

            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.MediaUrl)
                && !initParams.GetEntryIgnoreCase(SupportedInitParams.MediaUrl).IsNullOrWhiteSpace())
            {
                var playlist = new ObservableCollection<PlaylistItem>();

                var playlistItem = new PlaylistItem
                {
                    MediaSource = new Uri(initParams.GetEntryIgnoreCase(SupportedInitParams.MediaUrl))
                };


                DeliveryMethods deliveryMethod;
                if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.DeliveryMethod)
                    && initParams.GetEntryIgnoreCase(SupportedInitParams.DeliveryMethod).EnumTryParse(true, out deliveryMethod))
                {
                    playlistItem.DeliveryMethod = deliveryMethod;
                }


                if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.SelectedCaptionStream)
                    && !initParams.GetEntryIgnoreCase(SupportedInitParams.SelectedCaptionStream).IsNullOrWhiteSpace())
                {
                    playlistItem.SelectedCaptionStreamName = initParams.GetEntryIgnoreCase(SupportedInitParams.SelectedCaptionStream);
                }

                if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.ThumbnailUrl)
                    && !initParams.GetEntryIgnoreCase(SupportedInitParams.ThumbnailUrl).IsNullOrWhiteSpace())
                {
                    playlistItem.ThumbSource = new Uri(initParams.GetEntryIgnoreCase(SupportedInitParams.ThumbnailUrl));
                }

                playlist.Add(playlistItem);
                Playlist = playlist;
            }
            else if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.PlayerSettings)
                && !initParams.GetEntryIgnoreCase(SupportedInitParams.PlayerSettings).IsNullOrWhiteSpace())
            {
                ImportPlayerSettings(initParams.GetEntryIgnoreCase(SupportedInitParams.PlayerSettings));
            }

            Uri pluginSource;
            if (initParams.ContainsKeyIgnoreCase(SupportedInitParams.PluginUrl)
                && !initParams.GetEntryIgnoreCase(SupportedInitParams.PluginUrl).IsNullOrWhiteSpace()
                && Uri.TryCreate(initParams.GetEntryIgnoreCase(SupportedInitParams.PluginUrl), UriKind.RelativeOrAbsolute, out pluginSource))
            {
                BeginAddExternalPlugins(pluginSource);
            }
        }
开发者ID:Ginichen,项目名称:Silverlight-Player-for-PlayReady-with-Token-Auth,代码行数:86,代码来源:SMFPlayer.cs

示例5: IsCaptionStream

        private static bool IsCaptionStream(IDictionary<string, string> streamAttributes)
        {
            StreamType result;
            string type = streamAttributes.GetEntryIgnoreCase(TypeAttribute);
            string subType = streamAttributes.GetEntryIgnoreCase(SubTypeAttribute);

#if SILVERLIGHT3
            return SystemExtensions.TryParse(type, true, out result)
#else
            return Enum.TryParse(type, true, out result)
#endif
                && result == StreamType.Text
                && AllowedCaptionStreamSubTypes.Any(i => string.Equals(i, subType, StringComparison.CurrentCultureIgnoreCase));
        }
开发者ID:Ginichen,项目名称:Silverlight-Player-for-PlayReady-with-Token-Auth,代码行数:14,代码来源:InStreamClearTextCaptionsPlugin.cs

示例6: GetMacroCacheKey

        /// <summary>
        /// Creates a cache key for the macro's parameters and cache options.
        /// </summary>
        /// <param name="macroParams">A dicitonary of the parameters</param>
        /// <param name="currentPageId">The current page hiveId.  If null, CacheByPage is false.</param>
        /// <param name="currentMemberId">The current member hiveId.  If null, CachePersonalized is false.</param>
        /// <returns>A repeatable string key that represents the macro settings</returns>
        private static string GetMacroCacheKey(string macroAlias, IDictionary<string, string> macroParams, HiveId? currentPageId, HiveId? currentMemberId)
        {
            // hold the string while we build it up.
            var keyBuilder = new StringBuilder();

            keyBuilder.Append(MacroCachePrefix);
            keyBuilder.Append(macroAlias.ToUpperInvariant());
            keyBuilder.Append("-");            

            // cache by page and member are added to the key FIRST
            // so that it is easier to debug/view.

            // cache by page?
            if (currentPageId.HasValue && currentPageId.Value != HiveId.Empty)
            {
                var cacheByPageId = currentPageId.Value;

                // if the macroParams contains this item, that means the user is
                // overriding the requested item for the specified page.
                var userCurrentPageOverride = macroParams.GetEntryIgnoreCase(MacroPageParameterKey);
                if (!userCurrentPageOverride.IsNullOrWhiteSpace())
                {
                    var parsed = HiveId.TryParse(userCurrentPageOverride);
                    if (parsed.Success && parsed.Result != HiveId.Empty)
                    {
                        cacheByPageId = parsed.Result;
                    }
                }

                // add it to the key
                AppendMacroParam(keyBuilder, MacroPageParameterKey, cacheByPageId);
            }
            
            // personalized by member?
            if (currentMemberId.HasValue)
            {
                var cacheByMemberId = currentMemberId.Value;

                // if macroParams contains this item, we override it with the developer supplied value.
                var developerMemberOverride = macroParams.GetEntryIgnoreCase(MacroMemberParameterKey);
                if (!developerMemberOverride.IsNullOrWhiteSpace())
                {
                    var parsed = HiveId.TryParse(developerMemberOverride);
                    if (parsed.Success)
                    {
                        cacheByMemberId = parsed.Result;
                    }
                }

                // add it to the key
                AppendMacroParam(keyBuilder, MacroMemberParameterKey, cacheByMemberId);
            }
            
            // now add all of the macro parameters to the key!
            macroParams.OrderBy(kvp => kvp.Key).ForEach(kvp =>
                AppendMacroParam(keyBuilder, kvp.Key, kvp.Value));

            // return the stringed key!
            return keyBuilder.ToString();
        }
开发者ID:paulsuart,项目名称:rebelcmsxu5,代码行数:67,代码来源:MacroRenderer.cs


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