示例#1
0
        /// <summary>
        /// Adds the custom property that contains the GUID
        /// </summary>
        /// <param name="guid">GUID</param>
        /// <param name="propCollection">custom property collection of the input column</param>
        private static void AddIdProperty(string guid, IDTSCustomPropertyCollection100 propCollection)
        {
            IDTSCustomProperty100 prop = propCollection.New();

            prop.Name  = IdPropertyName;
            prop.Value = guid;
        }
示例#2
0
        /// <summary>
        /// Adds the custom property that contains the GUID
        /// </summary>
        /// <param name="guid">GUID</param>
        /// <param name="propCollection">custom property collection of the input column</param>
        /// <param name="propType">property type</param>
        private static void AddIdProperty(string guid, IDTSCustomPropertyCollection100 propCollection, PropertyType propType)
        {
            IDTSCustomProperty100 prop = propCollection.New();

            prop.Name  = IdPorpertyNameList[(int)propType];
            prop.Value = guid;
        }
示例#3
0
        /// <summary>
        /// Helper for adding a custom property to the provided collection
        /// </summary>
        /// <param name="customPropertyCollection"></param>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <returns></returns>
        private IDTSCustomProperty100 createCustomProperty(IDTSCustomPropertyCollection100 customPropertyCollection, string name, string description, dynamic defaultValue = null)
        {
            IDTSCustomProperty100 customProperty = customPropertyCollection.New();

            customProperty.Description    = description;
            customProperty.Name           = name;
            customProperty.Value          = defaultValue;
            customProperty.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;

            return(customProperty);
        }
 public static void AddRange(this IDTSCustomPropertyCollection100 collection, IEnumerable <CustomProperty> properties)
 {
     foreach (var customProperty in properties)
     {
         var prop = collection.New();
         prop.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;
         prop.Name           = customProperty.Name;
         prop.Description    = customProperty.Description;
         prop.Value          = customProperty.Value;
     }
 }
 static protected void AddProperty(IDTSCustomPropertyCollection100 propertyCollection, string name, string description, object value, string uiTypeEditor)
 {
     IDTSCustomProperty100 property = propertyCollection.New();
     property.Name = name;
     property.Description = description;
     property.Value = value;
     if (!string.IsNullOrEmpty(uiTypeEditor))
     {
         property.UITypeEditor = uiTypeEditor;
     }
 }
示例#6
0
        static protected void AddProperty(IDTSCustomPropertyCollection100 propertyCollection, string name, string description, object value, string uiTypeEditor)
        {
            IDTSCustomProperty100 property = propertyCollection.New();

            property.Name        = name;
            property.Description = description;
            property.Value       = value;
            if (!string.IsNullOrEmpty(uiTypeEditor))
            {
                property.UITypeEditor = uiTypeEditor;
            }
        }
 private static void AddCustomProperty(IDTSCustomPropertyCollection100 propertyCollection, string name, string description, object value, string typeConverter)
 {
     IDTSCustomProperty100 property = propertyCollection.New();
     property.Name = name;
     property.Description = description;
     property.Value = value;
     property.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;
     if (value is string)
     {
         property.State = DTSPersistState.PS_PERSISTASHEX;
     }
     if (!string.IsNullOrEmpty(typeConverter))
     {
         property.TypeConverter = typeConverter;
     }
 }
        /// <summary>
        ///  Adds a custom property to a CustomPropertyCollection and sets the value
        ///  (has no effect if custom property already exists)
        /// </summary>
        /// <param name="propCollection">the CustomPropertyCollection</param>
        /// <param name="value">the value of the custom property</param>
        /// <param name="propertyName">the name of the custom property</param>
        private void AddCustomProperty(IDTSCustomPropertyCollection100 propCollection, string value, string propertyName)
        {
            IDTSCustomProperty100 prop = null;

            try
            {
                //do nothing if custom property exists:
                prop = propCollection[propertyName];
            }
            catch (Exception)
            {
                prop       = propCollection.New();
                prop.Name  = propertyName;
                prop.Value = value;
            }
        }
        private static void AddCustomProperty(IDTSCustomPropertyCollection100 propertyCollection, string name, string description, object value, string typeConverter)
        {
            IDTSCustomProperty100 property = propertyCollection.New();

            property.Name           = name;
            property.Description    = description;
            property.Value          = value;
            property.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;
            if (value is string)
            {
                property.State = DTSPersistState.PS_PERSISTASHEX;
            }
            if (!string.IsNullOrEmpty(typeConverter))
            {
                property.TypeConverter = typeConverter;
            }
        }
        private static void AddCustomProperty(IDTSCustomPropertyCollection100 propertyCollection, string name, string description, object defaultValue, string typeConverter, Boolean valueContainsID)
        {
            IDTSCustomProperty100 property = propertyCollection.New();

            property.Name           = name;
            property.Description    = description;
            property.Value          = defaultValue;
            property.ExpressionType = DTSCustomPropertyExpressionType.CPET_NONE; // Don't make this Notify as it causes MAJOR performance issues. (and why would you want them to be expressioned anyway)?
            property.ContainsID     = valueContainsID;
            if (defaultValue is string)
            {
                property.State = DTSPersistState.PS_PERSISTASHEX;
            }
            if (!string.IsNullOrEmpty(typeConverter))
            {
                property.TypeConverter = typeConverter;
            }
        }
示例#11
0
        public static void AddProperty(IDTSCustomPropertyCollection100 propertyCollection, string name, string description, object defaultValue, string typeConverter, bool supportsExpression)
        {
            foreach (IDTSCustomProperty100 existingProperty in propertyCollection)
            {
                if (existingProperty.Name == name)
                {
                    return;
                }
            }

            var property = propertyCollection.New();

            property.Name          = name;
            property.Description   = description;
            property.TypeConverter = typeConverter;
            property.Value         = defaultValue;
            if (supportsExpression)
            {
                property.ExpressionType = DTSCustomPropertyExpressionType.CPET_NOTIFY;
            }
        }
示例#12
0
        /// <summary>
        /// Helper for adding a custom property to the provided collection
        /// </summary>
        /// <param name="customPropertyCollection"></param>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <returns></returns>
        private IDTSCustomProperty100 createCustomProperty(IDTSCustomPropertyCollection100 customPropertyCollection, string name, string description, dynamic defaultValue = null)
        {
            IDTSCustomProperty100 customProperty = customPropertyCollection.New();
            customProperty.Description = description;
            customProperty.Name = name;
            customProperty.Value = defaultValue;

            return customProperty;
        }
示例#13
0
        private IDTSCustomProperty100 createCustomProperty(IDTSCustomPropertyCollection100 customPropertyCollection, string name, string description)
        {
            IDTSCustomProperty100 customProperty = customPropertyCollection.New();
            customProperty.Description = description;
            customProperty.Name = name;

            return customProperty;
        }