Exemplo n.º 1
0
        public static AttributeValueWrapInt Create(IAttributeContainer container)
        {
            if (container == null)
            {
                return(null);
            }

            var attributeValueWrapInt = new AttributeValueWrapInt();
            var containerType         = container.GetType();

            if (containerType == typeof(Task))
            {
                attributeValueWrapInt.TaskId = container.Id;
            }
            if (containerType == typeof(WorkOrder))
            {
                attributeValueWrapInt.WorkOrderId = container.Id;
            }
            if (containerType == typeof(ServiceOrder))
            {
                attributeValueWrapInt.ServiceOrderId = container.Id;
            }

            return(attributeValueWrapInt);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets the attribute name for the given property.
 /// </summary>
 /// <param name="instance">The instance.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <returns>
 /// The matching attribute name
 /// </returns>
 public static string GetAttributeNameFor(this IAttributeContainer instance, [CallerMemberName] string propertyName = null)
 {
     return(PropertyMaps[instance.GetType()][propertyName]);
 }