SIL.FieldWorks.UnicodeCharEditor.PUAInstaller.WriteBidiCodepointBlock C# (CSharp) Méthode

WriteBidiCodepointBlock() private méthode

Write a codepoint block, inserting the necessary codepoints properly.
private WriteBidiCodepointBlock ( TextWriter writer, string originalBeginningCode, string originalEndCode, List codepointsWithinRange, string generalCategory, string firstName, string lastName, bool add ) : void
writer System.IO.TextWriter DerivedBidiClass.txt file to write lines to.
originalBeginningCode string First codepoint in the block
originalEndCode string Last codepoint in the free block
codepointsWithinRange List An array of codepoints within the block, including the ends. /// DO NOT pass in points external to the free block.
generalCategory string The field that appears directly after the name in UnicodeData.txt. /// This will appear as the first element in a comment.
firstName string The name of the first letter in the range, for the comment
lastName string The name of the last letter in the range, for the comment
add bool true for add false for delete.
Résultat void
		private void WriteBidiCodepointBlock(TextWriter writer, string originalBeginningCode, string originalEndCode,
			List<IUcdCharacter> codepointsWithinRange,
			string generalCategory, string firstName, string lastName, bool add)
		{
			//Allows us to store the original end and beginning code points while looping
			//through them
			var beginningCode = originalBeginningCode;
			var endCode = originalEndCode;

			//Write each entry
			foreach (var ucdCharacter in codepointsWithinRange)
			{
				//If the current xmlCodepoint is the same as the beginning codepoint
				if (ucdCharacter.CompareTo(beginningCode) == 0)
				{
					//Shift the beginning down one
					beginningCode = AddHex(beginningCode, 1);
					//Add or delete the character
					AddUCDLine(writer, ucdCharacter, add);
				}
				//If the current xmlCodepoint is between the beginning and end
				else if (ucdCharacter.CompareTo(endCode) != 0)
				{
					if (originalBeginningCode == beginningCode)
					{
						//We're writing a range block below the current xmlCodepoint
						WriteBidiRange(writer, beginningCode,
							AddHex(ucdCharacter.CodePoint, -1),
							generalCategory, firstName, "???", ucdCharacter.Property);
					}
					else
					{
						//We're writing a range block below the current xmlCodepoint
						WriteBidiRange(writer, beginningCode,
							AddHex(ucdCharacter.CodePoint, -1),
							generalCategory, "???", "???", ucdCharacter.Property);
					}
					AddUCDLine(writer, ucdCharacter, add);
					//Set the beginning code to be right after the ucdCharacterthat we just added
					beginningCode = AddHex(ucdCharacter.CodePoint, 1);
				}
				//If the current xmlCodepoint is the same as the end codepoint
				else
				{
					//Moves the end down a codepoint address
					endCode = AddHex(endCode, -1);
					//Write our range of data
					WriteBidiRange(writer, beginningCode, endCode, generalCategory, "???", "???",
						ucdCharacter.Property);
					//Writes the current line
					AddUCDLine(writer, ucdCharacter, add);
					return;
				}
			}
			//Write our range of data
			WriteBidiRange(writer, beginningCode, endCode, generalCategory, "???", lastName,
				codepointsWithinRange[0].Property);
		}