Add caption to End-User License Aggreement form

Added LastVersion to config to present EULA on version change
Display EULA when version changes
Added Property to change button label (Agree for EULA)
Changed DialogResult to OK for OK Button.
This commit is contained in:
Rich 2012-04-18 17:18:11 +00:00
parent 62368e725b
commit 628e9cf390
7 changed files with 71 additions and 5 deletions

View File

@ -148,6 +148,7 @@ namespace VEPROMS
{
string strEULA = System.Environment.CurrentDirectory + "\\EULA.TXT";
frmViewTextFile ViewFile = new frmViewTextFile(strEULA,RichTextBoxStreamType.PlainText);
ViewFile.Text = "End-User License Agreement";
ViewFile.ShowDialog();
}

View File

@ -128,6 +128,15 @@
<setting name="SaveTreeviewExpanded" serializeAs="String">
<value>True</value>
</setting>
<setting name="QATItems" serializeAs="String">
<value />
</setting>
<setting name="DefaultDB" serializeAs="String">
<value />
</setting>
<setting name="LastVersion" serializeAs="String">
<value>0.0</value>
</setting>
</VEPROMS.Properties.Settings>
<UISampleNetBar1.Properties.Settings>
<setting name="ShowDefaultFolderProp" serializeAs="String">

View File

@ -255,5 +255,17 @@ namespace VEPROMS.Properties {
this["DefaultDB"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0.0")]
public string LastVersion {
get {
return ((string)(this["LastVersion"]));
}
set {
this["LastVersion"] = value;
}
}
}
}

View File

@ -62,5 +62,8 @@
<Setting Name="DefaultDB" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="LastVersion" Type="System.String" Scope="User">
<Value Profile="(Default)">0.0</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -426,7 +426,46 @@ namespace VEPROMS
displaySearch1.Enter += new EventHandler(displaySearch1_Enter);
displayHistory.Enter += new EventHandler(displayHistory_Enter);
ctrlAnnotationDetails.Enter += new EventHandler(ctrlAnnotationDetails_Enter);
RunAutomatic();
Application.DoEvents();
if (RunningNewRevision && ShowEULA() != DialogResult.OK)
{
Timer tmrShutDown = new Timer();
tmrShutDown.Interval = 250;
tmrShutDown.Tick += new EventHandler(tmrShutDown_Tick);
tmrShutDown.Enabled = true;
}
else
RunAutomatic();
}
void tmrShutDown_Tick(object sender, EventArgs e)
{
(sender as Timer).Enabled = false;
this.Close();
}
private DialogResult ShowEULA()
{
string strEULA = System.Environment.CurrentDirectory + "\\EULA.TXT";
frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText);
ViewFile.Text = "End-User License Agreement";
ViewFile.ButtonText = "Agree";
if (ViewFile.ShowDialog() == DialogResult.OK)
{
System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
string thisVersion = ver.Major.ToString() + "." + ver.Minor.ToString();
Properties.Settings.Default.LastVersion = thisVersion;
return DialogResult.OK;
}
return DialogResult.Cancel;
}
private bool RunningNewRevision
{
get
{
string lastVersion = Properties.Settings.Default.LastVersion;
System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
string thisVersion = ver.Major.ToString() + "." + ver.Minor.ToString();
return thisVersion != lastVersion;
}
}
void displayHistory_Enter(object sender, EventArgs e)
{

View File

@ -48,7 +48,7 @@ namespace Volian.Controls.Library
this.buttonX1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.buttonX1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonX1.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.buttonX1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonX1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonX1.Location = new System.Drawing.Point(559, 691);
this.buttonX1.Name = "buttonX1";

View File

@ -13,20 +13,22 @@ namespace Volian.Controls.Library
{
string _FileName;
RichTextBoxStreamType _RTBType;
//public string FileName
//{
// get { return _FileName; }
// set { _FileName = value; }
//}
public string ButtonText
{
get { return buttonX1.Text; }
set { buttonX1.Text = value; }
}
public frmViewTextFile(string filename, RichTextBoxStreamType rtbtype)
{
_FileName = filename;
_RTBType = rtbtype;
InitializeComponent();
}
private void frmViewTextFile_Load(object sender, EventArgs e)
{
if (File.Exists(_FileName))