コード例 #1
0
 internal static void SetRecordField(Record record, object fieldValue, int index) {
     if (fieldValue == null) {
         record.set_StringData(index+1, "");
     } else if (fieldValue is int) {
         record.set_IntegerData(index+1, (int) fieldValue);
     } else if (fieldValue is string) {
         record.set_StringData(index+1, (string) fieldValue);
     } else if (fieldValue is InstallerStream) {
         record.SetStream(index+1, ((InstallerStream) fieldValue).FilePath);
     } else {
         throw new ApplicationException("Unhandled type: " + fieldValue.GetType());
     }
 }
コード例 #2
0
 internal static void SetRecordField(Record record, object fieldValue, int index)
 {
     if (fieldValue == null)
     {
         record.set_StringData(index + 1, "");
     }
     else if (fieldValue is int)
     {
         record.set_IntegerData(index + 1, (int)fieldValue);
     }
     else if (fieldValue is string)
     {
         record.set_StringData(index + 1, (string)fieldValue);
     }
     else if (fieldValue is InstallerStream)
     {
         record.SetStream(index + 1, ((InstallerStream)fieldValue).FilePath);
     }
     else
     {
         throw new ApplicationException("Unhandled type: " + fieldValue.GetType());
     }
 }