示例#1
0
 internal void InitializeDefaultValues()
 {
     ComplexType.DataProperties.ForEach(dp => {
         try {
             if (dp.IsComplexProperty)
             {
                 SetDpValue(dp, ComplexAspect.Create(this.ComplexObject, dp));
             }
             else if (dp.DefaultValue != null)
             {
                 SetDpValue(dp, dp.DefaultValue);
             }
         } catch (Exception e) {
             Debug.WriteLine("Exception caught during initialization of {0}.{1}: {2}", this.ComplexObject.GetType().Name, dp.Name, e.Message);
         }
     });
 }