コード例 #1
0
 protected virtual void OnGetRuntimeDelegateArguments(IList <RuntimeDelegateArgument> runtimeDelegateArguments)
 {
     foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(this))
     {
         if (ActivityUtilities.TryGetDelegateArgumentDirectionAndType(propertyDescriptor.PropertyType, out ArgumentDirection direction, out Type innerType))
         {
             runtimeDelegateArguments.Add(new RuntimeDelegateArgument(propertyDescriptor.Name, innerType, direction, (DelegateArgument)propertyDescriptor.GetValue(this)));
         }
     }
 }
コード例 #2
0
ファイル: ActivityDelegate.cs プロジェクト: wforney/corewf
        /// <summary>
        /// Called when [get runtime delegate arguments].
        /// </summary>
        /// <param name="runtimeDelegateArguments">The runtime delegate arguments.</param>
        /// <exception cref="ArgumentNullException">runtimeDelegateArguments</exception>
        protected virtual void OnGetRuntimeDelegateArguments(IList <RuntimeDelegateArgument> runtimeDelegateArguments)
        {
            if (runtimeDelegateArguments == null)
            {
                throw new ArgumentNullException(nameof(runtimeDelegateArguments));
            }

            foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(this))
            {
                if (ActivityUtilities.TryGetDelegateArgumentDirectionAndType(propertyDescriptor.PropertyType, out var direction, out var innerType))
                {
                    runtimeDelegateArguments.Add(
                        new RuntimeDelegateArgument(
                            propertyDescriptor.Name,
                            innerType,
                            direction,
                            (DelegateArgument)propertyDescriptor.GetValue(this)));
                }
            }
        }