コード例 #1
0
 /// <summary>
 /// test that the attr byte array contains 1 item and the item matches Value.
 /// </summary>
 /// <param name="attrArray"></param>
 /// <param name="Value"></param>
 /// <returns></returns>
 public static bool IsEqual(this DsplyAttr[] attrArray, DsplyAttr Value)
 {
     if (attrArray == null)
     {
         return(false);
     }
     else if (attrArray.Length != 1)
     {
         return(false);
     }
     else
     {
         return(attrArray[0] == Value);
     }
 }
コード例 #2
0
 public static DsplyAttr[] ToDsplyAttr(this XElement Elem, XNamespace Namespace)
 {
     DsplyAttr[] dsplyAttr = null;
     if (Elem != null)
     {
         var cx = Elem.Elements().Count();
         dsplyAttr = new DsplyAttr[cx];
         int ix = 0;
         foreach (var item in Elem.Elements( ))
         {
             var da = item.StringOrDefault().TryParseDsplyAttr().Value;
             dsplyAttr[ix] = da;
             ix           += 1;
         }
     }
     else
     {
         dsplyAttr = new DsplyAttr[0];
     }
     return(dsplyAttr);
 }