private void Sort_Click(object sender, EventArgs e) { List <string> list = Alphabetize(); list.Sort(); TextList.Clear(); Publish(list); }
private void FillOptions() { _options.Clear(); string s; SingletonConfig.Instance.GetPropertyAsString("iTunesSearch", out s); _options.AddTextItem("Search: " + s); return; }
private void FillOptions() { _options.Clear(); string s; SingletonConfig.Instance.GetPropertyAsString("iTunesURL", out s); _options.AddTextItem("URL: " + s); SingletonConfig.Instance.GetPropertyAsString("iTunesPassword", out s); _options.AddTextItem("Password: " + s); return; }
// Show comics in the subscribed list private void FillAvailableComics() { _availableComics.Clear(); foreach (ComicInfo ci in SingletonComicsUpdater.Instance.AvailableComics) { CheckBoxListItem item = new CheckBoxListItem(ci.DisplayName, ci); item.CheckBoxChanged += new EventHandler(OnCheckBoxClickEvent); item.CheckBox.Checked = ci.Subscribed; _availableComics.AddItem(item); } return; }
public Text_4(Narc files, CharTable charTable) { Version = 3; TextList.Clear(); TextList.Add(new List <List <string> >()); foreach (byte[] bytes in files.Files) { BinaryReader br = new BinaryReader(new MemoryStream(bytes)); List <string> s4 = new List <string>(); bool flag2 = false; int stringCount = br.ReadUInt16(), originalKey = br.ReadUInt16(); OriginalKeys.Add(originalKey); int num = (originalKey * 0x2fd) & 0xffff; int[] numArray = new int[stringCount]; int[] numArray2 = new int[stringCount]; for (int i = 0; i < stringCount; i++) { int num2 = (num * (i + 1)) & 0xffff; int num3 = num2 | (num2 << 16); numArray[i] = br.ReadInt32(); numArray[i] = numArray[i] ^ num3; numArray2[i] = br.ReadInt32(); numArray2[i] = numArray2[i] ^ num3; } for (int j = 0; j < stringCount; j++) { int control = 0; num = (0x91bd3 * (j + 1)) & 0xffff; string text = ""; for (int k = 0; k < numArray2[j]; k++) { int num4 = br.ReadUInt16(); num4 ^= num; switch (control) { case 0: switch (num4) { case 0xE000: text += "\\n"; break; case 0x25BC: if (Version > 2) { text += "\\f"; } else { text += "\\r"; } break; case 0x25BD: if (Version > 2) { text += "\\r"; } else { text += "\\f"; } break; case 0xF100: flag2 = true; break; case 0xFFFE: text += "["; control = 1; break; case 0xFFFF: break; default: if (flag2) { int num5 = 0; int num6 = 0; string str = null; while (true) { if (num5 >= 15) { num5 -= 15; if (num5 > 0) { int num8 = num6 | (num4 << 9 - num5 & 511); if ((num8 & 255) == 255) { break; } if (num8 != 0 && num8 != 1) { char str2 = charTable.GetCharacter(num8); if (str2 == '\0') { text += "\\x" + num8.ToString("X4"); } else { text += str2; } } } } else { int num8 = num4 >> num5 & 511; if ((num8 & 255) == 255) { break; } if (num8 != 0 && num8 != 1) { char str3 = charTable.GetCharacter(num8); if (str3 == '\0') { text += "\\x" + num8.ToString("X4"); } else { text += str3; } } num5 += 9; if (num5 < 15) { num6 = num4 >> num5 & 511; num5 += 9; } num += 18749; num &= 65535; num4 = br.ReadUInt16(); num4 ^= num; k++; } } text += str; } else { char str3 = charTable.GetCharacter(num4); if (str3 == '\0') { text += "\\x" + num4.ToString("X4"); } else { text += str3; } } break; } break; case 1: text += num4.ToString("X4"); if (num4 == 0x0129) // 不知道为何,很奇怪的控制符 { control = 3; } else { control = 2; } break; case 2: control = -num4; if (control == 0) { text += "]"; } break; case 3: control = -num4 + 1; if (control == 0) { text += "]"; } break; default: text += "," + num4.ToString("X4"); control++; if (control == 0) { text += "]"; } break; } num += 18749; num &= 65535; } s4.Add(text); } TextList[0].Add(s4); } }
public void ScanObject() { if (_index > -1) { _values[0] = _names[_index]; _index++; if (_index >= _names.Count) { _index = -1; _names.Clear(); return; } } ScanWhile(WhiteSpace); AtEnd = Eof || CheckChar('.'); if (AtEnd) { SkipChar(); ScanWhile(WhiteSpace); return; } _fields.Clear(); _values.Clear(); RecordType = ScanWhile(Identifier); if (RecordType == "") { throw new GeneratorException("Empty record type: " + Buffer); } ScanWhile(WhiteSpace); if (CheckChar('=')) { SkipChar(); if (CheckChar('{')) { while (!Eof && !CheckChar('}')) { SkipChar(); // { or , ScanWhile(WhiteSpace); var name = StringOrIdentifier(); _names.Add(name); ScanWhile(WhiteSpace); } SkipChar(); _fields.Add("Name"); _values.Add(_names[0]); _index = 1; } else { var name = StringOrIdentifier(); ScanWhile(WhiteSpace); _fields.Add("Name"); _values.Add(name); if (CheckChar('[')) { ScanAttributes(); } if (Eof) { Rescan(" "); // Force processing of current record } } } else if (CheckChar('[')) { ScanAttributes(); } Progress = true; }
public Text_5(Narc files, CharTable charTable) { TextList.Clear(); TextList.Add(new List <List <string> >()); TextList.Add(new List <List <string> >()); foreach (byte[] bytes in files.Files) { BinaryReader br = new BinaryReader(new MemoryStream(bytes)); ushort numSections, numEntries, tmpCharCount, tmpUnknown, tmpChar; uint unk1, tmpOffset; uint[] sizeSections = new uint[] { 0, 0 }; uint[] sectionOffset = new uint[] { 0, 0 }; ushort key; numSections = br.ReadUInt16(); numEntries = br.ReadUInt16(); sizeSections[0] = br.ReadUInt32(); unk1 = br.ReadUInt32(); for (int i = 0; i < numSections; i++) { sectionOffset[i] = br.ReadUInt32(); } for (int i = 0; i < TextList.Count; i++) { List <string> s = new List <string>(); List <ushort> keys = new List <ushort>(); List <ushort> unknowns = new List <ushort>(); List <ushort> characterCount = new List <ushort>(); if (i < numSections) { br.BaseStream.Position = sectionOffset[i]; sizeSections[i] = br.ReadUInt32(); List <uint> tableOffsets = new List <uint>(); List <List <ushort> > encText = new List <List <ushort> >(); for (int j = 0; j < numEntries; j++) { tmpOffset = br.ReadUInt32(); tmpCharCount = br.ReadUInt16(); tmpUnknown = br.ReadUInt16(); tableOffsets.Add(tmpOffset); characterCount.Add(tmpCharCount); unknowns.Add(tmpUnknown); } for (int j = 0; j < numEntries; j++) { List <ushort> tmpEncChars = new List <ushort>(); br.BaseStream.Position = sectionOffset[i] + tableOffsets[j]; for (int k = 0; k < characterCount[j]; k++) { tmpChar = br.ReadUInt16(); tmpEncChars.Add(tmpChar); } encText.Add(tmpEncChars); key = (ushort)(encText[j][characterCount[j] - 1] ^ 0xFFFF); for (int k = characterCount[j] - 1; k >= 0; k--) { encText[j][k] ^= key; if (k == 0) { keys.Add(key); } key = (ushort)(((key >> 3) | (key << 13)) & 0xFFFF); } string line = ""; for (int k = 0; k < characterCount[j]; k++) { if (encText[j][k] > 20 && encText[j][k] <= 0xFFF0 && encText[j][k] != 0xF000) { line += (char)encText[j][k]; } else if (encText[j][k] == 0xFFFE) { line += "\\n"; } else if (encText[j][k] == 0xFFFF) { // line += "\\xFFFF"; } else if (encText[j][k] == 0xF000) { switch (encText[j][k + 1]) { case 0xBE00: line += "\\r"; break; case 0xBE01: line += "\\f"; break; default: line += $"[{encText[j][k + 1]:X4}"; for (int control = 0; control < encText[j][k + 2]; control++) { line += $",{encText[j][k + 3 + control]:X4}"; } line += "]"; break; } k += 2 + encText[j][k + 2]; } else { line += $"\\x{encText[j][k]:X4}"; } } s.Add(line); } } TextList[i].Add(s); Keys[i].Add(keys); Unknowns[i].Add(unknowns); OriginalLengths[i].Add(characterCount); } } }