Пример #1
0
 private void InitializeProjectSharingTab()
 {
     m_projectLexiconSettingsDataMapper =
         new ProjectLexiconSettingsDataMapper(m_cache.ServiceLocator.DataSetup.ProjectSettingsStore);
     m_projectLexiconSettings = new ProjectLexiconSettings();
     m_projectLexiconSettingsDataMapper.Read(m_projectLexiconSettings);
     m_enableProjectSharingCheckBox.Checked = m_projectLexiconSettings.ProjectSharing;
 }
		public void Read_EmptyXml_NothingSet()
		{
			var projectSettingsDataMapper = new ProjectLexiconSettingsDataMapper(new MemorySettingsStore());

			var settings = new ProjectLexiconSettings();
			projectSettingsDataMapper.Read(settings);

			Assert.That(settings.AddWritingSystemsToSldr, Is.False);
		}
Пример #3
0
		/// <summary/>
		public static bool IsProjectSharingEnabled(string projectFolder)
		{
			ISettingsStore settingStore =
				new FileSettingsStore(LexiconSettingsFileHelper.GetProjectLexiconSettingsPath(projectFolder));
			var settingsMapper = new ProjectLexiconSettingsDataMapper(settingStore);
			var settings = new ProjectLexiconSettings();
			settingsMapper.Read(settings);
			return settings.ProjectSharing;
		}
        public void Read_EmptyXml_NothingSet()
        {
            var projectSettingsDataMapper = new ProjectLexiconSettingsDataMapper(new MemorySettingsStore());

            var settings = new ProjectLexiconSettings();

            projectSettingsDataMapper.Read(settings);

            Assert.That(settings.AddWritingSystemsToSldr, Is.False);
        }
		public void Read_ValidXml_SetsAllProperties()
		{
			const string projectSettingsXml =
@"<ProjectLexiconSettings>
  <WritingSystems addToSldr=""true"">
    <WritingSystem id=""fr-FR"">
      <SpellCheckingId>fr_FR</SpellCheckingId>
      <LegacyMapping>converter</LegacyMapping>
      <Keyboard>Old Keyboard</Keyboard>
    </WritingSystem>
  </WritingSystems>
</ProjectLexiconSettings>";

			var projectSettingsDataMapper = new ProjectLexiconSettingsDataMapper(new MemorySettingsStore {SettingsElement = XElement.Parse(projectSettingsXml)});

			var settings = new ProjectLexiconSettings();
			projectSettingsDataMapper.Read(settings);
			Assert.That(settings.AddWritingSystemsToSldr, Is.True);
		}
        public void Read_ValidXml_SetsAllProperties()
        {
            const string projectSettingsXml =
                @"<ProjectLexiconSettings>
  <WritingSystems addToSldr=""true"">
    <WritingSystem id=""fr-FR"">
      <SpellCheckingId>fr_FR</SpellCheckingId>
      <LegacyMapping>converter</LegacyMapping>
      <Keyboard>Old Keyboard</Keyboard>
    </WritingSystem>
  </WritingSystems>
</ProjectLexiconSettings>";

            var projectSettingsDataMapper = new ProjectLexiconSettingsDataMapper(new MemorySettingsStore {
                SettingsElement = XElement.Parse(projectSettingsXml)
            });

            var settings = new ProjectLexiconSettings();

            projectSettingsDataMapper.Read(settings);
            Assert.That(settings.AddWritingSystemsToSldr, Is.True);
        }