private void SetMode(string mode, Icon icon, IDnDCSControl control) { this.control = control; Logger.FileSuffix = mode; Logger.LogInfo(string.Format("Initializing {0} Mode", mode)); this.Text = "DnDCS - " + mode; this.Icon = icon; var del = this.pnlInit; this.Controls.Remove(del); del.Dispose(); if (control is IDnDCSControl) { var dndCSControl = (IDnDCSControl)control; this.Menu = this._menu = dndCSControl.GetMainMenu(); dndCSControl.ToggleFullScreen = ToggleFullScreen; } ((Control)control).Dock = DockStyle.Fill; this.Controls.Add((Control)control); }