Exemplo n.º 1
0
 /// <summary>
 ///     Sets a value read from an object's metadata XML.
 /// </summary>
 /// <param name="key">
 ///     The key of the property read from XML.
 /// </param>
 /// <param name="value">
 ///     The value of the property read from XML.
 /// </param>
 /// <returns>
 ///     <c>true</c>, if the value was set; otherwise, <c>false</c>.
 /// </returns>
 private void SetValue(string key, string value)
 {
     if (key.Is("size"))
     {
         this.Size = ulong.Parse(value);
     }
     else if (key.Is("duration"))
     {
         this.Duration = ParsingHelper.ParseTimeSpan(value);
     }
     else if (key.Is("bitrate"))
     {
         this.Bitrate = uint.Parse(value);
     }
     else if (key.Is("sampleFrequency"))
     {
         this.SampleFrequency = uint.Parse(value);
     }
     else if (key.Is("bitsPerSample"))
     {
         this.BitsPerSample = uint.Parse(value);
     }
     else if (key.Is("nrAudioChannels"))
     {
         this.NumberOfAudioChannels = uint.Parse(value);
     }
     else if (key.Is("resolution"))
     {
         this.Resolution = ParsingHelper.ParseResolution(value);
     }
     else if (key.Is("colorDepth"))
     {
         this.ColorDepth = uint.Parse(value);
     }
     else if (key.Is("protocolInfo"))
     {
         this.ProtocolInfo = value;
     }
     else if (key.Is("protection"))
     {
         this.Protection = value;
     }
     else if (key.Is("importUri"))
     {
         this.ImportUri = value;
     }
 }