📄 customemotionmanagerform.cs
字号:
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x152, 0x178);
this.panel1.TabIndex = 0;
this.panel2.Controls.Add(this.label1);
this.panel2.Location = new System.Drawing.Point(0x103, 0xfb);
this.panel2.Name = "panel2";
this.panel2.Size = new Size(0x37, 0x10);
this.panel2.TabIndex = 15;
this.label1.set_AutoSize(true);
this.label1.Dock = DockStyle.Fill;
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new Size(0x37, 13);
this.label1.TabIndex = 0x10;
this.label1.Text = "表情预览";
this.upGridView.BorderColor = Color.FromArgb(0xcb, 0xd4, 0xde);
this.upGridView.BorderInsideColor = Color.White;
this.upGridView.BorderInsideWidth = 1;
this.upGridView.BorderWidth = 1;
this.upGridView.Controls.Add(this.dgvCustomEmotionList);
this.upGridView.Location = new System.Drawing.Point(8, 30);
this.upGridView.Name = "upGridView";
this.upGridView.set_Padding(new Padding(1));
this.upGridView.Size = new Size(0xe5, 0x143);
this.upGridView.TabIndex = 0;
this.upPicture.BorderColor = Color.FromArgb(0xcb, 0xd4, 0xde);
this.upPicture.BorderInsideColor = Color.White;
this.upPicture.BorderInsideWidth = 1;
this.upPicture.BorderWidth = 1;
this.upPicture.Controls.Add(this.pbEmotion);
this.upPicture.Controls.Add(this.label2);
this.upPicture.Location = new System.Drawing.Point(0xf2, 0x103);
this.upPicture.Name = "upPicture";
this.upPicture.set_Padding(new Padding(3));
this.upPicture.Size = new Size(0x59, 0x5e);
this.upPicture.TabIndex = 13;
this.label2.Dock = DockStyle.Top;
this.label2.Location = new System.Drawing.Point(3, 3);
this.label2.Name = "label2";
this.label2.Size = new Size(0x53, 5);
this.label2.TabIndex = 13;
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
this.BackColor = Color.White;
base.BaseHeight = 0x272;
base.BaseWidth = 0x170;
base.CancelButton = this.btnOK;
base.ClientSize = new Size(0x170, 0x272);
base.Controls.Add(this.panel1);
base.Controls.Add(this.btnOK);
base.DisplayLocation = new System.Drawing.Point(15, 15);
base.DisplaySize = new Size(0x170, 0x272);
base.FormBorderStyle = FormBorderStyle.FixedSingle;
base.MinimizeBox = false;
base.Name = "CustomEmotionManagerForm";
base.set_Padding(new Padding(8));
base.StartPosition = FormStartPosition.CenterParent;
base.Text = "Fetion 2008";
base.add_FormClosed(new FormClosedEventHandler(this, (IntPtr) this.CustomEmotionManagerForm_FormClosed));
base.Load += new EventHandler(this.CustomEmotionManagerForm_Load);
this.dgvCustomEmotionList.EndInit();
this.cmsExport.ResumeLayout(false);
this.pbEmotion.EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.upGridView.ResumeLayout(false);
this.upPicture.ResumeLayout(false);
base.ResumeLayout(false);
}
private void llLastPage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.LoadCustomEmotion(this._curBegin - 30);
this.BindList();
}
private void llNextPage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.LoadCustomEmotion(this._curBegin + 30);
this.BindList();
}
private void LoadCustomEmotion(int begin)
{
try
{
this._ceCount = this._iceManager.OwnerEmotions.Count;
if (this._ceCount > 0)
{
goto Label_0035;
}
this._curPageCustomEmotionList = new List<Imps.Client.Core.CustomEmotion.CustomEmotion>();
return;
Label_002F:
begin -= 30;
Label_0035:
if (begin >= this._ceCount)
{
goto Label_002F;
}
if (begin < 0)
{
begin = 0;
}
this._curBegin = begin;
if ((this._curBegin + 30) >= this._ceCount)
{
this._curEnd = this._ceCount - 1;
}
else
{
this._curEnd = (this._curBegin + 30) - 1;
}
this._curPageCustomEmotionList = this._iceManager.OwnerEmotions.GetEmotions(this._curBegin, this._curEnd);
}
catch (Exception exception)
{
ClientLogger.WriteException("自定义表情 -> 加载列表", exception);
this._ceCount = 0;
this._curBegin = 0;
this._curEnd = 0;
this._curPageCustomEmotionList = new List<Imps.Client.Core.CustomEmotion.CustomEmotion>();
}
}
private void SetControlText()
{
this.lTitleMessage.Text = StringTable.CustomEmotions.CustomEmotionManager.TitleMessage;
this.btnAdd.Text = StringTable.CustomEmotions.CustomEmotionManager.Add;
this.btnDelete.Text = StringTable.CustomEmotions.CustomEmotionManager.Delete;
this.btnEdit.Text = StringTable.CustomEmotions.CustomEmotionManager.Edit;
this.btnImport.Text = StringTable.CustomEmotions.CustomEmotionManager.Import;
this.btnExport.Text = StringTable.CustomEmotions.CustomEmotionManager.Export;
this.tsmiExportSelected.set_Text(StringTable.CustomEmotions.CustomEmotionManager.ExportSelected);
this.tsmiExportAll.set_Text(StringTable.CustomEmotions.CustomEmotionManager.ExportAll);
this.llLastPage.Text = StringTable.CustomEmotions.CustomEmotionManager.LastPage;
this.llNextPage.Text = StringTable.CustomEmotions.CustomEmotionManager.NextPage;
this.btnOK.Text = StringTable.CustomEmotions.CustomEmotionManager.OK;
this.columnImage.set_HeaderText(StringTable.CustomEmotions.CustomEmotionManager.ImageHeaderText);
this.columnName.set_HeaderText(StringTable.CustomEmotions.CustomEmotionManager.NameHeaderText);
this.columnShotCut.set_HeaderText(StringTable.CustomEmotions.CustomEmotionManager.ShotCutHeaderText);
}
private void tsmiExportAll_Click(object sender, EventArgs e)
{
if (this._ceCount >= 1)
{
string gzipFile = this.GetSaveFilePath();
if (gzipFile != string.Empty)
{
XmlDocument listDoc = new XmlDocument();
XmlNode newChild = listDoc.CreateElement("CustomEmotions");
IList<string> fileNames = new List<string>();
List<Imps.Client.Core.CustomEmotion.CustomEmotion>.Enumerator enumerator = this._iceManager.OwnerEmotions.LstEmoitons.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Imps.Client.Core.CustomEmotion.CustomEmotion emotion = enumerator.get_Current();
string path = this.GetCustomEmotionStorePath(emotion.Id);
XmlNode node2 = listDoc.CreateElement("ce");
XmlAttribute node = listDoc.CreateAttribute("Name");
node.Value = emotion.Name;
XmlAttribute attribute2 = listDoc.CreateAttribute("ShortCut");
attribute2.Value = emotion.ShortCut;
XmlAttribute attribute3 = listDoc.CreateAttribute("FileName");
attribute3.Value = Path.GetFileName(path);
node2.Attributes.Append(node);
node2.Attributes.Append(attribute2);
node2.Attributes.Append(attribute3);
fileNames.Add(path);
newChild.AppendChild(node2);
}
}
finally
{
enumerator.Dispose();
}
listDoc.AppendChild(newChild);
try
{
GZipCompressXml.Compress(fileNames, gzipFile, listDoc);
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "表情导出成功!");
}
catch (Exception exception)
{
ClientLogger.WriteException("自定义表情 -> 导出所有", exception);
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "表情导出失败。");
}
}
}
}
private void tsmiExportSelected_Click(object sender, EventArgs e)
{
if (this.dgvCustomEmotionList.get_SelectedRows().Count >= 1)
{
string gzipFile = this.GetSaveFilePath();
if (gzipFile != string.Empty)
{
XmlDocument listDoc = new XmlDocument();
XmlNode newChild = listDoc.CreateElement("CustomEmotions");
IList<string> fileNames = new List<string>();
foreach (DataGridViewRow row in this.dgvCustomEmotionList.get_SelectedRows())
{
Imps.Client.Core.CustomEmotion.CustomEmotion emotion = row.get_Tag() as Imps.Client.Core.CustomEmotion.CustomEmotion;
string path = this.GetCustomEmotionStorePath(emotion.Id);
XmlNode node2 = listDoc.CreateElement("ce");
XmlAttribute node = listDoc.CreateAttribute("Name");
node.Value = emotion.Name;
XmlAttribute attribute2 = listDoc.CreateAttribute("ShortCut");
attribute2.Value = emotion.ShortCut;
XmlAttribute attribute3 = listDoc.CreateAttribute("FileName");
attribute3.Value = Path.GetFileName(path);
node2.Attributes.Append(node);
node2.Attributes.Append(attribute2);
node2.Attributes.Append(attribute3);
fileNames.Add(path);
newChild.AppendChild(node2);
}
listDoc.AppendChild(newChild);
try
{
GZipCompressXml.Compress(fileNames, gzipFile, listDoc);
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "表情导出成功!");
}
catch (Exception exception)
{
ClientLogger.WriteException("自定义表情 -> 导出选择", exception);
this._frameworkWin.UnifiedMessageBox.ShowInfo(this, "表情导出失败。");
}
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -