/* With this constructor you can make the dialog for adding new items to a room. The handlers used in this class will be set here. */ public AddItemDialog(string name, Action parentCallback) : base(name, parentCallback) { this._callback = parentCallback; this._itemTypeHandler = ItemTypeHandler.GetInstance(); this._itemHandler = ItemHandler.GetInstance(); this._documentHandler = DocumentHandler.GetInstance(); }
public AddItemTypeDialog(string name, Action callback) : base(name, callback) { this._callBack = callback; this._itemHandler = ItemHandler.GetInstance(); this._itemTypeHandler = ItemTypeHandler.GetInstance(); this.panelHeight = 250; this.panelWidth = 500; }
/* With this constructor you can make the dialog for deleteing new items to a room. The handlers used in this class will be set here. */ public DeleteItemDialog(string name, Action parentCallback, Room targetRoom, ItemType itemType) : base(name, parentCallback) { this._callback = parentCallback; this._itemTypeHandler = ItemTypeHandler.GetInstance(); this._itemHandler = ItemHandler.GetInstance(); this._documentHandler = DocumentHandler.GetInstance(); this._targetRoom = targetRoom; this._itemType = itemType; }
protected override void InitializeComponent() { base.InitializeComponent(); this._documentHandler = DocumentHandler.GetInstance(); this._itemHandler = ItemHandler.GetInstance(); this._itemTypeHandler = ItemTypeHandler.GetInstance(); this._itemTypeList = new List<ItemType>(); this._itemList = new List<Item>(); this._itemTypeList = this._itemTypeHandler.GetItemTypesBy((itemType) => true); this._itemList = this._itemHandler.GetItemsBy((item) => item.RoomID == this._documentHandler.CurrentRoom.GetID() && item.Type.Description == this._itemType.Description); this._editItemCancel = new System.Windows.Forms.Button(); this._editItemAccept = new System.Windows.Forms.Button(); this._objectTypeLabel = new System.Windows.Forms.Label(); this._amountOfItemsLabel = new System.Windows.Forms.Label(); this._amountOfItemsBorderedTextBox = new KBS2.Controls.BorderedTextBox(); this._newObjectTypeComboBox = new ComboBox(); this._currentItemLabel = new Label(); // // _currentItemLabel // this._currentItemLabel.AutoSize = true; this._currentItemLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold); this._currentItemLabel.Location = new System.Drawing.Point(150, 49); this._currentItemLabel.Name = "_objectTypeLabel"; this._currentItemLabel.Size = new System.Drawing.Size(200, 13); this._currentItemLabel.TabIndex = 21; this._currentItemLabel.Text = "Huidige objecttype: " + this._itemType.Description; // // _editItemCancel // this._editItemCancel.BackColor = System.Drawing.Color.DimGray; this._editItemCancel.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gray; this._editItemCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this._editItemCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this._editItemCancel.ForeColor = System.Drawing.Color.White; this._editItemCancel.Location = new System.Drawing.Point(7, 148); this._editItemCancel.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this._editItemCancel.Name = "_editItemCancel"; this._editItemCancel.Size = new System.Drawing.Size(120, 46); this._editItemCancel.TabIndex = 11; this._editItemCancel.Text = "Sluiten"; this._editItemCancel.UseVisualStyleBackColor = false; this._editItemCancel.Click += new EventHandler(this.EditItemCancel_Click); // // _editItemAccept // this._editItemAccept.BackColor = System.Drawing.Color.DimGray; this._editItemAccept.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Gray; this._editItemAccept.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this._editItemAccept.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this._editItemAccept.ForeColor = System.Drawing.Color.White; this._editItemAccept.Location = new System.Drawing.Point(364, 148); this._editItemAccept.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this._editItemAccept.Name = "_editItemAccept"; this._editItemAccept.Size = new System.Drawing.Size(129, 46); this._editItemAccept.TabIndex = 13; this._editItemAccept.Text = "Wijzigen"; this._editItemAccept.UseVisualStyleBackColor = false; this._editItemAccept.Click += new EventHandler(this.EditItemAccept_Click); // // _objectTypeLabel // this._objectTypeLabel.AutoSize = true; this._objectTypeLabel.Location = new System.Drawing.Point(137, 84); this._objectTypeLabel.Name = "_objectTypeLabel"; this._objectTypeLabel.Size = new System.Drawing.Size(200, 13); this._objectTypeLabel.TabIndex = 21; this._objectTypeLabel.Text = "Kies een nieuw objecctype:"; // // _amountOfItemsLabel // this._amountOfItemsLabel.AutoSize = true; this._amountOfItemsLabel.Location = new System.Drawing.Point(108, 100); this._amountOfItemsLabel.Name = "_amountOfItemsLabel"; this._amountOfItemsLabel.Size = new System.Drawing.Size(78, 13); this._amountOfItemsLabel.TabIndex = 23; this._amountOfItemsLabel.Text = "Vul de hoeveelheid objecten in" + Environment.NewLine + "die u naar dit type wil veranderen:"; // // _amountOfItemsBorderedTextBox // this._amountOfItemsBorderedTextBox.BackColor = System.Drawing.SystemColors.ControlDark; this._amountOfItemsBorderedTextBox.DefaultBorderColor = System.Drawing.SystemColors.ControlDark; this._amountOfItemsBorderedTextBox.FocusedBorderColor = System.Drawing.Color.Red; this._amountOfItemsBorderedTextBox.Location = new System.Drawing.Point(275, 100); this._amountOfItemsBorderedTextBox.Name = "_amountOfItemsBorderedTextBox"; this._amountOfItemsBorderedTextBox.Padding = new System.Windows.Forms.Padding(1); this._amountOfItemsBorderedTextBox.Size = new System.Drawing.Size(100, 20); this._amountOfItemsBorderedTextBox.TabIndex = 24; // // _newObjectTypeTextBox // this._newObjectTypeComboBox.FormattingEnabled = true; this._newObjectTypeComboBox.Location = new System.Drawing.Point(275, 76); this._newObjectTypeComboBox.Name = "_newObjectTypeComboBox"; this._newObjectTypeComboBox.Size = new System.Drawing.Size(100, 21); this._newObjectTypeComboBox.TabIndex = 20; this._newObjectTypeComboBox.SelectedIndexChanged += new EventHandler(this.ObjectComboBx_SelectedIndexChanged); // // EditItem // this._panel.Controls.Add(this._currentItemLabel); this._panel.Controls.Add(this._editItemAccept); this._panel.Controls.Add(this._editItemCancel); this._panel.Controls.Add(this._amountOfItemsBorderedTextBox); this._panel.Controls.Add(this._amountOfItemsLabel); this._panel.Controls.Add(this._objectTypeLabel); this._panel.Controls.Add(this._newObjectTypeComboBox); this.FillNewObjectTypeComboBox(); this.build(); }
public static ItemHandler GetInstance() { if (instance == null) instance = new ItemHandler(); return instance; }