Source

main / Source / Excel / Excel.AddIn / Excel.AddIn / Extensions / MetadataViewModelExtensions.cs

Naethra D ba1cb57 









































using DataUp.Excel.BizLogic;

namespace DataUp.Excel.Addin
{
    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public static class MetadataViewModelExtensions
    {
        public static MetadataViewModel SetValuesFrom(this MetadataViewModel thisObject, MetadataDetail metadata)
        {
            if (thisObject == null)
            {
                thisObject = new MetadataViewModel();
            }

            thisObject.Name = metadata.Name;
            thisObject.Description = metadata.Description;
            thisObject.IsRequired = metadata.IsRequired;
            thisObject.Type = metadata.Type;
            thisObject.Value = metadata.Value;
            thisObject.FieldType = metadata.FieldType;

            return thisObject;
        }

        public static MetadataDetail SetCitationValuesFrom(this MetadataDetail thisObject, MetadataDetail metadata)
        {
            if (thisObject == null)
            {
                thisObject = new MetadataDetail();
            }

            thisObject.Name = metadata.Name;
            thisObject.Description = metadata.Description;
            thisObject.Value = metadata.Value;

            return thisObject;
        }
    }
}