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


C# Collections.ContainsKey方法代码示例

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


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

示例1: _create

		protected override Resource _create( string name, ulong handle, string group, bool isManual, IManualResourceLoader loader, Collections.NameValuePairList createParams )
		{
			string paramSyntax = string.Empty;
			string paramType = string.Empty;

			if ( createParams == null || createParams.ContainsKey( "syntax" ) == false || createParams.ContainsKey( "type" ) == false )
			{
				throw new AxiomException( "You must supply 'syntax' and 'type' parameters" );
			}
			else
			{
				paramSyntax = createParams[ "syntax" ];
				paramType = createParams[ "type" ];
			}
			CreateGpuProgramDelegate iter = null;
			if ( this._programMap.ContainsKey( paramSyntax ) )
			{
				iter = this._programMap[ paramSyntax ];
			}
			else
			{
				// No factory, this is an unsupported syntax code, probably for another rendersystem
				// Create a basic one, it doesn't matter what it is since it won't be used
				return new GLES2GpuProgram( this, name, handle, group, isManual, loader );
			}
			GpuProgramType gpt;
			if ( paramType == "vertex_program" )
			{
				gpt = GpuProgramType.Vertex;
			}
			else
			{
				gpt = GpuProgramType.Fragment;
			}

			return iter( this, name, handle, group, isManual, loader, gpt, paramSyntax );
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:37,代码来源:GLES2GpuProgramManager.cs

示例2: _create

		/// <summary>
		/// 
		/// </summary>
		/// <param name="name"></param>
		/// <param name="handle"></param>
		/// <param name="group"></param>
		/// <param name="isManual"></param>
		/// <param name="loader"></param>
		/// <param name="createParams"></param>
		/// <returns></returns>
		protected override Resource _create( string name, ulong handle, string group, bool isManual, IManualResourceLoader loader, Collections.NameValuePairList createParams )
		{
			if ( createParams == null || !createParams.ContainsKey( "syntax" )
				|| !createParams.ContainsKey( "type" ) )
			{
				throw new NotImplementedException( "You must supply 'syntax' and 'type' parameters" );
			}

			GpuProgramType gpt = 0;
			CreateGpuProgramDelegate iter = _programMap[ createParams[ "syntax" ] ];
			if ( iter == null )
			{
				return null;
			}
			string syntaxcode = string.Empty;
			foreach ( KeyValuePair<string, CreateGpuProgramDelegate> pair in _programMap )
				if ( pair.Value == iter )
				{
					syntaxcode = pair.Key;
					break;
				}
			if ( createParams[ "type" ] == "vertex_program" )
			{
				gpt = GpuProgramType.Vertex;
			}
			else if ( createParams[ "type" ] == "fragment_program" )
			{
				gpt = GpuProgramType.Fragment;
			}
			else
			{
				throw new AxiomException( "Unknown GpuProgramType : " + createParams[ "type" ] );
			}
			return iter( this, name, handle, group, isManual, loader, gpt, syntaxcode );
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:45,代码来源:GLESGpuProgramManager.cs


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