コード例 #1
0
 public static Guid? GetIDFrom(IAtomCollection collection, ID4 name)
 {
   var atom = collection.FindByName(name);
   byte[] value = null;
   if (atom != null && atom.TryGetBytes(out value) && value.Length==16) {
     return ByteArrayToID(value);
   }
   else {
     return null;
   }
 }
コード例 #2
0
 public static ushort? GetUShortFrom(IAtomCollection collection, ID4 name)
 {
   var atom = collection.FindByName(name);
   ushort value = 0;
   if (atom != null && atom.TryGetUInt16(out value)) {
     return value;
   }
   else {
     return null;
   }
 }
コード例 #3
0
 public static byte? GetByteFrom(IAtomCollection collection, ID4 name)
 {
   var atom = collection.FindByName(name);
   byte value = 0;
   if (atom != null && atom.TryGetByte(out value)) {
     return value;
   }
   else {
     return null;
   }
 }
コード例 #4
0
 public static int? GetIntFrom(IAtomCollection collection, ID4 name)
 {
   var atom = collection.FindByName(name);
   int value = 0;
   if (atom != null && atom.TryGetInt32(out value)) {
     return value;
   }
   else {
     return null;
   }
 }
コード例 #5
0
        public static IAtomCollection GetCollectionFrom(IAtomCollection collection, ID4 name)
        {
            var atom = collection.FindByName(name);

            if (atom != null && atom.HasChildren)
            {
                return(atom.Children);
            }
            else
            {
                return(null);
            }
        }
コード例 #6
0
        public static byte?GetByteFrom(IAtomCollection collection, ID4 name)
        {
            var  atom  = collection.FindByName(name);
            byte value = 0;

            if (atom != null && atom.TryGetByte(out value))
            {
                return(value);
            }
            else
            {
                return(null);
            }
        }
コード例 #7
0
        public static Guid?GetIDFrom(IAtomCollection collection, ID4 name)
        {
            var atom = collection.FindByName(name);

            byte[] value = null;
            if (atom != null && atom.TryGetBytes(out value) && value.Length == 16)
            {
                return(ByteArrayToID(value));
            }
            else
            {
                return(null);
            }
        }
コード例 #8
0
        public static int?GetIntFrom(IAtomCollection collection, ID4 name)
        {
            var atom  = collection.FindByName(name);
            int value = 0;

            if (atom != null && atom.TryGetInt32(out value))
            {
                return(value);
            }
            else
            {
                return(null);
            }
        }
コード例 #9
0
        public static ushort?GetUShortFrom(IAtomCollection collection, ID4 name)
        {
            var    atom  = collection.FindByName(name);
            ushort value = 0;

            if (atom != null && atom.TryGetUInt16(out value))
            {
                return(value);
            }
            else
            {
                return(null);
            }
        }
コード例 #10
0
        public static IPAddress GetIPAddressFrom(IAtomCollection collection, ID4 name)
        {
            var       atom  = collection.FindByName(name);
            IPAddress value = null;

            if (atom != null && atom.TryGetIPAddress(out value))
            {
                return(value);
            }
            else
            {
                return(null);
            }
        }
コード例 #11
0
        public static string GetStringFrom(IAtomCollection collection, ID4 name)
        {
            string res  = null;
            var    atom = collection.FindByName(name);

            if (atom != null && atom.TryGetString(out res))
            {
                return(res);
            }
            else
            {
                return(null);
            }
        }
コード例 #12
0
        public static ID4?GetID4From(IAtomCollection collection, ID4 name)
        {
            var atom = collection.FindByName(name);

            byte[] value = null;
            if (atom != null && atom.TryGetBytes(out value) && value.Length == 4)
            {
                return(new ID4(value));
            }
            else
            {
                return(null);
            }
        }
コード例 #13
0
 public static IAtomCollection GetCollectionFrom(IAtomCollection collection, ID4 name)
 {
     var atom = collection.FindByName(name);
       if (atom != null && atom.HasChildren) {
     return atom.Children;
       }
       else {
     return null;
       }
 }
コード例 #14
0
 public static Atom GetAtomFrom(IAtomCollection collection, ID4 name)
 {
     return(collection.FindByName(name));
 }
コード例 #15
0
 public static ID4? GetID4From(IAtomCollection collection, ID4 name)
 {
     var atom = collection.FindByName(name);
       byte[] value = null;
       if (atom != null && atom.TryGetBytes(out value) && value.Length==4) {
     return new ID4(value);
       }
       else {
     return null;
       }
 }
コード例 #16
0
 public static Atom GetAtomFrom(IAtomCollection collection, ID4 name)
 {
     return collection.FindByName(name);
 }
コード例 #17
0
 public static string GetStringFrom(IAtomCollection collection, ID4 name)
 {
     string res = null;
       var atom = collection.FindByName(name);
       if (atom != null && atom.TryGetString(out res)) {
     return res;
       }
       else {
     return null;
       }
 }
コード例 #18
0
 public static IPAddress GetIPAddressFrom(IAtomCollection collection, ID4 name)
 {
     var atom = collection.FindByName(name);
       IPAddress value = null;
       if (atom != null && atom.TryGetIPv4Address(out value)) {
     return value;
       }
       else {
     return null;
       }
 }