コード例 #1
0
        private void ScanIntegrationServicesExecutableForPropertiesWithNonDefaultValue(DtsObject o, string FriendlyPath)
        {
            if (o == null)
            {
                return;
            }

            if (packageDefault == null)
            {
                packageDefault = new Package();
            }

            DtsObject defaultObject;

            if (o is Package)
            {
                defaultObject = packageDefault;
            }
            else if (o is IDTSName)
            {
                if (dictCachedDtsObjects.ContainsKey(((IDTSName)o).CreationName))
                {
                    defaultObject = dictCachedDtsObjects[((IDTSName)o).CreationName];
                }
                else if (o is DtsEventHandler)
                {
                    defaultObject = (DtsObject)packageDefault.EventHandlers.Add(((IDTSName)o).CreationName);
                    dictCachedDtsObjects.Add(((IDTSName)o).CreationName, defaultObject);
                }
                else if (o is ConnectionManager)
                {
                    defaultObject = (DtsObject)packageDefault.Connections.Add(((IDTSName)o).CreationName);
                    dictCachedDtsObjects.Add(((IDTSName)o).CreationName, defaultObject);
                }
                else
                {
                    defaultObject = packageDefault.Executables.Add(((IDTSName)o).CreationName);
                    dictCachedDtsObjects.Add(((IDTSName)o).CreationName, defaultObject);
                }
            }
            else
            {
                throw new Exception("Object " + o.GetType().FullName + " does not implement IDTSName.");
            }

            PropertyInfo[] properties = o.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
            foreach (PropertyInfo prop in properties)
            {
                if (!prop.CanWrite || !prop.CanRead)
                {
                    continue;
                }

                //SSIS objects don't have a DefaultValueAttribute, which is wy we have to create a new control flow object (defaultObject) above and compare properties from this object to that object

                object[] attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.BrowsableAttribute), true);
                System.ComponentModel.BrowsableAttribute browsableAttr = (System.ComponentModel.BrowsableAttribute)(attrs.Length > 0 ? attrs[0] : null);
                if (browsableAttr != null && !browsableAttr.Browsable)
                {
                    continue;                                                    //don't show attributes marked not browsable
                }
                attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.ReadOnlyAttribute), true);
                System.ComponentModel.ReadOnlyAttribute readOnlyAttr = (System.ComponentModel.ReadOnlyAttribute)(attrs.Length > 0 ? attrs[0] : null);
                if (readOnlyAttr != null && readOnlyAttr.IsReadOnly)
                {
                    continue;                                                  //don't show attributes marked read only
                }
                if (prop.PropertyType.Namespace != "System" && !prop.PropertyType.IsPrimitive && !prop.PropertyType.IsValueType && !prop.PropertyType.IsEnum)
                {
                    continue;
                }
                if (prop.PropertyType == typeof(DateTime))
                {
                    continue;
                }
                if (prop.PropertyType == typeof(string))
                {
                    continue;
                }
                if (prop.Name == "VersionBuild")
                {
                    continue;
                }
                if (prop.Name == "VersionMajor")
                {
                    continue;
                }
                if (prop.Name == "VersionMinor")
                {
                    continue;
                }
                if (prop.Name == "PackageType")
                {
                    continue;
                }

                object value        = prop.GetValue(o, null);
                object defaultValue = prop.GetValue(defaultObject, null);
                if (defaultValue != null && !defaultValue.Equals(value))
                {
                    string sValue = (value == null ? string.Empty : value.ToString());
                    this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath, prop.Name, defaultValue.ToString(), sValue));
                }
            }

            if (o is IDTSObjectHost)
            {
                IDTSObjectHost host = (IDTSObjectHost)o;
                if (host.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)
                {
                    properties = typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe).GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
                }
                else if (host.InnerObject is IDTSConnectionManagerDatabaseParametersXX)
                {
                    properties = typeof(IDTSConnectionManagerDatabaseParametersXX).GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
                }
                else //probably won't turn up any properties because reflection on a COM object Type doesn't work
                {
                    properties = host.InnerObject.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
                }

                foreach (PropertyInfo prop in properties)
                {
                    if (!prop.CanWrite || !prop.CanRead)
                    {
                        continue;
                    }

                    object[] attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.BrowsableAttribute), true);
                    System.ComponentModel.BrowsableAttribute browsableAttr = (System.ComponentModel.BrowsableAttribute)(attrs.Length > 0 ? attrs[0] : null);
                    if (browsableAttr != null && !browsableAttr.Browsable)
                    {
                        continue;                                                    //don't show attributes marked not browsable
                    }
                    attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.ReadOnlyAttribute), true);
                    System.ComponentModel.ReadOnlyAttribute readOnlyAttr = (System.ComponentModel.ReadOnlyAttribute)(attrs.Length > 0 ? attrs[0] : null);
                    if (readOnlyAttr != null && readOnlyAttr.IsReadOnly)
                    {
                        continue;                                                  //don't show attributes marked read only
                    }
                    if (prop.PropertyType.Namespace != "System" && !prop.PropertyType.IsPrimitive && !prop.PropertyType.IsValueType && !prop.PropertyType.IsEnum)
                    {
                        continue;
                    }
                    if (prop.PropertyType == typeof(DateTime))
                    {
                        continue;
                    }
                    if (prop.PropertyType == typeof(string))
                    {
                        continue;
                    }
                    if (prop.Name == "VersionBuild")
                    {
                        continue;
                    }
                    if (prop.Name == "VersionMajor")
                    {
                        continue;
                    }
                    if (prop.Name == "VersionMinor")
                    {
                        continue;
                    }
                    if (prop.Name == "PackageType")
                    {
                        continue;
                    }
                    if (prop.Name.StartsWith("IDTS"))
                    {
                        continue;
                    }

                    object value;
                    object defaultValue;
                    if (host.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)
                    {
                        try
                        {
                            value = host.InnerObject.GetType().InvokeMember(prop.Name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.Instance, null, host.InnerObject, null);
                        }
                        catch
                        {
                            continue;
                        }
                        try
                        {
                            defaultValue = ((IDTSObjectHost)defaultObject).InnerObject.GetType().InvokeMember(prop.Name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.Instance, null, ((IDTSObjectHost)defaultObject).InnerObject, null);
                        }
                        catch
                        {
                            defaultValue = null;
                        }
                    }
                    else
                    {
                        value        = prop.GetValue(host.InnerObject, null);
                        defaultValue = prop.GetValue(((IDTSObjectHost)defaultObject).InnerObject, null);
                    }
                    if (defaultValue != null && !defaultValue.Equals(value))
                    {
                        string sValue = (value == null ? string.Empty : value.ToString());
                        this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath, prop.Name, defaultValue.ToString(), sValue));
                    }
                }

                //scan data flow transforms
                if (host.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)
                {
                    Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe pipe        = (Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)host.InnerObject;
                    Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe defaultPipe = (Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)((IDTSObjectHost)defaultObject).InnerObject;
                    foreach (IDTSComponentMetaDataXX transform in pipe.ComponentMetaDataCollection)
                    {
                        IDTSComponentMetaDataXX defaultTransform = defaultPipe.ComponentMetaDataCollection.New();
                        defaultTransform.ComponentClassID = transform.ComponentClassID;
                        CManagedComponentWrapper defaultInst = defaultTransform.Instantiate();
                        try
                        {
                            defaultInst.ProvideComponentProperties();
                        }
                        catch
                        {
                            continue; //if there's a corrupt package (or if you don't have the component installed on your laptop?) then this might fail... so just move on
                        }

                        if (!transform.ValidateExternalMetadata) //this property isn't in the CustomPropertyCollection, so we have to check it manually
                        {
                            this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name, "ValidateExternalMetadata", "True", "False"));
                        }
                        foreach (IDTSOutputXX output in transform.OutputCollection) //check for error row dispositions
                        {
                            if (output.ErrorRowDisposition == DTSRowDisposition.RD_IgnoreFailure)
                            {
                                this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name + "\\" + output.Name, "ErrorRowDisposition", "FailComponent", "IgnoreFailure"));
                            }
                            if (output.TruncationRowDisposition == DTSRowDisposition.RD_IgnoreFailure)
                            {
                                this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name + "\\" + output.Name, "TruncationRowDisposition", "FailComponent", "IgnoreFailure"));
                            }
                        }

                        Microsoft.DataTransformationServices.Design.PipelinePropertiesWrapper propWrapper = new Microsoft.DataTransformationServices.Design.PipelinePropertiesWrapper(transform, transform, 0);

                        foreach (IDTSCustomPropertyXX prop in transform.CustomPropertyCollection)
                        {
                            System.ComponentModel.PropertyDescriptor propDesc = (System.ComponentModel.PropertyDescriptor)propWrapper.GetType().InvokeMember("CreateCustomPropertyPropertyDescriptor", BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.Instance, null, propWrapper, new object[] { prop });
                            if (propDesc == null)
                            {
                                continue;
                            }
                            if (propDesc.IsReadOnly)
                            {
                                continue;
                            }
                            if (!propDesc.IsBrowsable)
                            {
                                continue;
                            }
                            if (prop.Value is string)
                            {
                                continue;
                            }
                            if (prop.Value is DateTime)
                            {
                                continue;
                            }
                            IDTSCustomPropertyXX defaultProp;
                            try
                            {
                                defaultProp = defaultTransform.CustomPropertyCollection[prop.Name];
                            }
                            catch
                            {
                                if (prop.Name == "PreCompile" && bool.Equals(prop.Value, false)) //this property doesn't show up in the new script component we created to determine defaults, so we have to check it manually
                                {
                                    this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name, prop.Name, "True", "False"));
                                }
                                continue;
                            }

                            System.ComponentModel.ITypeDescriptorContext context = new PipelinePropertyContext(transform, propDesc);
                            string sValue        = propDesc.Converter.ConvertToString(context, prop.Value);        //gets nice text descriptions for enums on component properties
                            string sDefaultValue = propDesc.Converter.ConvertToString(context, defaultProp.Value); //gets nice text descriptions for enums on component properties
                            if (sValue == sDefaultValue)
                            {
                                continue;
                            }

                            this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name, prop.Name, sDefaultValue, sValue));
                        }

                        defaultPipe.ComponentMetaDataCollection.RemoveObjectByID(defaultTransform.ID);
                    }
                }
            }
        }
コード例 #2
0
        private object LocatePropertyValue(object project, DtsObject dtsObject, string propertyPath, PropertyOperation operation, object value)
        {
            propertyPath = propertyPath.Replace("\\", ".");
            object returnValue  = null;
            string firstPart    = propertyPath;
            string restOfString = string.Empty;

            if (propertyPath.Contains("."))
            {
                // Can have periods in object names (like connection manager names)
                // Need to verify that period is not between an index marker
                int delimiterIndex = propertyPath.IndexOf(".", StringComparison.Ordinal);

                if (delimiterIndex > propertyPath.IndexOf("[", StringComparison.Ordinal) &&
                    delimiterIndex < propertyPath.IndexOf("]", StringComparison.Ordinal))
                {
                    delimiterIndex = propertyPath.IndexOf(".", propertyPath.IndexOf("]", StringComparison.Ordinal), StringComparison.Ordinal);
                }

                if (delimiterIndex > -1)
                {
                    firstPart    = propertyPath.Substring(0, delimiterIndex);
                    restOfString = propertyPath.Substring(delimiterIndex + 1, propertyPath.Length - (delimiterIndex + 1));
                    if (firstPart.Length == 0)
                    {
                        return(LocatePropertyValue(project, dtsObject, restOfString, operation, value));
                    }
                }
            }

            //\Project\ConnectionManagers[localhost.AdventureWorks2012.conmgr].Properties[ConnectionString]
            //\Project\Properties[ProtectionLevel]
            if (firstPart.ToUpper().StartsWith("PROJECT"))
            {
                if (!(project is Project))
                {
                    throw new ArgumentException("The initial object must be of type Project.", "project");
                }
                return(LocatePropertyValue(project, (DtsObject)project, restOfString, operation, value));
            }

            //\Project\ConnectionManagers[localhost.AdventureWorks2012.conmgr].Properties[ConnectionString]
            if (firstPart.ToUpper().StartsWith("CONNECTIONMANAGERS"))
            {
                string            connIndex = GetSubStringBetween(firstPart, "[", "]");
                ConnectionManager cm        = (((Project)project).ConnectionManagerItems[connIndex]).ConnectionManager;
                return(LocatePropertyValue(project, cm, restOfString, operation, value));
            }

            if (firstPart.ToUpper().StartsWith("PACKAGE"))
            {
                if (!(dtsObject is Package))
                {
                    throw new ArgumentException("The initial object must be of type Package.", "dtsObject");
                }
                return(LocatePropertyValue(project, dtsObject, restOfString, operation, value));
            }

            if (firstPart.ToUpper().StartsWith("VARIABLES"))
            {
                if (!(dtsObject is DtsContainer))
                {
                    throw new ArgumentException("Object must be of type DtsContainer to reference variables.", "dtsObject");
                }
                Variables vars    = null;
                string    varName = GetSubStringBetween(firstPart, "[", "]");

                DtsContainer cont = (DtsContainer)dtsObject;
                cont.VariableDispenser.LockOneForRead(varName, ref vars);
                returnValue = LocatePropertyValue(project, vars[varName], restOfString, operation, value);
                vars.Unlock();
                return(returnValue);
            }

            // \Package.Properties[CreationDate]
            if (firstPart.ToUpper().StartsWith("PROPERTIES"))
            {
                string propIndex = GetSubStringBetween(firstPart, "[", "]");

                if (!(dtsObject is IDTSPropertiesProvider))
                {
                    if (!(dtsObject is Project))
                    {
                        throw new ArgumentException("Object must be of type Project or IDTSPropertiesProvider to reference properties.", "dtsObject");
                    }
                    else
                    {
                        if (operation == PropertyOperation.Set)
                        {
                            dtsObject.GetType().GetProperty(propIndex).SetValue(dtsObject, Convert.ChangeType(value, dtsObject.GetType()));
                        }
                        return(dtsObject.GetType().GetProperty(propIndex).GetValue(dtsObject, null));
                    }
                }
                IDTSPropertiesProvider propProv = (IDTSPropertiesProvider)dtsObject;

                DtsProperty prop = propProv.Properties[propIndex];

                if (operation == PropertyOperation.Set)
                {
                    if (dtsObject is Variable)
                    {
                        Variable var = (Variable)dtsObject;
                        prop.SetValue(dtsObject, Convert.ChangeType(value, var.DataType));
                    }
                    else
                    {
                        prop.SetValue(dtsObject, Convert.ChangeType(value, propProv.Properties[propIndex].Type));
                    }
                }
                return(prop.GetValue(dtsObject));
            }

            // \Package.Connections[localhost.AdventureWorksDW2008].Properties[Description]
            if (firstPart.ToUpper().StartsWith("CONNECTIONS"))
            {
                if (!(dtsObject is Package))
                {
                    throw new ArgumentException("Object must be of type Package to reference Connections.", "dtsObject");
                }
                string  connIndex = GetSubStringBetween(firstPart, "[", "]");
                Package pkg       = (Package)dtsObject;
                return(LocatePropertyValue(project, pkg.Connections[connIndex], restOfString, operation, value));
            }

            // \Package.EventHandlers[OnError].Properties[Description]
            if (firstPart.ToUpper().StartsWith("EVENTHANDLERS"))
            {
                if (!(dtsObject is EventsProvider))
                {
                    throw new ArgumentException("Object must be of type EventsProvider to reference events.", "dtsObject");
                }
                EventsProvider eventProvider = (EventsProvider)dtsObject;
                string         eventIndex    = GetSubStringBetween(firstPart, "[", "]");
                return(LocatePropertyValue(project, eventProvider.EventHandlers[eventIndex], restOfString, operation, value));
            }

            // First Part of string is not one of the hard-coded values - it's either a task or container
            if (!(dtsObject is IDTSSequence))
            {
                throw new ArgumentException("Object must be of type IDTSSequence to reference other tasks or containers.", "dtsObject");
            }

            IDTSSequence seq = (IDTSSequence)dtsObject;

            if (seq.Executables.Contains(firstPart))
            {
                return(LocatePropertyValue(project, seq.Executables[firstPart], restOfString, operation, value));
            }

            // \Package\Sequence Container\Script Task.Properties[Description]
            // \Package\Sequence Container.Properties[Description]
            // \Package\Execute SQL Task.Properties[Description]
            // \Package.EventHandlers[OnError].Variables[System::Cancel].Properties[Value]
            // \Package.EventHandlers[OnError]\Script Task.Properties[Description]
            if (restOfString.Length > 0)
            {
                returnValue = LocatePropertyValue(project, dtsObject, restOfString, operation, value);
            }

            return(returnValue);
        }
コード例 #3
0
        private void ScanIntegrationServicesExecutableForPropertiesWithNonDefaultValue(DtsObject o, string FriendlyPath)
        {
            if (o == null) return;

            if (packageDefault == null)
            {
                packageDefault = new Package();
            }

            DtsObject defaultObject;
            if (o is Package)
            {
                defaultObject = packageDefault;
            }
            else if (o is IDTSName)
            {
                if (dictCachedDtsObjects.ContainsKey(((IDTSName)o).CreationName))
                {
                    defaultObject = dictCachedDtsObjects[((IDTSName)o).CreationName];
                }
                else if (o is DtsEventHandler)
                {
                    defaultObject = (DtsObject)packageDefault.EventHandlers.Add(((IDTSName)o).CreationName);
                    dictCachedDtsObjects.Add(((IDTSName)o).CreationName, defaultObject);
                }
                else if (o is ConnectionManager)
                {
                    defaultObject = (DtsObject)packageDefault.Connections.Add(((IDTSName)o).CreationName);
                    dictCachedDtsObjects.Add(((IDTSName)o).CreationName, defaultObject);
                }
                else
                {
                    defaultObject = packageDefault.Executables.Add(((IDTSName)o).CreationName);
                    dictCachedDtsObjects.Add(((IDTSName)o).CreationName, defaultObject);
                }
            }
            else
            {
                throw new Exception("Object " + o.GetType().FullName + " does not implement IDTSName.");
            }

            PropertyInfo[] properties = o.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
            foreach (PropertyInfo prop in properties)
            {
                if (!prop.CanWrite || !prop.CanRead) continue;

                //SSIS objects don't have a DefaultValueAttribute, which is wy we have to create a new control flow object (defaultObject) above and compare properties from this object to that object

                object[] attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.BrowsableAttribute), true);
                System.ComponentModel.BrowsableAttribute browsableAttr = (System.ComponentModel.BrowsableAttribute)(attrs.Length > 0 ? attrs[0] : null);
                if (browsableAttr != null && !browsableAttr.Browsable) continue; //don't show attributes marked not browsable

                attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.ReadOnlyAttribute), true);
                System.ComponentModel.ReadOnlyAttribute readOnlyAttr = (System.ComponentModel.ReadOnlyAttribute)(attrs.Length > 0 ? attrs[0] : null);
                if (readOnlyAttr != null && readOnlyAttr.IsReadOnly) continue; //don't show attributes marked read only

                if (prop.PropertyType.Namespace != "System" && !prop.PropertyType.IsPrimitive && !prop.PropertyType.IsValueType && !prop.PropertyType.IsEnum) continue;
                if (prop.PropertyType == typeof(DateTime)) continue;
                if (prop.PropertyType == typeof(string)) continue;
                if (prop.Name == "VersionBuild") continue;
                if (prop.Name == "VersionMajor") continue;
                if (prop.Name == "VersionMinor") continue;
                if (prop.Name == "PackageType") continue;

                object value = prop.GetValue(o, null);
                object defaultValue = prop.GetValue(defaultObject, null);
                if (defaultValue != null && !defaultValue.Equals(value))
                {
                    string sValue = (value == null ? string.Empty : value.ToString());
                    this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath, prop.Name, defaultValue.ToString(), sValue));
                }
            }

            if (o is IDTSObjectHost)
            {
                IDTSObjectHost host = (IDTSObjectHost)o;
                if (host.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)
                    properties = typeof(Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipeClass).GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
                else if (host.InnerObject is IDTSConnectionManagerDatabaseParametersXX)
                    properties = typeof(IDTSConnectionManagerDatabaseParametersXX).GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);
                else //probably won't turn up any properties because reflection on a COM object Type doesn't work
                    properties = host.InnerObject.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance);

                foreach (PropertyInfo prop in properties)
                {
                    if (!prop.CanWrite || !prop.CanRead) continue;

                    object[] attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.BrowsableAttribute), true);
                    System.ComponentModel.BrowsableAttribute browsableAttr = (System.ComponentModel.BrowsableAttribute)(attrs.Length > 0 ? attrs[0] : null);
                    if (browsableAttr != null && !browsableAttr.Browsable) continue; //don't show attributes marked not browsable

                    attrs = prop.GetCustomAttributes(typeof(System.ComponentModel.ReadOnlyAttribute), true);
                    System.ComponentModel.ReadOnlyAttribute readOnlyAttr = (System.ComponentModel.ReadOnlyAttribute)(attrs.Length > 0 ? attrs[0] : null);
                    if (readOnlyAttr != null && readOnlyAttr.IsReadOnly) continue; //don't show attributes marked read only

                    if (prop.PropertyType.Namespace != "System" && !prop.PropertyType.IsPrimitive && !prop.PropertyType.IsValueType && !prop.PropertyType.IsEnum) continue;
                    if (prop.PropertyType == typeof(DateTime)) continue;
                    if (prop.PropertyType == typeof(string)) continue;
                    if (prop.Name == "VersionBuild") continue;
                    if (prop.Name == "VersionMajor") continue;
                    if (prop.Name == "VersionMinor") continue;
                    if (prop.Name == "PackageType") continue;
                    if (prop.Name.StartsWith("IDTS")) continue;

                    object value;
                    object defaultValue;
                    if (host.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)
                    {
                        try
                        {
                            value = host.InnerObject.GetType().InvokeMember(prop.Name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.Instance, null, host.InnerObject, null);
                        }
                        catch
                        {
                            continue;
                        }
                        try
                        {
                            defaultValue = ((IDTSObjectHost)defaultObject).InnerObject.GetType().InvokeMember(prop.Name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.Instance, null, ((IDTSObjectHost)defaultObject).InnerObject, null);
                        }
                        catch
                        {
                            defaultValue = null;
                        }
                    }
                    else
                    {
                        value = prop.GetValue(host.InnerObject, null);
                        defaultValue = prop.GetValue(((IDTSObjectHost)defaultObject).InnerObject, null);
                    }
                    if (defaultValue != null && !defaultValue.Equals(value))
                    {
                        string sValue = (value == null ? string.Empty : value.ToString());
                        this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath, prop.Name, defaultValue.ToString(), sValue));
                    }
                }

                //scan data flow transforms
                if (host.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)
                {
                    Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe pipe = (Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)host.InnerObject;
                    Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe defaultPipe = (Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)((IDTSObjectHost)defaultObject).InnerObject;
                    foreach (IDTSComponentMetaDataXX transform in pipe.ComponentMetaDataCollection)
                    {
                        IDTSComponentMetaDataXX defaultTransform = defaultPipe.ComponentMetaDataCollection.New();
                        defaultTransform.ComponentClassID = transform.ComponentClassID;
                        CManagedComponentWrapper defaultInst = defaultTransform.Instantiate();
                        try
                        {
                            defaultInst.ProvideComponentProperties();
                        }
                        catch
                        {
                            continue; //if there's a corrupt package (or if you don't have the component installed on your laptop?) then this might fail... so just move on
                        }

                        if (!transform.ValidateExternalMetadata) //this property isn't in the CustomPropertyCollection, so we have to check it manually
                        {
                            this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name, "ValidateExternalMetadata", "True", "False"));
                        }
                        foreach (IDTSOutputXX output in transform.OutputCollection) //check for error row dispositions
                        {
                            if (output.ErrorRowDisposition == DTSRowDisposition.RD_IgnoreFailure)
                            {
                                this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name + "\\" + output.Name, "ErrorRowDisposition", "FailComponent", "IgnoreFailure"));
                            }
                            if (output.TruncationRowDisposition == DTSRowDisposition.RD_IgnoreFailure)
                            {
                                this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name + "\\" + output.Name, "TruncationRowDisposition", "FailComponent", "IgnoreFailure"));
                            }
                        }

                        Microsoft.DataTransformationServices.Design.PipelinePropertiesWrapper propWrapper = new Microsoft.DataTransformationServices.Design.PipelinePropertiesWrapper(transform, transform, 0);

                        foreach (IDTSCustomPropertyXX prop in transform.CustomPropertyCollection)
                        {
                            System.ComponentModel.PropertyDescriptor propDesc = (System.ComponentModel.PropertyDescriptor)propWrapper.GetType().InvokeMember("CreateCustomPropertyPropertyDescriptor", BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.InvokeMethod | BindingFlags.Instance, null, propWrapper, new object[] { prop });
                            if (propDesc == null) continue;
                            if (propDesc.IsReadOnly) continue;
                            if (!propDesc.IsBrowsable) continue;
                            if (prop.Value is string) continue;
                            if (prop.Value is DateTime) continue;
                            IDTSCustomPropertyXX defaultProp;
                            try
                            {
                                defaultProp = defaultTransform.CustomPropertyCollection[prop.Name];
                            }
                            catch
                            {
                                if (prop.Name == "PreCompile" && bool.Equals(prop.Value, false)) //this property doesn't show up in the new script component we created to determine defaults, so we have to check it manually
                                {
                                    this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name, prop.Name, "True", "False"));
                                }
                                continue;
                            }

                            System.ComponentModel.ITypeDescriptorContext context = new PipelinePropertyContext(transform, propDesc);
                            string sValue = propDesc.Converter.ConvertToString(context, prop.Value); //gets nice text descriptions for enums on component properties
                            string sDefaultValue = propDesc.Converter.ConvertToString(context, defaultProp.Value); //gets nice text descriptions for enums on component properties
                            if (sValue == sDefaultValue) continue;

                            this.listNonDefaultProperties.Add(new NonDefaultProperty(this.DatabaseName, FriendlyPath + "\\" + transform.Name, prop.Name, sDefaultValue, sValue));
                        }

                        defaultPipe.ComponentMetaDataCollection.RemoveObjectByID(defaultTransform.ID);
                    }
                }
            }
        }