/Source/ResourceManagement.Client/WsTransfer/ResourceTimeProperty.cs
C# | 44 lines | 42 code | 2 blank | 0 comment | 2 complexity | 16463ecb9079c9f2962dcabdc87638f2 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Xml.Serialization;
- using System.Text;
-
- namespace Microsoft.ResourceManagement.Client.WsTransfer
- {
- [XmlRoot(ElementName = Constants.Rm.ResourceTimeProperty, Namespace = Constants.Rm.Namespace)]
- public class ResourceTimeProperty
- {
- public ResourceTimeProperty()
- : this(DateTime.Now)
- {
- }
-
- public ResourceTimeProperty(DateTime value)
- {
- this.value = value;
- }
- private DateTime value;
- [XmlText(Type = typeof(String))]
- public String Value
- {
- get
- {
- return this.value.ToString();
- }
- set
- {
- if (value != null)
- {
- try
- {
- this.value = DateTime.Parse(value);
- }
- catch (FormatException)
- {
- throw;
- }
- }
- }
- }
- }
- }