1
0
mirror of https://github.com/chylex/Code-Statistics.git synced 2025-03-15 09:15:43 +01:00

Add Help button to AboutForm and replacement tokens to the About document

This commit is contained in:
chylex 2016-03-05 13:34:27 +01:00
parent fe53ff4fee
commit 00d2374e28
2 changed files with 24 additions and 4 deletions

View File

@ -40,22 +40,25 @@
this.textContents.ReadOnly = true;
this.textContents.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
this.textContents.ShortcutsEnabled = false;
this.textContents.Size = new System.Drawing.Size(269, 285);
this.textContents.Size = new System.Drawing.Size(330, 285);
this.textContents.TabIndex = 0;
this.textContents.TabStop = false;
this.textContents.Text = "";
//
// AboutForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(293, 309);
this.ClientSize = new System.Drawing.Size(354, 309);
this.Controls.Add(this.textContents);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.HelpButton = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "AboutForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.OnHelpButtonClicked);
this.ResumeLayout(false);
}

View File

@ -1,14 +1,31 @@
using CodeStatistics.Data;
using System.Collections.Generic;
using CodeStatistics.Data;
using CodeStatistics.Properties;
using System.Windows.Forms;
using System.Linq;
using System.ComponentModel;
using System.Diagnostics;
namespace CodeStatistics.Forms{
public partial class AboutForm : Form{
private static Dictionary<string,string> AboutFormData{
get{
return new Dictionary<string,string>{
{ "[version]", Application.ProductVersion }
};
}
}
public AboutForm(){
InitializeComponent();
Text = Lang.Get["TitleAbout"];
textContents.Rtf = Resources.about;
textContents.Rtf = AboutFormData.Aggregate(Resources.about,(contents, kvp) => contents.Replace(kvp.Key,kvp.Value));
}
private void OnHelpButtonClicked(object sender, CancelEventArgs e){
e.Cancel = true;
Process.Start("https://github.com/chylex/Code-Statistics/issues");
}
}
}