コード例 #1
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "ImpersonationUser");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(ImpersonationUser))
                    {
                        ImpersonationUser = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "ImpersonationPassword");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(ImpersonationPassword))
                    {
                        ImpersonationUser = k;

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "LocalUserImpersonation");
                        if (i != null)
                        {
                            LocalUserImpersonation = (bool)i.GetValue(source);
                        }
                    }
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }
コード例 #2
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "GoogleCredentialFile");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(GoogleCredentialFile))
                    {
                        GoogleCredentialFile = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "ProjectName");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(ProjectName))
                    {
                        ProjectName = k;
                    }
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }
コード例 #3
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SqlConnectionString");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SqlConnectionString))
                    {
                        SqlConnectionString = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SqlPassword");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SqlPassword))
                    {
                        SqlPassword = k;
                    }
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }
コード例 #4
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SqlDatabaseAddress");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SqlDatabaseAddress))
                    {
                        SqlDatabaseAddress = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SqlDatabaseName");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SqlDatabaseName))
                    {
                        SqlDatabaseName = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SqlUser");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SqlUser))
                    {
                        SqlUser = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SqlPassword");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SqlPassword))
                    {
                        SqlPassword = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "UseIntegratedSecurity");
                if (i != null)
                {
                    UseIntegratedSecurity = (bool)i.GetValue(source);
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }
コード例 #5
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "ServerAddress");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(ServerAddress))
                    {
                        ServerAddress = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "Port");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(Port))
                    {
                        Port = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "TimeoutSeconds");
                if (i != null)
                {
                    TimeoutSeconds = (int)i.GetValue(source);
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "User");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(User))
                    {
                        User = k;

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "Password");
                        if (i != null)
                        {
                            Password = i.GetValue(source) as string;
                        }

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "KeyFile");
                        if (i != null)
                        {
                            KeyFile = i.GetValue(source) as string;
                        }
                    }
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }
コード例 #6
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "Region");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(Region))
                    {
                        Region = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "ServiceURL");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(ServiceURL))
                    {
                        ServiceURL = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SecretKey");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SecretKey))
                    {
                        SecretKey = k;

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "AccessKey");
                        if (i != null)
                        {
                            AccessKey = i.GetValue(source) as string;
                        }

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "RoleName");
                        if (i != null)
                        {
                            RoleName = i.GetValue(source) as string;
                        }

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "RoleSessionName");
                        if (i != null)
                        {
                            RoleSessionName = i.GetValue(source) as string;
                        }

                        i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "AllowBucketControl");
                        if (i != null)
                        {
                            AllowBucketControl = (bool)i.GetValue(source);
                        }
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "LimitListResults");
                if (i != null)
                {
                    LimitListResults = (int)i.GetValue(source);
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }
コード例 #7
0
        public override void PopulateFrom(Sys.Security.IAuthentication source)
        {
            if (source.VersionDescriptor.TypeName == VersionDescriptor.TypeName)
            {
                PropertyInfo i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "ServerAddress");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(ServerAddress))
                    {
                        ServerAddress = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "Port");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(Port))
                    {
                        Port = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "TopicName");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(TopicName))
                    {
                        TopicName = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SslCaLocation");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SslCaLocation))
                    {
                        SslCaLocation = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SaslUsername");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SaslUsername))
                    {
                        SaslUsername = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SaslPassword");
                if (i != null)
                {
                    string k = i.GetValue(source) as string;
                    if (!String.IsNullOrEmpty(k) && String.IsNullOrEmpty(SaslPassword))
                    {
                        SaslPassword = k;
                    }
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SecurityProtocol");
                if (i != null)
                {
                    SecurityProtocol = (SecurityProtocol)i.GetValue(source);
                }

                i = source.GetType().GetProperties().FirstOrDefault(p => p.Name == "SaslMechanism");
                if (i != null)
                {
                    SaslMechanism = (SaslMechanism)i.GetValue(source);
                }
            }
            else
            {
                throw new Exception("IAuthentication Type mismatch.");
            }
        }