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


C# IDictionary.ContainsKeyIgnoreCase方法代码示例

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


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

示例4: GetSelection

        /// <summary>
        /// Method supplied to the <see cref="VersatileIO.OnGetSelection"/> delegate.
        /// </summary>
        /// <param name="prompt">Dictionary of options and their respective keys</param>
        /// <param name="options">Text given as a prompt after selections are listed.</param>
        /// <returns>The key of the resulting item.</returns>
        public override string GetSelection(string prompt, IDictionary<string, object> options)
        {
            foreach (KeyValuePair<string, object> kvp in options)
            {
                Console.ForegroundColor = PromptColor;
                Console.WriteLine("  [{0}]: {1}", kvp.Key, kvp.Value);
            }

            while (true)
            {
                Console.ForegroundColor = PromptColor;
                Console.Write(prompt);
                string input = Console.ReadLine();

                if (options.ContainsKeyIgnoreCase(input))
                {
                    return input;
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("'{0}' is not one of the options above.", input);

                    if (!BePersistent)
                    {
                        Console.WriteLine("Defaulting to first option.");
                        return options.Keys.FirstOrDefault();
                    }
                }
            }
        }
开发者ID:einsteinsci,项目名称:ultimate-util,代码行数:37,代码来源:PresetVersatileConsoleIO.cs

示例5: GetSelectionIgnorable

        /// <summary>
        /// Method supplied to the <see cref="VersatileIO.OnGetIgnorableSelection"/> delegate.
        /// </summary>
        /// <param name="prompt">Dictionary of options and their respective keys</param>
        /// <param name="options">Text given as a prompt after selections are listed.</param>
        /// <returns>The key of the resulting item.</returns>
        public override string GetSelectionIgnorable(string prompt, IDictionary<string, object> options)
        {
            foreach (KeyValuePair<string, object> kvp in options)
            {
                Console.ForegroundColor = PromptColor;
                Console.WriteLine("  [{0}]: {1}", kvp.Key, kvp.Value);
            }

            Console.ForegroundColor = PromptColor;
            Console.Write(prompt);
            string input = Console.ReadLine();

            if (options.ContainsKeyIgnoreCase(input))
            {
                return input;
            }
            else
            {
                return null;
            }
        }
开发者ID:einsteinsci,项目名称:ultimate-util,代码行数:27,代码来源:PresetVersatileConsoleIO.cs

示例6: GetSelectionIgnorable

        public override string GetSelectionIgnorable(string prompt, IDictionary<string, object> options)
        {
            foreach (KeyValuePair<string, object> kvp in options)
            {
                LogLine("  [{0}]: {1}".Fmt(kvp.Key, kvp.Value), ConsoleColor.White);
            }

            string input = GetString(prompt);

            if (options.ContainsKeyIgnoreCase(input))
            {
                return input;
            }
            else
            {
                return null;
            }
        }
开发者ID:einsteinsci,项目名称:custom-steam-tools,代码行数:18,代码来源:ConsoleVersatileHandler.cs

示例7: GetSelection

        public override string GetSelection(string prompt, IDictionary<string, object> options)
        {
            foreach (KeyValuePair<string, object> kvp in options)
            {
                LogLine("  [{0}]: {1}".Fmt(kvp.Key, kvp.Value), ConsoleColor.White);
            }

            while (true)
            {
                string input = GetString(prompt);

                if (options.ContainsKeyIgnoreCase(input))
                {
                    return input;
                }
                else
                {
                    VersatileIO.Error("'{0}' is not one of the options above.", input);

                    if (!BePersistent)
                    {
                        VersatileIO.Info("Defaulting to first option.");
                        return options.Keys.FirstOrDefault();
                    }
                }
            }
        }
开发者ID:einsteinsci,项目名称:custom-steam-tools,代码行数:27,代码来源:ConsoleVersatileHandler.cs


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