コード例 #1
0
            }             // func CreateSelector

            private PpsDataSelector InvokeCreateSelector(PpsSysConnectionHandle connection, DEConfigItem c, bool throwException)
            {
                try
                {
                    var parameterInfo = method.GetParameters();
                    var args          = new object[parameterInfo.Length];

                    for (var i = 0; i < parameterInfo.Length; i++)
                    {
                        var parameterType = parameterInfo[i].ParameterType;
                        if (parameterType == typeof(PpsDataSource) || parameterType == typeof(PpsSysDataSource))
                        {
                            args[i] = connection?.DataSource;
                        }
                        else
                        {
                            throw new ArgumentNullException(parameterInfo[i].Name, $"Could not assign type {parameterType.Name}.");
                        }
                    }

                    return((PpsDataSelector)method.Invoke(c, args));
                }
                catch (TargetInvocationException)
                {
                    if (throwException)
                    {
                        throw;
                    }
                    return(null);
                }
            }             // proc InvokeCreateSelector
コード例 #2
0
 /// <summary></summary>
 /// <param name="sp"></param>
 /// <param name="name"></param>
 public PpsSysDataSource(IServiceProvider sp, string name)
     : base(sp, name)
 {
     this.application      = sp.GetService <PpsApplication>(true);
     this.systemConnection = new PpsSysConnectionHandle(this, PpsUserIdentity.System);
 }         // ctor