WorldEditor.frmEditLocation.frmEditLocation_Load C# (CSharp) Method

frmEditLocation_Load() private method

private frmEditLocation_Load ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void frmEditLocation_Load(object sender, EventArgs e)
        {
            this.olvMusic.AspectToStringConverter = delegate(object x)
            {
                List<String> MusicNames = (List<String>)x;
                return String.Format("{0}", Utils.ToCSV(", ", MusicNames));
            };

            if (!NewLoc)
            {
                this.Text = "Location - " + Loc.Name + ", PID = " + Loc.Pid;
                txtName.Text = Loc.Name;
                txtWMName.Text = Loc.WorldMapName;
                txtDescription.Text = Loc.WorldMapDescription;
                txtEntranceScript.Text = Loc.EntranceScript;
                txtEntrance.Text = Loc.Entrance;
                txtSignImagePath.Text = Loc.WorldMapSignImagePath;
                txtTownImagePath.Text = Loc.WorldMapTownImagePath;
                numXPos.Value = Loc.X;
                numYPos.Value = Loc.Y;
                numSize.Value = Loc.Size;
                numPID.Value = Loc.Pid;
                numMaxCopies.Value = Loc.MaxPlayers;
                chkGeck.Checked = Loc.GeckVisible;

                chkVisible.Checked = Loc.Visible;
                chkEncounter.Checked = Loc.AutoGarbage;

                numPID.Enabled = false;
                btnAssignPID.Enabled = false;

                txtFlags.Lines = Loc.Flags.ToArray();

                if (String.IsNullOrEmpty(txtTownImagePath.Text))
                    btnEditTownMap.Enabled = false;

                if (!Loc.OnWorldmap)
                    btnRemoveFromWM.Visible = false;
            }
            else
            {
                this.Text = "Location";
                btnRemoveFromWM.Visible = false;
                Loc = new Location();
                numPID.Value = LocParser.GetFreeLocationPID(1);
                numSize.Value = 24;
                if (chkEncounter.Checked)
                {
                    numMaxCopies.Enabled = false;
                    txtEntrance.Enabled = false;
                }
                numMaxCopies.Value = 1;
                txtEntrance.Text = "1";

                Loc.Modified = true;
                Loc.Maps = new List<Map>();
            }

            lstMaps.RestoreState(TableSerializer.Load("lstMaps"));
            lstMaps.Items.Clear();
            if (Loc.Maps == null)
                return;
            lstMaps.SetObjects(Loc.Maps);
        }