Пример #1
0
 public static DateTimeResources Deserialise(TlvReader reader)
 {
     DateTimeResources result = null;
     if (reader.TlvRecord == null)
         reader.Read();
     if (reader.TlvRecord != null)
     {
         if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.MultipleResources)
         {
             result = new DateTimeResources(reader.TlvRecord.Identifier.ToString());
             if (reader.TlvRecord.Value != null)
             {
                 using (TlvReader childReader = new TlvReader(reader.TlvRecord.Value))
                 {
                     while (childReader.Read())
                     {
                         if (childReader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ResourceInstance)
                         {
                             DateTimeResource childResource = new DateTimeResource(childReader.TlvRecord.Identifier.ToString());
                             childResource.Value = childReader.TlvRecord.ValueAsDateTime();
                             result.Add(childResource);
                         }
                     }
                 }
             }
         }
     }
     return result;
 }
Пример #2
0
        public static DateTimeResources Deserialise(TlvReader reader)
        {
            DateTimeResources result = null;

            if (reader.TlvRecord == null)
            {
                reader.Read();
            }
            if (reader.TlvRecord != null)
            {
                if (reader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.MultipleResources)
                {
                    result = new DateTimeResources(reader.TlvRecord.Identifier.ToString());
                    if (reader.TlvRecord.Value != null)
                    {
                        using (TlvReader childReader = new TlvReader(reader.TlvRecord.Value))
                        {
                            while (childReader.Read())
                            {
                                if (childReader.TlvRecord.TypeIdentifier == TTlvTypeIdentifier.ResourceInstance)
                                {
                                    DateTimeResource childResource = new DateTimeResource(childReader.TlvRecord.Identifier.ToString());
                                    childResource.Value = childReader.TlvRecord.ValueAsDateTime();
                                    result.Add(childResource);
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }