Example #1
0
        protected override void PreFilterProperties(IDictionary properties)
        {
            base.PreFilterProperties(properties);

            if (this.targetWorkflowType != null)
            {
                try
                {
                    foreach (PropertyInfo parameterProperty in this.targetWorkflowType.GetProperties())
                    {
                        if (!parameterProperty.CanWrite)
                        {
                            continue;
                        }

                        if (parameterProperty.DeclaringType == typeof(DependencyObject) ||
                            parameterProperty.DeclaringType == typeof(Activity) ||
                            parameterProperty.DeclaringType == typeof(CompositeActivity) ||
                            ((parameterProperty.DeclaringType == Type.GetType(DesignerHelpers.SequentialWorkflowTypeRef) ||
                              parameterProperty.DeclaringType == Type.GetType(DesignerHelpers.StateMachineWorkflowTypeRef)) &&
                             string.Equals(parameterProperty.Name, "DynamicUpdateCondition", StringComparison.Ordinal)))
                        {
                            continue;
                        }

                        bool ignoreProperty       = false;
                        Type dependencyObjectType = this.targetWorkflowType;
                        while (dependencyObjectType != null && dependencyObjectType is DesignTimeType)
                        {
                            dependencyObjectType = dependencyObjectType.BaseType;
                        }

                        if (dependencyObjectType != null)
                        {
                            foreach (DependencyProperty dependencyProperty in DependencyProperty.FromType(dependencyObjectType))
                            {
                                if (dependencyProperty.Name == parameterProperty.Name && dependencyProperty.DefaultMetadata.IsMetaProperty)
                                {
                                    ignoreProperty = true;
                                    break;
                                }
                            }
                        }

                        if (!ignoreProperty)
                        {
                            PropertyDescriptor prop = new ParameterInfoBasedPropertyDescriptor(Type.GetType(InvokeWorkflowRef), parameterProperty.Name, parameterProperty.PropertyType, ReservedParameterNames.Contains(parameterProperty.Name), DesignOnlyAttribute.Yes);
                            properties[prop.Name] = prop;
                        }
                    }
                }
                catch (MissingMemberException)
                {
                    // targetServiceType has no default CTor, ignore
                }
            }
        }
Example #2
0
 protected override void PreFilterProperties(IDictionary properties)
 {
     base.PreFilterProperties(properties);
     if (this.targetWorkflowType != null)
     {
         try
         {
             foreach (PropertyInfo info in this.targetWorkflowType.GetProperties())
             {
                 if (((!info.CanWrite || (info.DeclaringType == typeof(DependencyObject))) || ((info.DeclaringType == typeof(Activity)) || (info.DeclaringType == typeof(CompositeActivity)))) || (((info.DeclaringType == Type.GetType("System.Workflow.Activities.SequentialWorkflowActivity, System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")) || (info.DeclaringType == Type.GetType("System.Workflow.Activities.StateMachineWorkflowActivity, System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"))) && string.Equals(info.Name, "DynamicUpdateCondition", StringComparison.Ordinal)))
                 {
                     continue;
                 }
                 bool flag = false;
                 Type targetWorkflowType = this.targetWorkflowType;
                 while ((targetWorkflowType != null) && (targetWorkflowType is DesignTimeType))
                 {
                     targetWorkflowType = targetWorkflowType.BaseType;
                 }
                 if (targetWorkflowType != null)
                 {
                     foreach (DependencyProperty property in DependencyProperty.FromType(targetWorkflowType))
                     {
                         if ((property.Name == info.Name) && property.DefaultMetadata.IsMetaProperty)
                         {
                             flag = true;
                             break;
                         }
                     }
                 }
                 if (!flag)
                 {
                     PropertyDescriptor descriptor = new ParameterInfoBasedPropertyDescriptor(Type.GetType("System.Workflow.Activities.InvokeWorkflowActivity, System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"), info.Name, info.PropertyType, ReservedParameterNames.Contains(info.Name), new Attribute[] { DesignOnlyAttribute.Yes });
                     properties[descriptor.Name] = descriptor;
                 }
             }
         }
         catch (MissingMemberException)
         {
         }
     }
 }
 protected override void PreFilterProperties(IDictionary properties)
 {
     base.PreFilterProperties(properties);
     if (this.targetWorkflowType != null)
     {
         try
         {
             foreach (PropertyInfo info in this.targetWorkflowType.GetProperties())
             {
                 if (((!info.CanWrite || (info.DeclaringType == typeof(DependencyObject))) || ((info.DeclaringType == typeof(Activity)) || (info.DeclaringType == typeof(CompositeActivity)))) || (((info.DeclaringType == Type.GetType("System.Workflow.Activities.SequentialWorkflowActivity, System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")) || (info.DeclaringType == Type.GetType("System.Workflow.Activities.StateMachineWorkflowActivity, System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"))) && string.Equals(info.Name, "DynamicUpdateCondition", StringComparison.Ordinal)))
                 {
                     continue;
                 }
                 bool flag = false;
                 Type targetWorkflowType = this.targetWorkflowType;
                 while ((targetWorkflowType != null) && (targetWorkflowType is DesignTimeType))
                 {
                     targetWorkflowType = targetWorkflowType.BaseType;
                 }
                 if (targetWorkflowType != null)
                 {
                     foreach (DependencyProperty property in DependencyProperty.FromType(targetWorkflowType))
                     {
                         if ((property.Name == info.Name) && property.DefaultMetadata.IsMetaProperty)
                         {
                             flag = true;
                             break;
                         }
                     }
                 }
                 if (!flag)
                 {
                     PropertyDescriptor descriptor = new ParameterInfoBasedPropertyDescriptor(Type.GetType("System.Workflow.Activities.InvokeWorkflowActivity, System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"), info.Name, info.PropertyType, ReservedParameterNames.Contains(info.Name), new Attribute[] { DesignOnlyAttribute.Yes });
                     properties[descriptor.Name] = descriptor;
                 }
             }
         }
         catch (MissingMemberException)
         {
         }
     }
 }
        protected override void PreFilterProperties(IDictionary properties)
        {
            base.PreFilterProperties(properties);

            if (this.targetWorkflowType != null)
            {
                try
                {
                    foreach (PropertyInfo parameterProperty in this.targetWorkflowType.GetProperties())
                    {
                        if (!parameterProperty.CanWrite)
                            continue;

                        if (parameterProperty.DeclaringType == typeof(DependencyObject) ||
                            parameterProperty.DeclaringType == typeof(Activity) ||
                            parameterProperty.DeclaringType == typeof(CompositeActivity) ||
                            ((parameterProperty.DeclaringType == Type.GetType(DesignerHelpers.SequentialWorkflowTypeRef) ||
                             parameterProperty.DeclaringType == Type.GetType(DesignerHelpers.StateMachineWorkflowTypeRef)) &&
                             string.Equals(parameterProperty.Name, "DynamicUpdateCondition", StringComparison.Ordinal)))
                            continue;

                        bool ignoreProperty = false;
                        Type dependencyObjectType = this.targetWorkflowType;
                        while (dependencyObjectType != null && dependencyObjectType is DesignTimeType)
                            dependencyObjectType = dependencyObjectType.BaseType;

                        if (dependencyObjectType != null)
                        {
                            foreach (DependencyProperty dependencyProperty in DependencyProperty.FromType(dependencyObjectType))
                            {
                                if (dependencyProperty.Name == parameterProperty.Name && dependencyProperty.DefaultMetadata.IsMetaProperty)
                                {
                                    ignoreProperty = true;
                                    break;
                                }
                            }
                        }

                        if (!ignoreProperty)
                        {
                            PropertyDescriptor prop = new ParameterInfoBasedPropertyDescriptor(Type.GetType(InvokeWorkflowRef), parameterProperty.Name, parameterProperty.PropertyType, ReservedParameterNames.Contains(parameterProperty.Name), DesignOnlyAttribute.Yes);
                            properties[prop.Name] = prop;
                        }
                    }
                }
                catch (MissingMemberException)
                {
                    // targetServiceType has no default CTor, ignore
                }
            }
        }
        internal void GetParameterPropertyDescriptors(IDictionary properties)
        {
            if (properties == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("properties");
            }

            if (((IComponent) this).Site == null)
            {
                return;
            }

            TypedOperationInfo serviceOperationInfo = this.ServiceOperationInfo;
            if (serviceOperationInfo != null)
            {
                MethodInfo methodInfo = serviceOperationInfo.GetMethodInfo(((IComponent) this).Site);
                if (methodInfo != null)
                {
                    ArrayList paramInfo = new ArrayList(methodInfo.GetParameters());
                    if (!(methodInfo.ReturnType == typeof(void)))
                    {
                        paramInfo.Add(methodInfo.ReturnParameter);
                    }

                    foreach (ParameterInfo param in paramInfo)
                    {
                        if (param.ParameterType != null)
                        {
                            PropertyDescriptor prop =
                                new ParameterInfoBasedPropertyDescriptor(typeof(ReceiveActivity),
                                param, true, DesignOnlyAttribute.Yes);

                            properties[prop.Name] = prop;
                        }
                    }
                }
            }
        }