Beispiel #1
0
 public static void CheckFileNameArgument(string fileName)
 {
     CheckStringArgument(fileName, "fileName");
     if (!File.Exists(fileName))
     {
         throw new ArgumentException(MessageStrings.FileDoesNotExist(fileName));
     }
 }
 private DTSValidationStatus ValidateUsageOfColumnProperty(string propertyName, object propertyValue)
 {
     if (Enum.IsDefined(typeof(Utilities.usageOfColumnEnum), propertyValue))
     {
         return(DTSValidationStatus.VS_ISVALID);
     }
     else
     {
         this.PostError(MessageStrings.InvalidPropertyValue(propertyName, propertyValue));
         return(DTSValidationStatus.VS_ISCORRUPT);
     }
 }
 private DTSValidationStatus ValidatePropertyExists(IDTSCustomPropertyCollection100 customPropertyCollection, string propertyName, DTSValidationStatus oldStatus)
 {
     foreach (IDTSCustomProperty100 property in customPropertyCollection)
     {
         if (property.Name == propertyName)
         {
             return(Utilities.CompareValidationValues(oldStatus, DTSValidationStatus.VS_ISVALID));
         }
     }
     this.PostError(MessageStrings.MissingProperty(propertyName));
     return(Utilities.CompareValidationValues(oldStatus, DTSValidationStatus.VS_ISCORRUPT));
 }
 private DTSValidationStatus ValidateStringProperty(string propertyName, object propertyValue)
 {
     if (propertyValue is string)
     {
         return(DTSValidationStatus.VS_ISVALID);
     }
     else
     {
         this.PostError(MessageStrings.InvalidPropertyValue(propertyName, propertyValue));
         return(DTSValidationStatus.VS_ISCORRUPT);
     }
 }
 private DTSValidationStatus ValidateRowTypeProperty(string propertyName, object propertyValue)
 {
     if (propertyValue is string)
     {
         string value = (string)propertyValue;
         if (value.Length <= MaxRowTypeLength)
         {
             return(DTSValidationStatus.VS_ISVALID);
         }
         else
         {
             this.PostError(MessageStrings.PropertyStringTooLong(propertyName, propertyValue.ToString()));
             return(DTSValidationStatus.VS_ISBROKEN);
         }
     }
     else
     {
         this.PostError(MessageStrings.InvalidPropertyValue(propertyName, propertyValue));
         return(DTSValidationStatus.VS_ISCORRUPT);
     }
 }