protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (TabControl != null) { if (!TabControl.IsDisposed) { TabControl.Dispose(); } TabControl = null; } if (AvailableTab != null) { if (!AvailableTab.IsDisposed) { AvailableTab.Dispose(); } AvailableTab = null; } if (CurrentTab != null) { if (!CurrentTab.IsDisposed) { CurrentTab.Dispose(); } CurrentTab = null; } if (CompletedTab != null) { if (!CompletedTab.IsDisposed) { CompletedTab.Dispose(); } CompletedTab = null; } } }
public QuestDialog() { TitleLabel.Text = "任务日志"; SetClientSize(new Size(558, 380)); TabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; CurrentTab = new QuestTab { TabButton = { Label = { Text = "当前任务" } }, Parent = TabControl, Border = true, ChoiceGrid = { ReadOnly = true } }; AvailableTab = new QuestTab { TabButton = { Label = { Text = "可接任务" } }, Parent = TabControl, Border = true, ShowTrackerBox = { Visible = false } }; CompletedTab = new QuestTab { TabButton = { Label = { Text = "已完成" } }, Parent = TabControl, Border = true, ShowTrackerBox = { Visible = false } }; }