Save() public method

public Save ( string fileName ) : void
fileName string
return void
Beispiel #1
0
        public static void SaveSetFileWindowOk(Window callingWindow)
        {
            string fileName = ((FileWindow)callingWindow).Results[0];

            #region Save the istx
            InstructionSetSaveList instructionSetSaveList = new FlatRedBall.Content.Instructions.InstructionSetSaveList();

            if (EditorData.BlockingScene == null)
            {
                GuiManager.ShowMessageBox("There is no scene loaded.  A scene must be loaded for the .istx to reference.", "Error saving");
            }
            else
            {
                foreach (AnimationSequence animationSequence in EditorData.GlobalInstructionSets)
                {
                    AnimationSequenceSave sequenceSave = AnimationSequenceSave.FromAnimationSequence(animationSequence);

                    instructionSetSaveList.AnimationSequenceSaves.Add(sequenceSave);
                    //AddSetToSave(instructionSet, instructionSetSaveList, "");
                    // TODO:
                }
                foreach (KeyValuePair <INameable, InstructionSet> kvp in EditorData.ObjectInstructionSets)
                {
                    AddSetToSave(kvp.Value, instructionSetSaveList, kvp.Key.Name);
                }

                instructionSetSaveList.SceneFileName = EditorData.BlockingScene.Name;
                instructionSetSaveList.Save(fileName);
            }

            #endregion

            #region Save the iepsx file

            fileName = FileManager.RemoveExtension(fileName) + ".iepsx";

            InstructionEditorPropertiesSave ieps = InstructionEditorPropertiesSave.FromEditorData();
            ieps.Save(fileName);

            #endregion
        }
		public static void SaveSetFileWindowOk(Window callingWindow)
        {
            string fileName = ((FileWindow)callingWindow).Results[0];

            #region Save the istx
            InstructionSetSaveList instructionSetSaveList = new FlatRedBall.Content.Instructions.InstructionSetSaveList();

            if (EditorData.BlockingScene == null)
            {
                GuiManager.ShowMessageBox("There is no scene loaded.  A scene must be loaded for the .istx to reference.", "Error saving");
            }
            else
            {
                foreach (AnimationSequence animationSequence in EditorData.GlobalInstructionSets)
                {
                    AnimationSequenceSave sequenceSave = AnimationSequenceSave.FromAnimationSequence(animationSequence);

                    instructionSetSaveList.AnimationSequenceSaves.Add(sequenceSave);
                    //AddSetToSave(instructionSet, instructionSetSaveList, "");
                    // TODO:
                }
                foreach (KeyValuePair<INameable, InstructionSet> kvp in EditorData.ObjectInstructionSets)
                {
                    AddSetToSave(kvp.Value, instructionSetSaveList, kvp.Key.Name);
                }

                instructionSetSaveList.SceneFileName = EditorData.BlockingScene.Name;
                instructionSetSaveList.Save(fileName);
            }

            #endregion

            #region Save the iepsx file

            fileName = FileManager.RemoveExtension(fileName) + ".iepsx";

            InstructionEditorPropertiesSave ieps = InstructionEditorPropertiesSave.FromEditorData();
            ieps.Save(fileName);

            #endregion

        }