Esempio n. 1
0
 internal void GetParameterPropertyDescriptors(IDictionary properties)
 {
     if (this.Site != null)
     {
         ITypeProvider service = (ITypeProvider)this.Site.GetService(typeof(ITypeProvider));
         if (service == null)
         {
             throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ITypeProvider).FullName }));
         }
         Type interfaceType = null;
         if (this.InterfaceType != null)
         {
             interfaceType = service.GetType(this.InterfaceType.AssemblyQualifiedName);
         }
         if ((interfaceType != null) && interfaceType.IsInterface)
         {
             MethodInfo interfaceMethod = System.Workflow.Activities.Common.Helpers.GetInterfaceMethod(interfaceType, this.MethodName);
             if ((interfaceMethod != null) && (WebServiceActivityHelpers.ValidateParameterTypes(interfaceMethod).Count == 0))
             {
                 List <ParameterInfo> list;
                 List <ParameterInfo> list2;
                 WebServiceActivityHelpers.GetParameterInfo(interfaceMethod, out list, out list2);
                 foreach (ParameterInfo info2 in list)
                 {
                     PropertyDescriptor descriptor = new System.Workflow.Activities.Common.ParameterInfoBasedPropertyDescriptor(typeof(WebServiceInputActivity), info2, true, new Attribute[] { DesignOnlyAttribute.Yes });
                     properties[descriptor.Name] = descriptor;
                 }
             }
         }
     }
 }
Esempio n. 2
0
 internal void GetParameterPropertyDescriptors(IDictionary properties)
 {
     if (this.Site != null)
     {
         if (((ITypeProvider)this.Site.GetService(typeof(ITypeProvider))) == null)
         {
             throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ITypeProvider).FullName }));
         }
         if (base.GetType() == typeof(CallExternalMethodActivity))
         {
             Type interfaceType = this.InterfaceType;
             if (interfaceType != null)
             {
                 MethodInfo method = interfaceType.GetMethod(this.MethodName);
                 if (method != null)
                 {
                     ArrayList list = new ArrayList(method.GetParameters());
                     if (!(method.ReturnType == typeof(void)))
                     {
                         list.Add(method.ReturnParameter);
                     }
                     foreach (ParameterInfo info2 in list)
                     {
                         if (info2.ParameterType != null)
                         {
                             PropertyDescriptor descriptor = new System.Workflow.Activities.Common.ParameterInfoBasedPropertyDescriptor(typeof(CallExternalMethodActivity), info2, true, new Attribute[] { DesignOnlyAttribute.Yes });
                             properties[descriptor.Name] = descriptor;
                         }
                     }
                 }
             }
         }
     }
 }
 internal void GetParameterPropertyDescriptors(IDictionary properties)
 {
     if (this.Site != null)
     {
         if (((ITypeProvider)this.Site.GetService(typeof(ITypeProvider))) == null)
         {
             throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ITypeProvider).FullName }));
         }
         Type interfaceType = this.InterfaceType;
         if ((interfaceType != null) && (base.GetType() == typeof(HandleExternalEventActivity)))
         {
             EventInfo eventInfo = interfaceType.GetEvent(this.EventName);
             if (eventInfo != null)
             {
                 Type eventHandlerType = TypeProvider.GetEventHandlerType(eventInfo);
                 if (eventHandlerType != null)
                 {
                     MethodInfo method = eventHandlerType.GetMethod("Invoke");
                     ArrayList  list   = new ArrayList();
                     if (method != null)
                     {
                         list.AddRange(method.GetParameters());
                         if (!(method.ReturnType == typeof(void)))
                         {
                             list.Add(method.ReturnParameter);
                         }
                     }
                     foreach (ParameterInfo info3 in list)
                     {
                         PropertyDescriptor descriptor = new System.Workflow.Activities.Common.ParameterInfoBasedPropertyDescriptor(typeof(HandleExternalEventActivity), info3, true, new Attribute[] { DesignOnlyAttribute.Yes });
                         properties[descriptor.Name] = descriptor;
                     }
                 }
             }
         }
     }
 }
Esempio n. 4
0
        Type IDynamicPropertyTypeProvider.GetPropertyType(IServiceProvider serviceProvider, string propertyName)
        {
            if (propertyName == null)
            {
                throw new ArgumentNullException("propertyName");
            }
            Dictionary <string, object> properties = new Dictionary <string, object>();

            this.GetParameterPropertyDescriptors(properties);
            if (properties.ContainsKey(propertyName))
            {
                System.Workflow.Activities.Common.ParameterInfoBasedPropertyDescriptor descriptor = properties[propertyName] as System.Workflow.Activities.Common.ParameterInfoBasedPropertyDescriptor;
                if (descriptor != null)
                {
                    return(descriptor.ParameterType);
                }
            }
            return(null);
        }
 internal void GetParameterPropertyDescriptors(IDictionary properties)
 {
     if (this.Site != null)
     {
         if (((ITypeProvider) this.Site.GetService(typeof(ITypeProvider))) == null)
         {
             throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ITypeProvider).FullName }));
         }
         if (base.GetType() == typeof(CallExternalMethodActivity))
         {
             Type interfaceType = this.InterfaceType;
             if (interfaceType != null)
             {
                 MethodInfo method = interfaceType.GetMethod(this.MethodName);
                 if (method != null)
                 {
                     ArrayList list = new ArrayList(method.GetParameters());
                     if (!(method.ReturnType == typeof(void)))
                     {
                         list.Add(method.ReturnParameter);
                     }
                     foreach (ParameterInfo info2 in list)
                     {
                         if (info2.ParameterType != null)
                         {
                             PropertyDescriptor descriptor = new System.Workflow.Activities.Common.ParameterInfoBasedPropertyDescriptor(typeof(CallExternalMethodActivity), info2, true, new Attribute[] { DesignOnlyAttribute.Yes });
                             properties[descriptor.Name] = descriptor;
                         }
                     }
                 }
             }
         }
     }
 }
 internal void GetParameterPropertyDescriptors(IDictionary properties)
 {
     if (this.Site != null)
     {
         ITypeProvider service = (ITypeProvider) this.Site.GetService(typeof(ITypeProvider));
         if (service == null)
         {
             throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ITypeProvider).FullName }));
         }
         if ((this.InputActivityName != null) && !string.IsNullOrEmpty(this.InputActivityName.Trim()))
         {
             WebServiceInputActivity activity = Helpers.ParseActivity(Helpers.GetRootActivity(this), this.InputActivityName) as WebServiceInputActivity;
             if (activity != null)
             {
                 Type interfaceType = null;
                 if (activity.InterfaceType != null)
                 {
                     interfaceType = service.GetType(activity.InterfaceType.AssemblyQualifiedName);
                 }
                 if (interfaceType != null)
                 {
                     MethodInfo interfaceMethod = Helpers.GetInterfaceMethod(interfaceType, activity.MethodName);
                     if ((interfaceMethod != null) && (WebServiceActivityHelpers.ValidateParameterTypes(interfaceMethod).Count == 0))
                     {
                         List<ParameterInfo> list;
                         List<ParameterInfo> list2;
                         WebServiceActivityHelpers.GetParameterInfo(interfaceMethod, out list, out list2);
                         foreach (ParameterInfo info2 in list2)
                         {
                             PropertyDescriptor descriptor = null;
                             if (info2.Position == -1)
                             {
                                 descriptor = new ParameterInfoBasedPropertyDescriptor(typeof(WebServiceOutputActivity), info2, false, new Attribute[] { DesignOnlyAttribute.Yes });
                             }
                             else
                             {
                                 descriptor = new ParameterInfoBasedPropertyDescriptor(typeof(WebServiceOutputActivity), info2, true, new Attribute[] { DesignOnlyAttribute.Yes });
                             }
                             if (descriptor != null)
                             {
                                 properties[descriptor.Name] = descriptor;
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 internal void GetParameterPropertyDescriptors(IDictionary properties)
 {
     if (this.Site != null)
     {
         if (((ITypeProvider) this.Site.GetService(typeof(ITypeProvider))) == null)
         {
             throw new InvalidOperationException(SR.GetString("General_MissingService", new object[] { typeof(ITypeProvider).FullName }));
         }
         Type proxyClass = this.ProxyClass;
         if (proxyClass != null)
         {
             MethodInfo method = proxyClass.GetMethod(this.MethodName);
             if (method != null)
             {
                 ArrayList list = new ArrayList(method.GetParameters());
                 if (!(method.ReturnType == typeof(void)))
                 {
                     list.Add(method.ReturnParameter);
                 }
                 foreach (ParameterInfo info2 in list)
                 {
                     if (info2.ParameterType != null)
                     {
                         PropertyDescriptor descriptor = null;
                         if (info2.Position == -1)
                         {
                             descriptor = new ParameterInfoBasedPropertyDescriptor(typeof(InvokeWebServiceActivity), info2, false, new Attribute[] { DesignOnlyAttribute.Yes });
                         }
                         else
                         {
                             descriptor = new ParameterInfoBasedPropertyDescriptor(typeof(InvokeWebServiceActivity), info2, ReservedParameterNames.Contains(info2.Name), new Attribute[] { DesignOnlyAttribute.Yes });
                         }
                         properties[descriptor.Name] = descriptor;
                     }
                 }
             }
         }
     }
 }