本文整理汇总了C#中IPropertyDefinition类的典型用法代码示例。如果您正苦于以下问题:C# IPropertyDefinition类的具体用法?C# IPropertyDefinition怎么用?C# IPropertyDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPropertyDefinition类属于命名空间,在下文中一共展示了IPropertyDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryPlanProperty
/// <summary>
/// Create a new query plan property
/// </summary>
/// <param name="myVertexType">The interesting vertex type</param>
/// <param name="myProperty">The interesting property</param>
public QueryPlanProperty(IVertexType myVertexType, IPropertyDefinition myProperty, String myInterestingEdition, TimeSpanDefinition myInterestingTimeSpan)
{
VertexType = myVertexType;
Property = myProperty;
Edition = myInterestingEdition;
Timespan = myInterestingTimeSpan;
}
示例2: Aggregate
/// <summary>
/// Calculates the sum
/// </summary>
public FuncParameter Aggregate(IEnumerable<IComparable> myValues, IPropertyDefinition myPropertyDefinition)
{
var sumType = myPropertyDefinition.BaseType;
IComparable sum = null;
try
{
foreach (var value in myValues)
{
if (sum == null)
{
sum = ArithmeticOperations.Add(sumType, 0, value);
}
else
{
sum = ArithmeticOperations.Add(sumType, sum, value);
}
}
}
catch (ArithmeticException)
{
throw new InvalidArithmeticAggregationException(sumType, this.AggregateName);
}
return new FuncParameter(sum, myPropertyDefinition);
}
示例3: DoCreate
/// <summary>
/// Creates the a <see cref="Column"/>.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="table">The <see cref="Table"/> to which the column will be added.</param>
/// <param name="property">The <see cref="IPropertyDefinition"/>.</param>
/// <returns>Returns the created <see cref="Column"/>.</returns>
protected virtual Column DoCreate(IMansionContext context, Table table, IPropertyDefinition property)
{
// get the column name
var columnName = Properties.Get<string>(context, "columnName", null) ?? property.Name;
// create the column
return PropertyColumn.CreatePropertyColumn(context, property.Name, columnName, Properties);
}
示例4: DoCreateSingleMapping
/// <summary>
/// Creates a <see cref="PropertyMapping"/> from this descriptor.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="property">The <see cref="IPropertyDefinition"/>.</param>
/// <returns>The created <see cref="PropertyMapping"/>.</returns>
protected override SinglePropertyMapping DoCreateSingleMapping(IMansionContext context, IPropertyDefinition property)
{
// create the mapping
return new SingleValuedPropertyMapping(property.Name) {
// map the type
Type = Properties.Get<string>(context, "type")
};
}
示例5: ServicePropertyDefinition
public ServicePropertyDefinition(IPropertyDefinition myPropertyDefinition)
: base(myPropertyDefinition)
{
this.IsMandatory = myPropertyDefinition.IsMandatory;
this.InIndices = myPropertyDefinition.InIndices.Select(x => x.Name).ToList();
this.Multiplicity = ConvertHelper.ToServicePropertyMultiplicity(myPropertyDefinition.Multiplicity);
this.IsUserDefinedType = myPropertyDefinition.IsUserDefinedType;
this.BaseType = myPropertyDefinition.BaseType.AssemblyQualifiedName;
this.DefaultValue = myPropertyDefinition.DefaultValue;
}
示例6: CciPropertyDetails
public CciPropertyDetails(IPropertyDefinition property)
: base(property)
{
if (property == null)
{
throw new ArgumentNullException("property");
}
_property = property;
}
示例7: Visit
public override void Visit(IPropertyDefinition property)
{
IMethodReference getter = property.Getter;
IMethodReference setter = property.Setter;
if (getter != null)
AddMemberReference(getter.ResolvedMethod);
if (setter != null)
AddMemberReference(setter.ResolvedMethod);
base.Visit(property);
}
示例8: Create
/// <summary>
/// Creates the a <see cref="Column"/>.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="table">The <see cref="Table"/> to which the column will be added.</param>
/// <param name="property">The <see cref="IPropertyDefinition"/>.</param>
/// <returns>Returns the created <see cref="Column"/>.</returns>
/// <exception cref="ArgumentNullException">Thrown if one of the parameters is null.</exception>
public Column Create(IMansionContext context, Table table, IPropertyDefinition property)
{
// validate arguments
if (context == null)
throw new ArgumentNullException("context");
if (property == null)
throw new ArgumentNullException("property");
if (table == null)
throw new ArgumentNullException("table");
// invoke template method
return DoCreate(context, table, property);
}
示例9: Create
/// <summary>
/// Creates the <see cref="Table"/> from the descriptor.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="schema">The <see cref="Schema"/>in which to create the table.</param>
/// <param name="property">The <see cref="IPropertyDefinition"/>.</param>
/// <exception cref="ArgumentNullException">Thrown if one of the parameters is null.</exception>
public void Create(IMansionContext context, Schema schema, IPropertyDefinition property)
{
// validate arguments
if (context == null)
throw new ArgumentNullException("context");
if (schema == null)
throw new ArgumentNullException("schema");
if (property == null)
throw new ArgumentNullException("property");
// invoke template method
DoCreate(context, schema, property);
}
示例10: WriteAccessorDefinition
private void WriteAccessorDefinition(IPropertyDefinition property, IMethodDefinition accessor, string accessorType)
{
WriteSpace();
WriteAttributes(accessor.Attributes, writeInline: true);
// If the accessor is an internal call (or a PInvoke) we should put those attributes here as well
WriteMethodPseudoCustomAttributes(accessor);
if (accessor.Visibility != property.Visibility)
WriteVisibility(accessor.Visibility);
WriteKeyword(accessorType, noSpace: true);
WriteMethodBody(accessor);
}
示例11: Aggregate
/// <summary>
/// Calculates the maximum
/// </summary>
public FuncParameter Aggregate(IEnumerable<IComparable> myValues, IPropertyDefinition myPropertyDefinition)
{
IComparable max = null;
foreach (var value in myValues)
{
if (max == null)
{
max = value;
}
else if (max.CompareTo(value) < 0)
{
max = value;
}
}
return new FuncParameter(max, myPropertyDefinition);
}
示例12: DoAddMappingTo
/// <summary>
/// Adds <see cref="PropertyMapping"/>s of <paramref name="property"/> to the given <paramref name="typeMapping"/>.
/// </summary>
/// <param name="context">The <see cref="IMansionContext"/>.</param>
/// <param name="property">The <see cref="IPropertyDefinition"/> of the property for which to add the <see cref="PropertyMapping"/>s.</param>
/// <param name="typeMapping">The <see cref="TypeMapping"/> to which to add the new <see cref="PropertyMapping"/>s.</param>
protected override void DoAddMappingTo(IMansionContext context, IPropertyDefinition property, TypeMapping typeMapping)
{
typeMapping.Add(new SingleValuedPropertyMapping("approved")
{
Type = "boolean"
});
typeMapping.Add(new SingleValuedPropertyMapping("archived")
{
Type = "boolean"
});
typeMapping.Add(new SingleValuedPropertyMapping("publicationDate")
{
Type = "date"
});
typeMapping.Add(new SingleValuedPropertyMapping("expirationDate")
{
Type = "date"
});
}
示例13: Aggregate
/// <summary>
/// Calculates the average
/// </summary>
public FuncParameter Aggregate(IEnumerable<IComparable> myValues, IPropertyDefinition myPropertyDefinition)
{
var divType = myPropertyDefinition.BaseType;
IComparable sum = null;
uint total = 0;
foreach (var value in myValues)
{
if (sum == null)
{
sum = ArithmeticOperations.Add(divType, 0, value);
}
else
{
sum = ArithmeticOperations.Add(divType, sum, value);
}
total++;
}
var aggregateResult = ArithmeticOperations.Div(typeof(Double), sum, total);
return new FuncParameter(aggregateResult, myPropertyDefinition);
}
示例14: onMetadataElement
public virtual void onMetadataElement(IPropertyDefinition propertyDefinition) { }
示例15: Visit
public override void Visit(IPropertyDefinition property)
{
if (IsMemberExternallyVisible2(property))
{
// Recursion
Visit(property.Parameters);
Visit(property.Type);
}
}