Bounce.LevelEditor.Editor.load_file C# (CSharp) Метод

load_file() приватный Метод

private load_file ( bool loadWorld, string filter, string title ) : void
loadWorld bool
filter string
title string
Результат void
        private void load_file(bool loadWorld, string filter, string title)
        {
            //First, choose the file we want to load.
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Filter = filter;
            dialog.InitialDirectory = ".";
            dialog.Title = title;

            DialogResult result = dialog.ShowDialog();

            //If the result was ok, load the resultant file, otherwise, just return.
            if (result == DialogResult.OK)
            {
                if (loadWorld)
                {
                    world = Serializer.DeSerialize(dialog.FileName);
                    switchRooms(world.CurrentRoom);
                }
                else
                {
                    currentlySelectedRoom = Serializer.DeserializeRoom(dialog.FileName);
                    switchRooms(currentlySelectedRoom);
                }

                currentFileName = dialog.FileName;

                enableEditing(loadWorld);

                pb_Level.Refresh();
            }
        }