示例#1
0
        /// <summary>
        /// Constructor initializes databindings and fills comboboxes with default values.
        /// </summary>
        public ForeignKeysEdit()
        {
            InitializeComponent();

            // Initialize data bindings
            InitBindings();

            // Grid should not generate columns automatically
            foreigKeyColumns.AutoGenerateColumns = false;
            foreigKeyColumns.OrdinalColumn       = ordinalColumn;

            // Fill action comboboxes
            onDeleteSelect.Tag = ForeignKey.OnDelete;
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.NOACTION, Resources.Action_NoAction));
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.CASCADE, Resources.Action_Cascade));
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.SETNULL, Resources.Action_SetNull));
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.RESTRICT, Resources.Action_Restrict));

            onUpdateSelect.Tag = ForeignKey.OnUpdate;
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.NOACTION, Resources.Action_NoAction));
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.CASCADE, Resources.Action_Cascade));
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.SETNULL, Resources.Action_SetNull));
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.RESTRICT, Resources.Action_Restrict));

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);
        }
示例#2
0
        /// <summary>
        /// Constructor initializes databindings and fills comboboxes with default values.
        /// </summary>
        public ForeignKeysEdit()
        {
            InitializeComponent();

            // Initialize data bindings
            InitBindings();

            // Grid should not generate columns automatically
            foreigKeyColumns.AutoGenerateColumns = false;
            foreigKeyColumns.OrdinalColumn = ordinalColumn;

            // Fill action comboboxes
            onDeleteSelect.Tag = ForeignKey.OnDelete;
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.NOACTION, Resources.Action_NoAction));
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.CASCADE, Resources.Action_Cascade));
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.SETNULL, Resources.Action_SetNull));
            onDeleteSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.RESTRICT, Resources.Action_Restrict));

            onUpdateSelect.Tag = ForeignKey.OnUpdate;
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.NOACTION, Resources.Action_NoAction));
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.CASCADE, Resources.Action_Cascade));
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.SETNULL, Resources.Action_SetNull));
            onUpdateSelect.Items.Add(new KeyDisplayValuePair(ForeignKeyDescriptor.RESTRICT, Resources.Action_Restrict));

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);
        } 
示例#3
0
        /// <summary>
        /// Constructs and initializes the editor
        /// </summary>        
        /// <param name="document">Reference to a document to edit</param>
        public UdfEditor(IDocument document) : base(document)
        {
            if (!(document is UdfDocument))
                throw new ArgumentException(Resources.Error_UnsupportedDocument, "document");

            InitializeComponent();

            // Adding permittable return types
            UnsubscribeEvents();
            cboReturns.DataSource = Enum.GetNames(typeof(ReturnTypes));
            SubscribeEvents();

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);
        }
示例#4
0
        /// <summary>
        /// Constructor initializes databindings and fills comboboxes with default values.
        /// </summary>
        public IndexesEdit()
        {
            InitializeComponent();

            // Initialize data bindings
            InitBindings();

            // Grid should not generate columns automatically
            indexColumns.AutoGenerateColumns = false;
            indexColumns.OrdinalColumn       = positionInIndexColumn;

            // Should not show null image at the index length
            columnLengthColumn.CellTemplate = new DataGridViewNotNullableTextBoxCell();

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);
        }
示例#5
0
        /// <summary>
        /// Constructs and initializes the editor
        /// </summary>
        /// <param name="document">Reference to a document to edit</param>
        public UdfEditor(IDocument document) : base(document)
        {
            if (!(document is UdfDocument))
            {
                throw new ArgumentException(Resources.Error_UnsupportedDocument, "document");
            }

            InitializeComponent();

            // Adding permittable return types
            UnsubscribeEvents();
            cboReturns.DataSource = Enum.GetNames(typeof(ReturnTypes));
            SubscribeEvents();

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);
        }
示例#6
0
        /// <summary>
        /// Constructor initializes databindings and fills comboboxes with default values.
        /// </summary>
        public IndexesEdit()
        {
            InitializeComponent();

            // Initialize data bindings
            InitBindings();

            // Grid should not generate columns automatically
            indexColumns.AutoGenerateColumns = false;
            indexColumns.OrdinalColumn = positionInIndexColumn;

            // Should not show null image at the index length
            columnLengthColumn.CellTemplate = new DataGridViewNotNullableTextBoxCell();

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);
        }       
示例#7
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ColumnDetails()
        {
            InitializeComponent();

            // Fill text boxes tags
            nameText.AttributeName = Column.Name;
            datatypeText.Tag = Column.MySqlType;
            defaultValueText.Tag = Column.Default;
            commentText.Tag = Column.Comments;

            // Fill checkboxes tags
            primaryKey.Tag = Column.IsPrimaryKey;
            notNull.Tag = Column.Nullable;
            autoIncrement.Tag = Column.IsAutoIncrement;

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);

            // Disabled by default
            Enabled = false;
        }
示例#8
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ColumnDetails()
        {
            InitializeComponent();

            // Fill text boxes tags
            nameText.AttributeName = Column.Name;
            datatypeText.Tag       = Column.MySqlType;
            defaultValueText.Tag   = Column.Default;
            commentText.Tag        = Column.Comments;

            // Fill checkboxes tags
            primaryKey.Tag    = Column.IsPrimaryKey;
            notNull.Tag       = Column.Nullable;
            autoIncrement.Tag = Column.IsAutoIncrement;

            // Creating a key events manager
            keyEventsManager = new KeyEventsManager(this);

            // Disabled by default
            Enabled = false;
        }