C#多功能成语字典。这是一个用C#完成的多功能成语字典。

时间:2012-04-26 12:04:34
【文件属性】:

文件名称:C#多功能成语字典。这是一个用C#完成的多功能成语字典。

文件大小:1.28MB

文件格式:RAR

更新时间:2012-04-26 12:04:34

成语字典 C#

namespace CYBrowse { #region DateFileHeadStruct ///

/// Defines head struct to read the date file. /// public struct TagIdiomLibraryHead { public string idiomFlag; //6 byte public int idiomLength; //4 byte public int idiomCount; //3 byte public int[] idiomPositon; //3 byte } #endregion DateFileHeadStruct #region ListViewColumnNameEnum enum ListViewColumnName { ColumnIdiom = 0,//成语 ColumnCode = 1,//拼音简码 ColumnRecordNumber = 2//编号 }; #endregion ListViewColumnNameEnum /// /// Defines the idiom dictionary main form. /// public partial class IdiomDictionary : Form { /// /// The max length of an idiom. /// const int idiomMaxLength = 36; public const string helpFileName = @"\ReadMe.txt"; /// /// Declares the idiom dictionary set. /// public IdiomDictionarySet idiomDictionarySet; /// /// The index table constructed by the first word in each idiom. /// public char[] firstWordConstructedIndexTable; /// /// Represents the index table's count. /// public int firstWordConstructedIndexTableCount; #region Constructor public IdiomDictionary() { idiomDictionarySet = new IdiomDictionarySet(); InitializeComponent(); } #endregion Constructor /// /// Invokes this method when IdiomDictionary Form loads. /// private void IdiomDictionaryLoad(object sender, EventArgs e) { idiomDictionarySet.SetIdiomLibraryBuffer(); firstWordConstructedIndexTable = new char[idiomDictionarySet.idiomLibraryHead.idiomCount]; firstWordConstructedIndexTableCount = 0; listView.Columns.Add("成语",180); listView.Columns.Add("拼音简码", 80); listView.Columns.Add("编号", 60); listView.Sorting = SortOrder.Ascending; listView.BeginUpdate(); for (int i = 0; i < idiomDictionarySet.idiomLibraryHead.idiomCount; i++) { ListViewItem listViewItem= new ListViewItem(); idiomDictionarySet.Move(i); listViewItem.SubItems.Clear(); listViewItem.SubItems[0].Text = (string)idiomDictionarySet.m_CM.Clone(); listViewItem.SubItems.Add(idiomDictionarySet.m_PYCODE); listViewItem.Tag = i; listView.Items.Add(listViewItem); } comboBoxFirst.BeginUpdate(); for (int i = 0; i < idiomDictionarySet.idiomLibraryHead.idiomCount; i++) { listView.Items[i].SubItems.Add((i + 1).ToString()); char ch = listView.Items[i].SubItems[0].Text[0]; if (firstWordConstructedIndexTableCount == 0 || firstWordConstructedIndexTable[firstWordConstructedIndexTableCount - 1] != ch) { firstWordConstructedIndexTable[firstWordConstructedIndexTableCount] = ch; comboBoxFirst.Items.Add(ch); firstWordConstructedIndexTableCount++; } }


【文件预览】:
CYBrowse
----CYBrowse.suo(23KB)
----CYBrowse.sln(913B)
----CYBrowse()
--------MForm.cs(38KB)
--------bin()
--------CYBrowse.csproj(5KB)
--------obj()
--------Resources()
--------Properties()
--------Program.cs(470B)
--------MForm.resx(64KB)
--------MForm.Designer.cs(32KB)
--------CYBrowse.csproj.user(535B)

网友评论