Beispiel #1
0
      /// <summary>
    /// Writes the specified item with the specified id.
    /// </summary>
    /// <param name="item">The item.</param>
    public void Write(MainModel item)
    {
      string path = this.fileSystem.Path.Combine(this.dataDirectory, entitiesNameV1 + ".xml");

      using (var stream = this.fileSystem.File.Create(path))
      {
        stream.Serialize(item);
      }
    }
    /// <summary>
    /// Writes the specified item with the specified id.
    /// </summary>
    /// <param name="item">The item.</param>
    public void Write(MainModel item)
    {
      string path = Path.Combine(this.dataDirectory, entitiesNameV1 + ".xml");

      using (FileStream stream = new FileStream(path, FileMode.Create))
      {
        stream.Serialize(item);
      }
    }
        public void SaveToSettings()
        {
            MainModel mainModel = new MainModel
                                      {
                                          FeatureDirectory = this.featureFolder,
                                          OutputDirectory = this.outputFolder,
                                          ProjectName = this.projectName,
                                          ProjectVersion = this.projectVersion,
                                          IncludeTestResults = this.includeTests,
                                          TestResultsFile = this.testResultsFile,
                                          TestResultsFormat = this.testResultsFormats.Selected,
                                          SelectedLanguageLcid = this.selectedLanguage.LCID,
                                          DocumentationFormats = this.documentationFormats.Where(item => item.IsSelected).Select(item => item.Item).ToArray()
                                      };

            this.mainModelSerializer.Write(mainModel);
        }