Пример #1
0
 internal virtual int GetSingleCollapsedPropertySize()
 {
     if (PropertyCount() != 1)
     {
         throw new MarshallingException(ToString() + " with cardinality changes cannot handle " + PropertyCount() + " collapsed properties"
                                        );
     }
     else
     {
         BeanProperty property = (BeanProperty) new List <BeanProperty>(this.properties.Values)[0];
         object       value    = property.Get();
         if (value == null)
         {
             return(0);
         }
         else
         {
             if (ListElementUtil.IsCollection(value))
             {
                 return(ListElementUtil.Count(value));
             }
             else
             {
                 return(1);
             }
         }
     }
 }
Пример #2
0
        public void ShouldAddToHl7List()
        {
            Object list = new LISTImpl <ST, String>(typeof(STImpl)).BareValue;

            ListElementUtil.AddElement(list, new STImpl("Betty"));
            Assert.AreEqual(1, ListElementUtil.Count(list), "count");
        }
Пример #3
0
        public virtual BareANY GetHl7Value(int index)
        {
            object list = this.property == null ? null : new DataTypeFieldHelper(property.Bean, property.Name).Get <object>();

            if (this.property.Collection && ListElementUtil.Count(list) < index)
            {
                return((BareANY)ListElementUtil.GetElement(list, index));
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
 internal static bool IsEmpty(object value)
 {
     if (value == null)
     {
         return(true);
     }
     else
     {
         if (ListElementUtil.IsCollection(value))
         {
             return(0 == ListElementUtil.Count(value));
         }
         else
         {
             return(false);
         }
     }
 }