本文整理汇总了C#中IPropertyDefinition类的典型用法代码示例。如果您正苦于以下问题:C# IPropertyDefinition类的具体用法?C# IPropertyDefinition怎么用?C# IPropertyDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPropertyDefinition类属于命名空间,在下文中一共展示了IPropertyDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:anukat2015,项目名称:sones,代码行数:12,代码来源:QueryPlanProperty.cs
示例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);
}
开发者ID:loubo,项目名称:sones,代码行数:29,代码来源:SumAggregate.cs
示例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);
}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:15,代码来源:ColumnDescriptor.cs
示例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")
};
}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:14,代码来源:SingleValuedPropertyMapping.cs
示例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;
}
开发者ID:anukat2015,项目名称:sones,代码行数:10,代码来源:ServicePropertyDefinition.cs
示例6: CciPropertyDetails
public CciPropertyDetails(IPropertyDefinition property)
: base(property)
{
if (property == null)
{
throw new ArgumentNullException("property");
}
_property = property;
}
开发者ID:Pablissimo,项目名称:nrconfig,代码行数:10,代码来源:CciPropertyDetails.cs
示例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);
}
开发者ID:dsgouda,项目名称:buildtools,代码行数:12,代码来源:ImplClosureVisitor.cs
示例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);
}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:21,代码来源:ColumnDescriptor.cs
示例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);
}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:20,代码来源:PropertyTableDescriptor.cs
示例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);
}
开发者ID:pgavlin,项目名称:ApiTools,代码行数:13,代码来源:CSDeclarationWriter.Properties.cs
示例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);
}
开发者ID:anukat2015,项目名称:sones,代码行数:21,代码来源:MaxAggregate.cs
示例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"
});
}
开发者ID:Erikvl87,项目名称:Premotion-Mansion,代码行数:25,代码来源:PublicationStatusPropertyMappingDescriptor.cs
示例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);
}
开发者ID:anukat2015,项目名称:sones,代码行数:27,代码来源:AvgAggregate.cs
示例14: onMetadataElement
public virtual void onMetadataElement(IPropertyDefinition propertyDefinition) { }
开发者ID:lleraromero,项目名称:bytecodetranslator,代码行数:1,代码来源:Translator.cs
示例15: Visit
public override void Visit(IPropertyDefinition property)
{
if (IsMemberExternallyVisible2(property))
{
// Recursion
Visit(property.Parameters);
Visit(property.Type);
}
}
开发者ID:natemcmaster,项目名称:buildtools,代码行数:9,代码来源:ApiClosureVisitor.cs
示例16: PrintPropertyDefinitionReturnType
public virtual void PrintPropertyDefinitionReturnType(IPropertyDefinition propertyDefinition) {
PrintTypeReference(propertyDefinition.Type);
}
开发者ID:xornand,项目名称:cci,代码行数:3,代码来源:PropertySourceEmitter.cs
示例17: PrintPropertyDefinitionVisibility
public virtual void PrintPropertyDefinitionVisibility(IPropertyDefinition propertyDefinition) {
PrintTypeMemberVisibility(propertyDefinition.Visibility);
}
开发者ID:xornand,项目名称:cci,代码行数:3,代码来源:PropertySourceEmitter.cs
示例18: PrintPropertyDefinitionModifiers
public virtual void PrintPropertyDefinitionModifiers(IPropertyDefinition propertyDefinition) {
PrintMethodDefinitionModifiers(propertyDefinition.Getter == null ?
propertyDefinition.Setter.ResolvedMethod :
propertyDefinition.Getter.ResolvedMethod);
}
开发者ID:xornand,项目名称:cci,代码行数:5,代码来源:PropertySourceEmitter.cs
示例19: PrintPropertyDefinitionName
public virtual void PrintPropertyDefinitionName(IPropertyDefinition propertyDefinition) {
PrintIdentifier(propertyDefinition.Name);
}
开发者ID:xornand,项目名称:cci,代码行数:3,代码来源:PropertySourceEmitter.cs
示例20: TraverseChildren
public override void TraverseChildren(IPropertyDefinition propertyDefinition) {
PrintAttributes(propertyDefinition);
bool isIndexer = false;
if (IteratorHelper.EnumerableIsNotEmpty(propertyDefinition.Parameters)) {
// We have an indexer. Note that this could still be an explicit interface implementation.
// If it's got a name other than 'Item', we need an attribute to rename it.
// Note that there will usually be a DefaultMemberAttribute on the class with the name
// but the attribute doesn't always exist (eg. if it's an explicit interaface impl)
isIndexer = true;
string id = propertyDefinition.Name.Value;
string simpleId = id.Substring(id.LastIndexOf('.') + 1); // excludes any interface type
if (simpleId != "Item") {
PrintPseudoCustomAttribute(propertyDefinition, "System.Runtime.CompilerServices.IndexerName", QuoteString(simpleId), true, null);
}
}
PrintToken(VBToken.Indent);
IMethodDefinition propMeth = propertyDefinition.Getter == null ?
propertyDefinition.Setter.ResolvedMethod :
propertyDefinition.Getter.ResolvedMethod;
if (!propertyDefinition.ContainingTypeDefinition.IsInterface &&
IteratorHelper.EnumerableIsEmpty(MemberHelper.GetExplicitlyOverriddenMethods(propMeth)))
PrintPropertyDefinitionVisibility(propertyDefinition);
PrintPropertyDefinitionModifiers(propertyDefinition);
PrintPropertyDefinitionReturnType(propertyDefinition);
PrintToken(VBToken.Space);
if (isIndexer) {
// Indexers are always identified with a 'this' keyword, but might have an interface prefix
string id = propertyDefinition.Name.Value;
int lastDot = id.LastIndexOf('.');
if (lastDot != -1)
sourceEmitterOutput.Write(id.Substring(0, lastDot +1));
PrintToken(VBToken.This);
PrintToken(VBToken.LeftSquareBracket);
bool fFirstParameter = true;
var parms = propertyDefinition.Parameters;
if (propertyDefinition.Getter != null)
parms = propertyDefinition.Getter.ResolvedMethod.Parameters; // more likely to have names
else if (propertyDefinition.Setter != null) {
// Use the setter's names except for the final 'value' parameter
var l = new List<IParameterDefinition>(propertyDefinition.Setter.ResolvedMethod.Parameters);
l.RemoveAt(l.Count - 1);
parms = l;
}
foreach (IParameterDefinition parameterDefinition in parms) {
if (!fFirstParameter)
PrintParameterListDelimiter();
this.Traverse(parameterDefinition);
fFirstParameter = false;
}
PrintToken(VBToken.RightSquareBracket);
} else {
PrintPropertyDefinitionName(propertyDefinition);
}
//PrintToken(CSharpToken.LeftCurly);
if (propertyDefinition.Getter != null) {
PrintToken(VBToken.Indent);
var getMeth = propertyDefinition.Getter.ResolvedMethod;
if (getMeth.Visibility != propertyDefinition.Visibility)
PrintTypeMemberVisibility(getMeth.Visibility);
PrintToken(VBToken.Get);
if (getMeth.IsAbstract || getMeth.IsExternal)
PrintToken(VBToken.Semicolon);
else
Traverse(getMeth.Body);
}
if (propertyDefinition.Setter != null) {
PrintToken(VBToken.Indent);
var setMeth = propertyDefinition.Setter.ResolvedMethod;
if (setMeth.Visibility != propertyDefinition.Visibility)
PrintTypeMemberVisibility(setMeth.Visibility);
PrintToken(VBToken.Set);
if (setMeth.IsAbstract || setMeth.IsExternal)
PrintToken(VBToken.Semicolon);
else
Traverse(setMeth.Body);
}
//PrintToken(CSharpToken.RightCurly);
}
开发者ID:xornand,项目名称:cci,代码行数:83,代码来源:PropertySourceEmitter.cs
注:本文中的IPropertyDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论