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


C# IConstraint.GetType方法代码示例

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


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

示例1: InstanceRegistration

        public InstanceRegistration(IConstraint constraint, ActionDescriptor actionDescriptor, ControllerDescriptor controllerDescriptor, FilterScope scope1)
            : base(actionDescriptor, controllerDescriptor, scope1)
        {
            if (constraint == null)
            {
                throw new ArgumentNullException("constraint", "Constraint instance can not be null.");
            }

            Constraint = constraint;
            ConstraintType = Constraint.GetType();
        }
开发者ID:Grinderofl,项目名称:FluentMvc,代码行数:11,代码来源:InstanceRegistration.cs

示例2: ExtendConstraint

		private static ExtendedConstraint ExtendConstraint(IConstraint constraint, ReadOnlyCollection<DimensionWithValues> dimensionValues)
		{
			List<int> dimensionIndexes = GetDimensionIndexes(constraint, dimensionValues).ToList();
			if (dimensionIndexes.Count == 0)
			{
				throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
					"Constraint {0} doesn't have any required dimensions.", constraint.GetType().Name));
			}
			ReadOnlyCollection<DimensionWithValues> dimensionValuesSubset = dimensionIndexes.Select(di => dimensionValues[di]).ToList().AsReadOnly();
			ExtendedConstraint ret = new ExtendedConstraint(dimensionIndexes, dimensionValues);
			foreach (ReadOnlyCollection<int> indexes in CombinatorialUtilities.GetAllIndexCombinations(dimensionValuesSubset.Select(dv => dv.Values.Count)))
			{
				Vector v = CombinatorialUtilities.ConstructVector(dimensionValuesSubset, indexes);
				if (constraint.IsValid(v))
				{
					ret.AddNewValueCombinations(indexes);
				}
			}
			return ret;
		}
开发者ID:AlineGuan,项目名称:odata.net,代码行数:20,代码来源:PartialVectorConstraintChecker.cs

示例3: GetIndexOfConstraintDimension

		private static int GetIndexOfConstraintDimension(IConstraint constraint, ReadOnlyCollection<DimensionWithValues> dimensionValues,
			QualifiedDimension dimension)
		{
			int ret = 0;
			foreach (DimensionWithValues dv in dimensionValues)
			{
				if (IsSubset(dimension, dv.Dimension))
				{
					return ret;
				}
				ret++;
			}
			throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
				"Dimension {0} from constraint {1} was not found in the matrix (all dimensions: {2}).",
				dimension.FullyQualifiedName, constraint.GetType().Name, string.Join(",", dimensionValues.Select(dv => dv.Dimension.FullyQualifiedName))));
		}
开发者ID:AlineGuan,项目名称:odata.net,代码行数:16,代码来源:PartialVectorConstraintChecker.cs


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