public static object GetAnnotationPropertyValue(this AnnotatedElement annotatedElement, string annotationName, string propertyName) { var annot = annotatedElement.Annotations.FirstOrDefault(a => a.Name == annotationName); if (annot != null) { return(annot.GetPropertyValue(propertyName)); } return(null); }
public static bool HasAnnotationProperty(this AnnotatedElement annotatedElement, string annotationName, string propertyName) { var annot = annotatedElement.Annotations.FirstOrDefault(a => a.Name == annotationName); if (annot != null) { return(annot.HasProperty(propertyName)); } return(false); }
public int Compare(AnnotatedElement <T> x, AnnotatedElement <T> y) { int rc = x.Index.CompareTo(y.Index); if (rc != 0) { return(rc); } rc = _ElementComparer.Compare(x.Element, y.Element); if (rc != 0) { return(rc); } rc = x.IsFirst.CompareTo(y.IsFirst); if (rc != 0) { return(rc); } return(x.IsLast.CompareTo(y.IsLast)); }
public override AnnotationProperty AnnotatedElement_SetAnnotationPropertyValue(AnnotatedElement @this, string annotationName, string propertyName, object propertyValue) { if (@this == null) return null; Annotation annot = @this.AddAnnotation(annotationName); return annot.SetPropertyValue(propertyName, propertyValue); }
public override bool AnnotatedElement_HasAnnotationProperty(AnnotatedElement @this, string annotationName, string propertyName) { if (@this == null) return false; Annotation annot = @this.GetAnnotation(annotationName); if (annot != null) { return annot.HasProperty(propertyName); } return false; }
public override bool AnnotatedElement_HasAnnotation(AnnotatedElement @this, string name) { return @this.GetAnnotation(name) != null; }
public override IList<Annotation> AnnotatedElement_GetAnnotations(AnnotatedElement @this, string name) { List<Annotation> result = new List<Soal.Annotation>(); if (@this == null) return result; foreach (var annot in @this.Annotations) { if (annot.Name == name) { result.Add(annot); } } return result; }
public override object AnnotatedElement_GetAnnotationPropertyValue(AnnotatedElement @this, string annotationName, string propertyName) { if (@this == null) return null; Annotation annot = @this.GetAnnotation(annotationName); if (annot != null) { return annot.GetPropertyValue(propertyName); } return null; }
public override Annotation AnnotatedElement_GetAnnotation(AnnotatedElement @this, string name) { return @this.GetAnnotations(name).FirstOrDefault(); }
public override Annotation AnnotatedElement_AddAnnotation(AnnotatedElement @this, string name) { Annotation result = @this.GetAnnotation(name); if (result == null) { result = SoalFactory.Instance.CreateAnnotation(); result.Name = name; @this.Annotations.Add(result); } return result; }
public static Annotation GetAnnotation(this AnnotatedElement annotatedElement, string annotationName) { return(annotatedElement.Annotations.FirstOrDefault(a => a.Name == annotationName)); }
public static bool HasAnnotation(this AnnotatedElement annotatedElement, string annotationName) { return(annotatedElement.Annotations.Any(a => a.Name == annotationName)); }
/// <summary> /// Implements the constructor: AnnotatedElement() /// </summary> public virtual void AnnotatedElement(AnnotatedElement @this) { }