/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ReferencesSetEditor)); this.ReferencesSetNameTextBox = new System.Windows.Forms.TextBox(); this.ReferencesSetNameLabel = new System.Windows.Forms.Label(); this.ReferencesListBox = new System.Windows.Forms.ListBox(); this.SaveCancelControl = new SaveCancelControl(); this.AddButton = new TabButton(); this.EditButton = new TabButton(); this.DeleteButton = new TabButton(); this.SuspendLayout(); // // ReferencesSetNameTextBox // this.ReferencesSetNameTextBox.Font = new System.Drawing.Font("Verdana", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ReferencesSetNameTextBox.Location = new System.Drawing.Point(222, 13); this.ReferencesSetNameTextBox.Name = "ReferencesSetNameTextBox"; this.ReferencesSetNameTextBox.Size = new System.Drawing.Size(370, 27); this.ReferencesSetNameTextBox.TabIndex = 75; this.ReferencesSetNameTextBox.TextChanged += new System.EventHandler(this.ReferencesSetNameTextBox_TextChanged); // // ReferencesSetNameLabel // this.ReferencesSetNameLabel.Font = new System.Drawing.Font("Arial Rounded MT Bold", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ReferencesSetNameLabel.Location = new System.Drawing.Point(21, 19); this.ReferencesSetNameLabel.Name = "ReferencesSetNameLabel"; this.ReferencesSetNameLabel.Size = new System.Drawing.Size(203, 20); this.ReferencesSetNameLabel.TabIndex = 74; this.ReferencesSetNameLabel.Text = "References Set Name:"; this.ReferencesSetNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // ReferencesListBox // this.ReferencesListBox.Font = new System.Drawing.Font("Verdana", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ReferencesListBox.FormattingEnabled = true; this.ReferencesListBox.ItemHeight = 18; this.ReferencesListBox.Location = new System.Drawing.Point(37, 62); this.ReferencesListBox.Name = "ReferencesListBox"; this.ReferencesListBox.Size = new System.Drawing.Size(555, 166); this.ReferencesListBox.TabIndex = 92; this.ReferencesListBox.SelectedIndexChanged += new System.EventHandler(this.ReferencesListBox_SelectedIndexChanged); // // SaveCancelControl // this.SaveCancelControl.BackColor = System.Drawing.Color.Transparent; this.SaveCancelControl.Dock = System.Windows.Forms.DockStyle.Bottom; this.SaveCancelControl.Location = new System.Drawing.Point(0, 308); this.SaveCancelControl.Name = "SaveCancelControl"; this.SaveCancelControl.Size = new System.Drawing.Size(632, 40); this.SaveCancelControl.TabIndex = 76; // // AddButton // this.AddButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("AddButton.BackgroundImage"))); this.AddButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.AddButton.ButtonNumber = 0; this.AddButton.ButtonText = "Add"; this.AddButton.Font = new System.Drawing.Font("Arial Rounded MT Bold", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AddButton.Location = new System.Drawing.Point(186, 240); this.AddButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.AddButton.Name = "AddButton"; this.AddButton.NotSelectedImage = null; this.AddButton.Selected = false; this.AddButton.SelectedImage = null; this.AddButton.ShowNotSelectedImageWhenDisabled = true; this.AddButton.Size = new System.Drawing.Size(80, 28); this.AddButton.TabIndex = 96; // // EditButton // this.EditButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("EditButton.BackgroundImage"))); this.EditButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.EditButton.ButtonNumber = 0; this.EditButton.ButtonText = "Edit"; this.EditButton.Font = new System.Drawing.Font("Arial Rounded MT Bold", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.EditButton.Location = new System.Drawing.Point(274, 240); this.EditButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.EditButton.Name = "EditButton"; this.EditButton.NotSelectedImage = global::DataTierClient.Properties.Resources.DeepGray; this.EditButton.Selected = false; this.EditButton.SelectedImage = global::DataTierClient.Properties.Resources.DeepBlue; this.EditButton.ShowNotSelectedImageWhenDisabled = true; this.EditButton.Size = new System.Drawing.Size(80, 28); this.EditButton.TabIndex = 97; // // DeleteButton // this.DeleteButton.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.BackgroundImage"))); this.DeleteButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.DeleteButton.ButtonNumber = 0; this.DeleteButton.ButtonText = "Delete"; this.DeleteButton.Font = new System.Drawing.Font("Arial Rounded MT Bold", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.DeleteButton.Location = new System.Drawing.Point(362, 240); this.DeleteButton.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.DeleteButton.Name = "DeleteButton"; this.DeleteButton.NotSelectedImage = global::DataTierClient.Properties.Resources.DeepGray; this.DeleteButton.Selected = false; this.DeleteButton.SelectedImage = global::DataTierClient.Properties.Resources.DeepBlue; this.DeleteButton.ShowNotSelectedImageWhenDisabled = true; this.DeleteButton.Size = new System.Drawing.Size(80, 28); this.DeleteButton.TabIndex = 98; // // ReferencesSetEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Linen; this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Controls.Add(this.DeleteButton); this.Controls.Add(this.EditButton); this.Controls.Add(this.AddButton); this.Controls.Add(this.ReferencesListBox); this.Controls.Add(this.SaveCancelControl); this.Controls.Add(this.ReferencesSetNameTextBox); this.Controls.Add(this.ReferencesSetNameLabel); this.Name = "ReferencesSetEditor"; this.Size = new System.Drawing.Size(632, 348); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// This method UI Enable /// </summary> public void UIEnable() { // Enable or disable the controls based upon if we have a SelectedReader or not ReaderNameControl.Editable = HasSelectedReader; FieldSetControl.Editable = HasSelectedReader; EditFieldSetsButton.Enabled = EditingInProgress; // these two controls are set via the ReaderNameControl ClassNameControl.Editable = false; FileNameControl.Editable = false; // Disable or enable the buttons based upon the ActionType if (EditingInProgress) { // Disable all the buttons while editing is in progress AddButton.Enabled = false; EditButton.Enabled = false; EditButton.Selected = false; DeleteButton.Enabled = false; DeleteButton.Selected = false; ReaderNameControl.Editable = true; FieldSetControl.Editable = true; EditFieldSetsButton.Enabled = true; // Change to Cancel this.SaveCancelControl.SetupCancelButton("Cancel", 80); } else { // Not Editable ReaderNameControl.Editable = false; FieldSetControl.Editable = false; EditFieldSetsButton.Enabled = false; // you can always add a new one if not editing AddButton.Enabled = true; // if the value for HasSelectedReader is true if (HasSelectedReader) { // These buttons require a selected reader EditButton.Enabled = true; EditButton.Selected = true; DeleteButton.Enabled = true; DeleteButton.Selected = true; } else { // withhout a SelectedReader, you cannot Edit or Delete EditButton.Enabled = false; EditButton.Selected = false; DeleteButton.Enabled = false; DeleteButton.Selected = false; } // Change back to Done this.SaveCancelControl.SetupCancelButton("Done", 80); } // if we are in Add New Mode if (ActionType == ActionTypeEnum.AddButtonClicked) { // Enable the Save button SaveCancelControl.EnableSaveButton(true); } else if (ActionType == ActionTypeEnum.EditButtonClicked) { // Create a new instance of a 'CustomReadersWriter' object. CustomReadersWriter writer = new CustomReadersWriter(); // Export the selected reader string currentReaderXml = writer.ExportCustomReader(SelectedReader); // determine if there are changes or not bool hasChanges = !TextHelper.IsEqual(StoredReader, currentReaderXml); // Enable the save button if there are changes SaveCancelControl.EnableSaveButton(hasChanges); } else { // Disable the save button SaveCancelControl.EnableSaveButton(false); } }