Пример #1
0
        public void SaveRequiresThirdParamForBrainz()
        {
            string tempFileName = GetTempFileNameWithExt(".brainz");

            Assert.Throws <ArgumentNullException>(() =>
                                                  ProjectLoader.SaveProject(tempFileName, "foobar", null));
        }
Пример #2
0
        public void SavesSomethingZipped()
        {
            string tempFileName = GetTempFileNameWithExt(".brainz");

            ProjectLoader.SaveProject(tempFileName, "foobar", GetDataPath());

            Assert.True(File.Exists(tempFileName));
        }
Пример #3
0
        public void SavesSomething()
        {
            string tempFileName = GetTempFileNameWithExt(".brain");

            ProjectLoader.SaveProject(tempFileName, "foobar", null);

            Assert.True(File.Exists(tempFileName));
        }
Пример #4
0
        public void SavesAndLoadsZippedBrain()
        {
            string tempFileName = GetTempFileNameWithExt(".brainz");

            ProjectLoader.SaveProject(tempFileName, "something_zipped", GetDataPath());

            string content = ProjectLoader.LoadProject(tempFileName, GetDataPath());

            Assert.Equal("something_zipped", content);
        }
    public void SaveProject()
    {
        Action onStop = delegate
        {
            MapEditor.StopEditing();
            ProjectLoader.SaveProject();
        };

        NodeEditor.StopEditing(onStop);
    }
Пример #6
0
 /// <summary>
 /// Saves project to given path
 /// </summary>
 /// <param name="path">Path for saving .brain/.brainz file</param>
 public void SaveProject(string path)
 {
     MyLog.INFO.WriteLine("Saving project: " + path);
     try
     {
         string fileContent = Project.Serialize(Path.GetDirectoryName(path));
         ProjectLoader.SaveProject(path, fileContent,
                                   MyMemoryBlockSerializer.GetTempStorage(Project));
     }
     catch (Exception e)
     {
         MyLog.ERROR.WriteLine("Project saving failed: " + e.Message);
         throw;
     }
 }
Пример #7
0
        private void SaveProject(object sender, EventArgs e)
        {
            try
            {
                if (!IsProjectSelected(_errorsList.SelectedItems))
                {
                    return;
                }

                var loader = new ProjectLoader();                 // REVIEW: DI
                loader.SaveProject(CurrentProject, CurrentProject.FullPath);

                CleanErrorListAfterSaveProject();
            }
            catch (Exception ex)
            {
                ShowError(ex.ToString(), ErrorsResources.ErrorSavingProjects);
            }
        }
Пример #8
0
        /// <summary>
        /// Saves project to given path
        /// </summary>
        /// <param name="path">Path for saving .brain/.brainz file</param>
        public void SaveProject(string path = null)
        {
            if (!string.IsNullOrEmpty(path))
            {
                Project.FileName = path;
            }

            MyLog.INFO.WriteLine("Saving project: " + Project.FileName);
            try
            {
                string fileContent = Project.Serialize();
                ProjectLoader.SaveProject(Project.FileName, fileContent,
                                          MyMemoryBlockSerializer.GetTempStorage(Project));
            }
            catch (Exception e)
            {
                MyLog.ERROR.WriteLine("Project saving failed: " + e.Message);
                throw;
            }
        }