public override void BindToForm(ProviderBase extension)
 {
     var provider = (TracIssueTrackingProvider)extension;
     this.txtUrl.Text = provider.RpcUrl ?? string.Empty;
     this.txtUser.Text = provider.UserName ?? string.Empty;
     this.txtPassword.Text = provider.Password ?? string.Empty;
 }
 public override void BindToForm(ProviderBase extension)
 {
     var provider = (GitHubIssueTrackingProvider)extension;
     this.txtOrganizationName.Text = provider.OrganizationName;
     this.txtUserName.Text = provider.UserName;
     this.txtPassword.Text = provider.Password;
     this.txtApiUrl.Text = provider.ApiUrl;
 }
        public override void BindToForm(ProviderBase extension)
        {
            this.EnsureChildControls();

            var provider = (GitSourceControlProvider)extension;
            this.txtGitExecutablePath.Text = provider.GitExecutablePath;
            this.chkUseStandardGitClient.Checked = provider.UseStandardGitClient;
        }
        public override void BindToForm(ProviderBase extension)
        {
            this.EnsureChildControls();

            var provider = (GitHubIssueTrackingProvider)extension;
            this.txtOrganizationName.Text = provider.OrganizationName;
            this.txtUserName.Text = provider.UserName;
            this.txtPassword.Text = provider.Password;
        }
        public override void BindToForm(ProviderBase extension)
        {
            this.EnsureChildControls();

            var tfsProvider = (VisualStudioComSourceControlProvider)extension;
            this.txtBaseUrl.Text = tfsProvider.BaseUrl;
            this.txtUserName.Text = tfsProvider.UserName;
            this.txtPassword.Text = tfsProvider.Password;
            this.chkBasicAuthentication.Checked = tfsProvider.UseBasicAuthentication;
        }
        public override void BindToForm(ProviderBase extension)
        {
            var provider = (GitHubSourceControlProvider)extension;

            this.txtGitExecutablePath.Text = provider.GitExecutablePath;
            this.txtOrganizationName.Text = provider.OrganizationName;
            this.txtUserName.Text = provider.UserName;
            this.txtPassword.Text = provider.Password;
            this.chkUseStandardGitClient.Checked = provider.UseStandardGitClient;
            this.txtApiUrl.Text = provider.ApiUrl;
        }
        public override void BindToForm(ProviderBase extension)
        {
            var tfsProvider = (TfsSourceControlProvider)extension;
            this.txtBaseUrl.Text = tfsProvider.BaseUrl;
            this.txtUserName.Text = tfsProvider.UserName;
            this.txtPassword.Text = tfsProvider.Password;
            this.txtDomain.Text = tfsProvider.Domain;

            if (tfsProvider.UseSystemCredentials)
                this.ddlAuthentication.SelectedValue = "system";
            else
                this.ddlAuthentication.SelectedValue = "specify";
        }
        public override void BindToForm(ProviderBase extension)
        {
            var provider = (TfsIssueTrackingProvider)extension;

            this.txtBaseUrl.Text = provider.BaseUrl;
            this.txtCustomReleaseNumberFieldName.Text = provider.CustomReleaseNumberFieldName;
            this.txtUserName.Text = provider.UserName;
            this.txtPassword.Text = provider.Password;
            this.txtDomain.Text = provider.Domain;
            this.chkAllowHtml.Checked = provider.AllowHtmlIssueDescriptions;
            this.txtWiql.Text = provider.CustomWiql;

            if (provider.UseSystemCredentials)
                this.ddlAuthentication.SelectedValue = "system";
            else
                this.ddlAuthentication.SelectedValue = "specify";

            if (string.IsNullOrWhiteSpace(provider.CustomWiql))
                this.ddlUseWiql.SelectedValue = "False";
            else
                this.ddlUseWiql.SelectedValue = "True";
        }
Ejemplo n.º 9
0
 public CommandProviderMethodSingle(
     Func <THandler, Action> methodGetter, ProviderBase singletonProvider)
     : base(singletonProvider)
 {
     _methodGetter = methodGetter;
 }
Ejemplo n.º 10
0
 public static object CreateCheckDuplicateProvider(ProviderBase _objProviderInfo)
 {
     //ype d1 = Type.GetType("TaskA"); /
     Type _type = Type.GetType(_objProviderInfo.ProviderType, true, true);
     return Activator.CreateInstance(_type, true);
 }
        public override void OpenAddForm()
        {
            SelectEnumInputForm select_form = new SelectEnumInputForm(true);

            ETipoAcreedor[] tipos = new ETipoAcreedor[6] {
                ETipoAcreedor.Acreedor, ETipoAcreedor.Proveedor, ETipoAcreedor.Despachante, ETipoAcreedor.Naviera, ETipoAcreedor.TransportistaDestino, ETipoAcreedor.TransportistaOrigen
            };
            select_form.SetDataSource(moleQule.Common.Structs.EnumText <ETipoAcreedor> .GetList(tipos, false));

            if (select_form.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }

            ComboBoxSource estado = select_form.Selected as ComboBoxSource;

            switch ((ETipoAcreedor)(long)estado.Oid)
            {
            case ETipoAcreedor.Acreedor:
            case ETipoAcreedor.Proveedor:
            {
                ProveedorAddForm form = new ProveedorAddForm(this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.Despachante:
            {
                DespachanteAddForm form = new DespachanteAddForm(this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.Naviera:
            {
                NavieraAddForm form = new NavieraAddForm();
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.TransportistaOrigen:
            {
                TransporterAddForm form = new TransporterAddForm(this, ETipoAcreedor.TransportistaOrigen);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.TransportistaDestino:
            {
                TransporterAddForm form = new TransporterAddForm(this, ETipoAcreedor.TransportistaDestino);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;
            }
        }
Ejemplo n.º 12
0
 internal static void Update(DMNhomNguoiDungInfor dmNhomNguoiDungInfor)
 {
     ProviderBase.Update(dmNhomNguoiDungInfor);
 }
Ejemplo n.º 13
0
 internal static void Insert(DMNhomNguoiDungInfor dmNhomNguoiDungInfor)
 {
     ProviderBase.Insert(dmNhomNguoiDungInfor);
 }
Ejemplo n.º 14
0
 public EntityOperator(ProviderBase provider)
 {
     _provider = provider;
     _sqlExecutor = _provider.CreateSqlExecutor();
     _sqlBuilder = _provider.CreateSqlBuilderFactory().CreateSqlBuilder();
 }
Ejemplo n.º 15
0
 public static object CreateDataProvider(ProviderBase _objProviderInfo)
 {
     Type _type = Type.GetType(_objProviderInfo.ProviderType, true, true);
     return Activator.CreateInstance(_type, true);
 }
Ejemplo n.º 16
0
 public override void Add(ProviderBase provider !!)
 {
     if (!(provider is ProtectedConfigurationProvider))
Ejemplo n.º 17
0
 public DSFServiceClient(ProviderBase provider, TipoUrl tipoUrl) : base(provider, tipoUrl, null)
 {
 }
 public ThreadLocalProviderSwitcherTest()
 {
     this.provider = Substitute.For <IThreadLocalProvider <ProviderBase>, ProviderBase>();
     this.behavior = Substitute.For <ProviderBase>();
 }
 /// <summary>Adds a provider to the collection.</summary>
 /// <param name="provider">The provider to be added.</param>
 /// <exception cref="System.ArgumentException">
 /// The <see cref="ProviderBase.Name"/> of <paramref name="provider"/> is <see langword="null"/>.<para>- or -</para>
 /// The length of the <see cref="ProviderBase.Name"/> of <paramref name="provider"/> is less than 1.<para>- or -</para>
 /// The <paramref name="provider"/> is not assignable to <typeparamref name="T"/>.
 /// </exception>
 /// <exception cref="System.ArgumentNullException"><paramref name="provider"/> is null.</exception>
 /// <exception cref="System.NotSupportedException">The collection is read-only.</exception>
 public override void Add(ProviderBase provider)
 {
     ArgumentUtility.CheckType <T> ("provider", provider);
     base.Add(provider);
 }
Ejemplo n.º 20
0
 public override void Add(ProviderBase provider)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 21
0
        public static int DoAdd(CommandLineApplication <AddCommandModel> addCmd, ProviderBase providerBase)
        {
            var newConfigItem = new DomainConfigItem
            {
                Domain = addCmd.Model.Domain,
                Type   = addCmd.Model.Type ?? DomainRecordType.A
                         // 为了便于下面 GetSingle() 模糊查询,这里先不对 Provider 赋值
            };

            // 根据 域名+类型 判断,是否有重复的
            var item = DomainConfigHelper.GetSingle(newConfigItem);

            if (item != null)
            {
                addCmd.Error.WriteLine("Failed to add, because the same configuration already exists: ");
                WriteConfigInfoToConsole(item, addCmd.Error);
                addCmd.Error.WriteLine("Only one record can be added for the same domain name and type, even if the provider is different.");

                return(1);
            }

            // 获取网卡信息
            // 如果只有一个网卡,并且用户没有设置 interface 选项,那么该域名就与该网卡绑定,使用该网卡的 IP 地址
            // 如果只有一个网卡,并且用户设置了 interface 选项,先判断可用网卡和用户设置的是否一致,如果一致则使用;不一致则报错
            // 如果有多个网卡,并且用户没有设置 interface 选项,报错
            // 如果有多个网卡,并且用户设置了 interface 选项,判断用户设置的网卡是否可用,如果不可用则报错
            NetworkInterface iface;
            var interfaces = GetAvailableNetworkInterfaces();

            if (!interfaces.Any())
            {
                return(FailedWithAvailableNetworkInterface(addCmd.Error));
            }

            if (!String.IsNullOrEmpty(addCmd.Model.Interface))
            {
                iface = interfaces.SingleOrDefault(i => i.Name == addCmd.Model.Interface);

                if (iface == null)
                {
                    return(FailedWithInterfaceNameNotFound(addCmd.Error));
                }
            }
            else if (interfaces.Count == 1)
            {
                iface = interfaces.Single();

                if (iface.Name != addCmd.Model.Interface)
                {
                    return(FailedWithInterfaceNameNotFound(addCmd.Error));
                }
            }
            else
            {
                return(FailedWithMultipleInterfaceNameFoundButNoSpecify(addCmd.Error));
            }

            // 准备保存数据了,为 Provider 等内容赋值
            newConfigItem.Provider  = addCmd.Model.Provider;
            newConfigItem.Interface = iface.Name;

            // 保存访问 DNS 提供商 API 时需要用到的参数信息
            var providerOptionNames = ProviderHelper.GetProviderOptions(providerBase.GetType()).Select(o => o.LongName);

            newConfigItem.ProviderInfo = addCmd.Options
                                         .Where(o => providerOptionNames.Contains(o.LongName))
                                         .ToDictionary(k => k.LongName, v => String.Join('|', v.Values));

            DomainConfigHelper.AddItem(newConfigItem);
            addCmd.Out.WriteLine($"Added successfully!");

            return(1);
        }
 // Methods
 public virtual void Add(ProviderBase provider)
 {
 }
Ejemplo n.º 23
0
 public ParameterAttribute(string parameter)
 {
     _parameter     = parameter;
     _configuration = ProviderBase.GetJson <JArray>($"QA.Core.DPC.QP.API.Tests.configuration.json");
 }
        public void ThrowsProviderInstantiationExceptionWhenInvalidTypeSpecified()
        {
            ProviderInfo providerInfo = UnitTestHelper.CreateProviderInfoInstance("test", "test");

            ProviderBase.Instance("Section", providerInfo);
        }
Ejemplo n.º 25
0
 public EntityOperator(ProviderBase provider)
 {
     _provider    = provider;
     _sqlExecutor = _provider.CreateSqlExecutor();
     _sqlBuilder  = _provider.CreateSqlBuilderFactory().CreateSqlBuilder();
 }
 public override void BindToForm(ProviderBase extension)
 {
     var sqlProv = (SqlServerDatabaseProvider)extension;
     txtConnectionString.Text = sqlProv.ConnectionString;
 }
Ejemplo n.º 27
0
 public override void Add(ProviderBase provider)
 {
     base.Add(provider);
 }
 public CommandProviderSingle(ProviderBase singletonProvider)
 {
     _singletonProvider = singletonProvider;
 }
 /// <summary>
 /// Register a new service that the test service should expose.
 /// </summary>
 /// <param name="feature">Known feature type.</param>
 /// <param name="serviceInstance">Instance of the feature's
 /// <see cref='ProviderBase' /> type.</param>
 public void RegisterService(TestServiceFeature feature, ProviderBase serviceInstance)
 {
     _services.Add(feature, serviceInstance);
 }
Ejemplo n.º 30
0
 internal static void Delete(DMNhomNguoiDungInfor dmNhomNguoiDungInfor)
 {
     ProviderBase.Delete(dmNhomNguoiDungInfor);
 }
 /// <summary>
 /// Register a new service that the test service should expose.
 /// </summary>
 /// <param name="featureName">String name of the feature if the known
 /// enum value does not exist.</param>
 /// <param name="serviceInstance">Instance of the feature's
 /// <see cref='ProviderBase' /> type.</param>
 public void RegisterService(string featureName, ProviderBase serviceInstance)
 {
     _services.Add(featureName, serviceInstance);
 }
Ejemplo n.º 32
0
 internal static bool Kiemtra(Predicate <DMNhomNguoiDungInfor> match)
 {
     return(ProviderBase.Exists(match));
 }
Ejemplo n.º 33
0
 public EntityInserterBase(ProviderBase provider)
 {
     //    this.provider = provider;
     //    this.sqlExecutor = provider.CreateSqlExecutor();
     //    this._sqlBuilder = provider.CreateSqlBuilderFactory().CreateSqlBuilder();
 }
        public override void OpenEditForm()
        {
            switch (ActiveItem.ETipoAcreedor)
            {
            case ETipoAcreedor.Acreedor:
            case ETipoAcreedor.Proveedor:
            {
                ProveedorEditForm form = new ProveedorEditForm(ActiveItem.OidAcreedor, ActiveItem.ETipoAcreedor, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.Despachante:
            {
                DespachanteEditForm form = new DespachanteEditForm(ActiveItem.OidAcreedor, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.Naviera:
            {
                NavieraEditForm form = new NavieraEditForm(ActiveItem.OidAcreedor, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;

            case ETipoAcreedor.TransportistaOrigen:
            case ETipoAcreedor.TransportistaDestino:
            {
                TransporterEditForm form = new TransporterEditForm(ActiveItem.OidAcreedor, ActiveItem.ETipoAcreedor, this);
                if (form.Entity != null)
                {
                    AddForm(form);
                    if (form.ActionResult == DialogResult.OK)
                    {
                        _entity = new ProviderBase();
                        _entity.CopyValues(form.Entity.ProviderBase);
                        _entity.Record.CopyValues(form.Entity.Base.Record);
                    }
                }
            }
            break;
            }
        }
Ejemplo n.º 35
0
 public EntityOperator()
 {
     _provider = ProviderFactory.CreateProvider();
     _sqlExecutor = _provider.CreateSqlExecutor();
     _sqlBuilder = _provider.CreateSqlBuilderFactory().CreateSqlBuilder();
 }
Ejemplo n.º 36
0
 internal static bool KiemTra(Predicate <Kho_NhanvienInfo> match)
 {
     return(ProviderBase.Exists(match));
 }
Ejemplo n.º 37
0
 static void Main(string[] args)
 {
     ProviderBase <AskItem> provider = GetProvider <AskItem>();
     var item = provider.Get();
 }
Ejemplo n.º 38
0
 private static void SetUserAgent <T>(ProviderBase <T> provider)
     where T : class
 {
     provider.ApplicationUserAgent = "CI-BOT";
 }
Ejemplo n.º 39
0
        internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            if (features == null)
            {
                throw new ArgumentNullException("features");
            }

            if (version == null)
            {
                throw new ArgumentNullException("version");
            }

            if (schemaVersionCheck == -1)
            {
                throw new ProviderException(SecurityMessage.GetString(SecurityMessage.Provider_Schema_Version_Not_Match, provider.ToString(), version));
            }
            else if (schemaVersionCheck == 0)
            {
                lock (provider)
                {
                    if (schemaVersionCheck == -1)
                    {
                        throw new ProviderException(SecurityMessage.GetString(SecurityMessage.Provider_Schema_Version_Not_Match, provider.ToString(), version));
                    }
                    else if (schemaVersionCheck == 0)
                    {
                        int          iStatus = 0;
                        SqlCommand   cmd     = null;
                        SqlParameter p       = null;

                        foreach (string feature in features)
                        {
                            cmd = new SqlCommand("dbo.aspnet_CheckSchemaVersion", connection);

                            cmd.CommandType = CommandType.StoredProcedure;

                            p = new SqlParameter("@Feature", feature);
                            cmd.Parameters.Add(p);

                            p = new SqlParameter("@CompatibleSchemaVersion", version);
                            cmd.Parameters.Add(p);

                            p           = new SqlParameter("@ReturnValue", SqlDbType.Int);
                            p.Direction = ParameterDirection.ReturnValue;
                            cmd.Parameters.Add(p);

                            cmd.ExecuteNonQuery();

                            iStatus = ((p.Value != null) ? ((int)p.Value) : -1);
                            if (iStatus != 0)
                            {
                                schemaVersionCheck = -1;

                                throw new ProviderException(SecurityMessage.GetString(SecurityMessage.Provider_Schema_Version_Not_Match, provider.ToString(), version));
                            }
                        }

                        schemaVersionCheck = 1;
                    }
                }
            }
        }
 public void CopyTo(ProviderBase[] array, int index)
 {
 }
Ejemplo n.º 41
0
 // Methods
 public virtual void Add(ProviderBase provider)
 {
 }
        public void NullSectionNameThrowsException()
        {
            ProviderInfo providerInfo = UnitTestHelper.CreateProviderInfoInstance("test", "test");

            ProviderBase.Instance(null, providerInfo);
        }
Ejemplo n.º 43
0
        internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck)
        {
            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            if (features == null)
            {
                throw new ArgumentNullException("feature");
            }

            if (version == null)
            {
                throw new ArgumentNullException("version");
            }

            if (schemaVersionCheck == -1)
            {
                throw new Exception("The '" + provider.ToString() + "' requires a database schema compatible with schema version '" + version + "'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_reqsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.");
            }
            else if (schemaVersionCheck == 0)
            {
                lock (provider)
                {
                    if (schemaVersionCheck == -1)
                    {
                        throw new Exception("The '" + provider.ToString() + "' requires a database schema compatible with schema version '" + version + "'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_reqsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.");
                    }
                    else if (schemaVersionCheck == 0)
                    {
                        int          iStatus = 0;
                        SqlCommand   cmd     = null;
                        SqlParameter p       = null;

                        foreach (string feature in features)
                        {
                            cmd = new SqlCommand("dbo.aspnet_CheckSchemaVersion", connection);

                            cmd.CommandType = CommandType.StoredProcedure;

                            p = new SqlParameter("@Feature", feature);
                            cmd.Parameters.Add(p);

                            p = new SqlParameter("@CompatibleSchemaVersion", version);
                            cmd.Parameters.Add(p);

                            p           = new SqlParameter("@ReturnValue", SqlDbType.Int);
                            p.Direction = ParameterDirection.ReturnValue;
                            cmd.Parameters.Add(p);

                            cmd.ExecuteNonQuery();

                            iStatus = ((p.Value != null) ? ((int)p.Value) : -1);
                            if (iStatus != 0)
                            {
                                schemaVersionCheck = -1;

                                throw new Exception("The '" + provider.ToString() + "' requires a database schema compatible with schema version '" + version + "'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_reqsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.");
                            }
                        }

                        schemaVersionCheck = 1;
                    }
                }
            }
        }
Ejemplo n.º 44
0
		public override void Add(ProviderBase provider) {
			if (provider == null)
				throw new ArgumentNullException("provider");
	
			if (!(provider is ClassroomProvider))
				throw new ArgumentException
					("Invalid provider type", "provider");
	
			base.Add(provider);
		}
Ejemplo n.º 45
0
 public InMemoryProvider()
 {
     this.groupProvider = new InMemoryGroupProvider();
     this.userProvider  = new InMemoryUserProvider();
 }
        public override void BindToForm(ProviderBase extension)
        {
            EnsureChildControls();

            var provider = (Tfs2012IssueTrackingProvider)extension;

            txtBaseUrl.Text = provider.BaseUrl;
            txtCustomReleaseNumberFieldName.Text = provider.CustomReleaseNumberFieldName;
            txtUserName.Text = provider.UserName;
            txtPassword.Text = provider.Password;
            txtDomain.Text = provider.Domain;
            this.chkAllowHtml.Checked = provider.AllowHtmlIssueDescriptions;

            if (provider.UseSystemCredentials)
                ddlAuthentication.SelectedValue = "system";
            else
                ddlAuthentication.SelectedValue = "specify";
        }
Ejemplo n.º 47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InlineQuery"/> class.
 /// </summary>
 /// <param name="dataProvider">The data provider.</param>
 public InlineQuery(ProviderBase dataProvider)
 {
     command = new QueryCommand(String.Empty, dataProvider.Name);
 }