本文整理汇总了C#中WritingSystemDefinition类的典型用法代码示例。如果您正苦于以下问题:C# WritingSystemDefinition类的具体用法?C# WritingSystemDefinition怎么用?C# WritingSystemDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WritingSystemDefinition类属于命名空间,在下文中一共展示了WritingSystemDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IpaStatus_SetToIpaWasAlreadyIpaWithOtherVariants_NoChange
public void IpaStatus_SetToIpaWasAlreadyIpaWithOtherVariants_NoChange()
{
var ws = new WritingSystemDefinition();
ws.Variants.AddRange(new VariantSubtag[] {"1901", "biske", "fonipa"});
ws.IpaStatus = IpaStatusChoices.Ipa;
Assert.That(ws.Variants, Is.EqualTo(new VariantSubtag[] {"1901", "biske", "fonipa"}));
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:7,代码来源:WritingSystemDefinitionVariantTests.cs
示例2: GetSuggestions
public IEnumerable<IWritingSystemDefinitionSuggestion> GetSuggestions(WritingSystemDefinition primary, IEnumerable<WritingSystemDefinition> existingWritingSystemsForLanguage)
{
if (primary.Language == null && primary.Variants.Any(v => !v.IsPrivateUse))
yield break;
if (SuppressSuggestionsForMajorWorldLanguages
&& new[]{"en", "th", "es", "fr", "de", "hi", "id", "vi","my","pt", "fi", "ar", "it","sv", "ja", "ko", "ch", "nl", "ru"}.Contains((string) primary.Language))
yield break;
WritingSystemDefinition[] existingWSs = existingWritingSystemsForLanguage.ToArray();
if (SuggestIpa && IpaSuggestion.ShouldSuggest(existingWSs))
{
yield return new IpaSuggestion(_writingSystemFactory, primary);
}
if (SuggestVoice && VoiceSuggestion.ShouldSuggest(existingWSs))
{
yield return new VoiceSuggestion(_writingSystemFactory, primary);
}
if (SuggestDialects)
{
yield return new DialectSuggestion(_writingSystemFactory, primary);
}
if (SuggestOther)
{
yield return new OtherSuggestion(_writingSystemFactory, primary, existingWSs);
}
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:31,代码来源:WritingSystemSuggestor.cs
示例3: IpaStatus_SetToIpaWasAlreadyIpaWithOtherVariants_NoChange
public void IpaStatus_SetToIpaWasAlreadyIpaWithOtherVariants_NoChange()
{
var ws = new WritingSystemDefinition();
ws.Variant = "1901-biske-fonipa";
ws.IpaStatus = IpaStatusChoices.Ipa;
Assert.AreEqual("1901-biske-fonipa", ws.Variant);
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:WritingSystemDefinitionVariantTests.cs
示例4: DeleteInputSystemDialog
public DeleteInputSystemDialog(WritingSystemDefinition wsToDelete,
IEnumerable<WritingSystemDefinition> possibleWritingSystemsToConflateWith, bool showHelpButton)
{
InitializeComponent();
if (!showHelpButton)
{
_helpButton.Hide();
}
_deleteRadioButton.Text = String.Format(_deleteRadioButton.Text, DisplayName(wsToDelete));
_mergeRadioButton.Text = String.Format(_mergeRadioButton.Text, DisplayName(wsToDelete));
_wsSelectionComboBox.Items.AddRange(
possibleWritingSystemsToConflateWith.Where(ws => ws != wsToDelete).Select(ws=>new WritingSystemDisplayAdaptor(ws)).ToArray());
Choice = Choices.Delete;
if (_wsSelectionComboBox.Items.Count > 0)
{
_wsSelectionComboBox.SelectedIndex = 0;
}
_wsSelectionComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
_okButton.Click += OnOkClicked;
_cancelButton.Click += OnCancelClicked;
_deleteRadioButton.CheckedChanged += OnDeleteRadioButtonCheckedChanged;
_mergeRadioButton.CheckedChanged += OnMergeRadioButtonCheckedChanged;
_helpButton.Click += OnCustomHelpButtonClicked;
_deleteRadioButton.Checked = true;
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:25,代码来源:DeleteInputSystemDialog.cs
示例5: IpaStatus_SetToIpaWasAlreadyIpaAndOnyVariant_NoChange
public void IpaStatus_SetToIpaWasAlreadyIpaAndOnyVariant_NoChange()
{
var ws = new WritingSystemDefinition();
ws.IpaStatus = IpaStatusChoices.Ipa;
ws.Variant = "fonipa";
Assert.AreEqual("fonipa", ws.Variant);
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:WritingSystemDefinitionVariantTests.cs
示例6: Setup
public void Setup()
{
_temporaryFolder = new TemporaryFolder();
string filePath = _temporaryFolder.GetTemporaryFile();
_repository = new LiftLexEntryRepository(filePath);
_headwordWritingSystem = new WritingSystemDefinition("th");
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:LexEntryRepositoryTests.cs
示例7: TestEnvironment
public TestEnvironment()
{
_temporaryFolder = new TemporaryFolder("LiftLexEntryRepositoryTests");
string filePath = _temporaryFolder.GetTemporaryFile();
_repository = new LiftLexEntryRepository(filePath);
_headwordWritingSystem = new WritingSystemDefinition("th") {DefaultCollation = new IcuRulesCollationDefinition("standard")};
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:7,代码来源:LexEntryRepositoryTests.cs
示例8: IpaStatus_SetToIpaWhenVariantHasContents_FonIpaAtEnd
public void IpaStatus_SetToIpaWhenVariantHasContents_FonIpaAtEnd()
{
var ws = new WritingSystemDefinition();
ws.Variants.AddRange(new VariantSubtag[] {"1901", "biske"});
ws.IpaStatus = IpaStatusChoices.Ipa;
Assert.That(ws.Variants, Is.EqualTo(new VariantSubtag[] {"1901", "biske", "fonipa"}));
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:7,代码来源:WritingSystemDefinitionVariantTests.cs
示例9: IpaStatus_SetToNotIpaWhenWasOnlyVariant_FonIpaRemoved
public void IpaStatus_SetToNotIpaWhenWasOnlyVariant_FonIpaRemoved()
{
var ws = new WritingSystemDefinition();
ws.Variants.Add("fonipa");
ws.IpaStatus = IpaStatusChoices.NotIpa;
Assert.That(ws.Variants, Is.Empty);
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:7,代码来源:WritingSystemDefinitionVariantTests.cs
示例10: Read_ValidXml_SetsAllProperties
public void Read_ValidXml_SetsAllProperties()
{
const string projectSettingsXml =
@"<ProjectLexiconSettings>
<WritingSystems>
<WritingSystem id=""qaa-Qaaa-QM-x-kal-Fake-ZG-var1-var2"">
<Abbreviation>kal</Abbreviation>
<LanguageName>Kalaba</LanguageName>
<ScriptName>Fake</ScriptName>
<RegionName>Zolrog</RegionName>
<SystemCollation>snarf</SystemCollation>
</WritingSystem>
<WritingSystem id=""fr-FR"">
<SpellCheckingId>fr_FR</SpellCheckingId>
<LegacyMapping>converter</LegacyMapping>
<Keyboard>Old Keyboard</Keyboard>
</WritingSystem>
</WritingSystems>
</ProjectLexiconSettings>";
var projectSettingsDataMapper = new ProjectLexiconSettingsWritingSystemDataMapper(new MemorySettingsStore {SettingsElement = XElement.Parse(projectSettingsXml)});
var ws1 = new WritingSystemDefinition("qaa-Qaaa-QM-x-kal-Fake-ZG-var1-var2");
projectSettingsDataMapper.Read(ws1);
Assert.That(ws1.Abbreviation, Is.EqualTo("kal"));
Assert.That(ws1.Language.Name, Is.EqualTo("Kalaba"));
Assert.That(ws1.Script.Name, Is.EqualTo("Fake"));
Assert.That(ws1.Region.Name, Is.EqualTo("Zolrog"));
Assert.That(ws1.SpellCheckingId, Is.EqualTo(string.Empty));
Assert.That(ws1.LegacyMapping, Is.EqualTo(string.Empty));
Assert.That(ws1.Keyboard, Is.EqualTo(string.Empty));
var scd = new SystemCollationDefinition {LanguageTag = "snarf"};
Assert.That(ws1.DefaultCollation.ValueEquals(scd), Is.True);
var ws2 = new WritingSystemDefinition("fr-FR");
projectSettingsDataMapper.Read(ws2);
Assert.That(ws2.Abbreviation, Is.EqualTo("fr"));
Assert.That(ws2.Language.Name, Is.EqualTo("French"));
Assert.That(ws2.Script.Name, Is.EqualTo("Latin"));
Assert.That(ws2.Region.Name, Is.EqualTo("France"));
Assert.That(ws2.Variants, Is.Empty);
Assert.That(ws2.SpellCheckingId, Is.EqualTo("fr_FR"));
Assert.That(ws2.LegacyMapping, Is.EqualTo("converter"));
Assert.That(ws2.Keyboard, Is.EqualTo("Old Keyboard"));
var ws3 = new WritingSystemDefinition("es");
projectSettingsDataMapper.Read(ws3);
Assert.That(ws3.Abbreviation, Is.EqualTo("es"));
Assert.That(ws3.Language.Name, Is.EqualTo("Spanish"));
Assert.That(ws3.Script.Name, Is.EqualTo("Latin"));
Assert.That(ws3.Region, Is.Null);
Assert.That(ws3.Variants, Is.Empty);
Assert.That(ws3.SpellCheckingId, Is.EqualTo(string.Empty));
Assert.That(ws3.LegacyMapping, Is.EqualTo(string.Empty));
Assert.That(ws3.Keyboard, Is.EqualTo(string.Empty));
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:59,代码来源:ProjectLexiconSettingsWritingSystemDataMapperTests.cs
示例11: Create
public override bool Create(string ietfLanguageTag, out WritingSystemDefinition ws)
{
if (_writingSystems.TryGet(ietfLanguageTag, out ws))
return true;
ws = ConstructDefinition(ietfLanguageTag);
return true;
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:8,代码来源:TestWritingSystemFactory.cs
示例12: SetUp
public virtual void SetUp()
{
_writingSystem = new WritingSystemDefinition();
RepositoryUnderTest = CreateNewStore();
_writingSystemIdChangedEventArgs = null;
_writingSystemDeletedEventArgs = null;
_writingSystemConflatedEventArgs = null;
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:8,代码来源:WritingSystemRepositoryTests.cs
示例13: WritingSystemDefinitionForTest
private static WritingSystemDefinition WritingSystemDefinitionForTest(string languageISO, Font font)
{
var retval = new WritingSystemDefinition();
retval.Language = languageISO;
retval.DefaultFontName = font.Name;
retval.DefaultFontSize = font.Size;
return retval;
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:8,代码来源:LexEntryRepositoryCachingTests.cs
示例14: AllWritingSystems_HasAllWritingSystems_ReturnsAllWritingSystems
public void AllWritingSystems_HasAllWritingSystems_ReturnsAllWritingSystems()
{
var ws1 = new WritingSystemDefinition("fr");
ws1.IsVoice = true;
RepositoryUnderTest.Set(ws1);
RepositoryUnderTest.Set(new WritingSystemDefinition("de"));
RepositoryUnderTest.Set(new WritingSystemDefinition("es"));
Assert.IsTrue(RepositoryUnderTest.AllWritingSystems.Count() == 3);
}
开发者ID:neilmayhew,项目名称:libpalaso,代码行数:9,代码来源:IWritingSystemRepositoryTests.cs
示例15: SetTwoDefinitions_CountEquals2
public void SetTwoDefinitions_CountEquals2()
{
_writingSystem.Language = "one";
RepositoryUnderTest.Set(_writingSystem);
var ws2 = new WritingSystemDefinition();
ws2.Language = "two";
RepositoryUnderTest.Set(ws2);
Assert.AreEqual(2, RepositoryUnderTest.Count);
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:10,代码来源:IWritingSystemRepositoryTests.cs
示例16: GetSuggestions_HasNormalAndIPA_DoesNotIncludeItemToCreateIPA
[Test] // ok
public void GetSuggestions_HasNormalAndIPA_DoesNotIncludeItemToCreateIPA()
{
var etr = new WritingSystemDefinition("etr", string.Empty, string.Empty, string.Empty, "edo", false);
var etrIpa = new WritingSystemDefinition("etr", string.Empty, string.Empty, "fonipa", "edo", false);
var list = new List<WritingSystemDefinition>(new[] { etr, etrIpa });
var suggestor = new WritingSystemSuggestor(new TestWritingSystemFactory());
IEnumerable<IWritingSystemDefinitionSuggestion> suggestions = suggestor.GetSuggestions(etr, list);
Assert.That(suggestions.Any(defn => defn is IpaSuggestion), Is.False);
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:11,代码来源:WritingSystemVariantSuggestorTests.cs
示例17: Init
public void Init(WritingSystemDefinition writingSystem, String name)
{
WritingSystem = writingSystem;
_nameForLogging = name;
if (_nameForLogging == null)
{
_nameForLogging = "??";
}
Name = name;
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:10,代码来源:StdTextInputBox.cs
示例18: GetSuggestions_HasNormalAndIPA_DoesNotIncludeItemToCreateIPA
[Test] // ok
public void GetSuggestions_HasNormalAndIPA_DoesNotIncludeItemToCreateIPA()
{
var etr = new WritingSystemDefinition("etr", string.Empty, string.Empty, string.Empty, "edo", false);
var etrIpa = new WritingSystemDefinition("etr", string.Empty, string.Empty, "fonipa", "edo", false);
var list = new List<WritingSystemDefinition>(new[] { etr, etrIpa });
var suggestor = new WritingSystemSuggestor();
var suggestions = suggestor.GetSuggestions(etr, list);
Assert.IsFalse(suggestions.Any(defn => ((WritingSystemSuggestion)defn).TemplateDefinition.Variant == "fonipa"));
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:11,代码来源:WritingSystemVariantSuggestorTests.cs
示例19: Set_NewWritingSystem_SetsId
public void Set_NewWritingSystem_SetsId()
{
using (var e = new TemporaryFolder("GlobalWritingSystemRepositoryTests"))
{
var repo = new GlobalWritingSystemRepository(e.Path);
var ws = new WritingSystemDefinition("en-US");
Assert.That(ws.Id, Is.Null);
repo.Set(ws);
Assert.That(ws.Id, Is.EqualTo("en-US"));
}
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:11,代码来源:GlobalWritingSystemRepositoryTests.cs
示例20: GeckoBox
public GeckoBox(WritingSystemDefinition ws, string nameForLogging)
: this()
{
_nameForLogging = nameForLogging;
if (_nameForLogging == null)
{
_nameForLogging = "??";
}
Name = _nameForLogging;
WritingSystem = ws;
}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:11,代码来源:GeckoBox.cs
注:本文中的WritingSystemDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论