Exemplo n.º 1
0
        public override Control Create(IExecutionContext context)
        {
            SQLConnectionProperties val = (SQLConnectionProperties)Value;

            _control = new SQLConnectionControl(context);
            SQLConnectionControl control = (SQLConnectionControl)_control;

            control.Value = val;

            bool fixedInstanceName = context.GetBoolFrom(FixedInstanceName);
            bool fixedDBName       = context.GetBoolFrom(FixedDBName);
            bool fixedSqlAuth      = context.GetBoolFrom(FixedSqlAuth);
            bool fixedUserName     = context.GetBoolFrom(FixedUserName);

            control.SetControlEnabled(SQLConnectionSubControl.UserName, !fixedUserName);
            control.SetControlEnabled(SQLConnectionSubControl.SqlAuthentication, !fixedSqlAuth);
            control.SetControlEnabled(SQLConnectionSubControl.DBName, !fixedDBName);
            control.SetControlEnabled(SQLConnectionSubControl.ServerName, !fixedInstanceName);

            return(_control);
        }
Exemplo n.º 2
0
        public override Control Create(IExecutionContext context)
        {
            SQLConnectionProperties val = (SQLConnectionProperties)Value;

            _control = new SQLConnectionControl(context);
            SQLConnectionControl control = (SQLConnectionControl)_control;
            control.Value = val;

            bool fixedInstanceName = context.GetBoolFrom(FixedInstanceName);
            bool fixedDBName = context.GetBoolFrom(FixedDBName);
            bool fixedSqlAuth = context.GetBoolFrom(FixedSqlAuth);
            bool fixedUserName = context.GetBoolFrom(FixedUserName);

            control.SetControlEnabled(SQLConnectionSubControl.UserName, !fixedUserName);
            control.SetControlEnabled(SQLConnectionSubControl.SqlAuthentication, !fixedSqlAuth);
            control.SetControlEnabled(SQLConnectionSubControl.DBName, !fixedDBName);
            control.SetControlEnabled(SQLConnectionSubControl.ServerName, !fixedInstanceName);

            return _control;
        }