Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /********************************************************************* |
2 | * |
||
3 | * Advanced Options dialog for MPFS21 |
||
4 | * |
||
5 | ********************************************************************* |
||
6 | * FileName: AdvancedOptions.cs |
||
7 | * Dependencies: Microsoft .NET Framework 2.0 |
||
8 | * Processor: x86 |
||
9 | * Complier: Microsoft Visual C# 2008 Express Edition |
||
10 | * Company: Microchip Technology, Inc. |
||
11 | * |
||
12 | * Software License Agreement |
||
13 | * |
||
14 | * This software is owned by Microchip Technology Inc. ("Microchip") |
||
15 | * and is supplied to you for use exclusively as described in the |
||
16 | * associated software agreement. This software is protected by |
||
17 | * software and other intellectual property laws. Any use in |
||
18 | * violation of the software license may subject the user to criminal |
||
19 | * sanctions as well as civil liability. Copyright 2008 Microchip |
||
20 | * Technology Inc. All rights reserved. |
||
21 | * |
||
22 | * |
||
23 | * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT |
||
24 | * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT |
||
25 | * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A |
||
26 | * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
||
27 | * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR |
||
28 | * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF |
||
29 | * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS |
||
30 | * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE |
||
31 | * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER |
||
32 | * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT |
||
33 | * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE. |
||
34 | * |
||
35 | * |
||
36 | * Author Date Comment |
||
37 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
38 | * Elliott Wood 4/17/2008 Original |
||
39 | ********************************************************************/ |
||
40 | using System; |
||
41 | using System.Collections.Generic; |
||
42 | using System.ComponentModel; |
||
43 | using System.Data; |
||
44 | using System.Drawing; |
||
45 | using System.Text; |
||
46 | using System.Windows.Forms; |
||
47 | |||
48 | namespace MPFS21 |
||
49 | { |
||
50 | public partial class AdvancedOptions : Form |
||
51 | { |
||
52 | public AdvancedOptions() |
||
53 | { |
||
54 | InitializeComponent(); |
||
55 | } |
||
56 | |||
57 | private void radMPFS2_CheckedChanged(object sender, EventArgs e) |
||
58 | { |
||
59 | pnlMPFS2.Visible = radMPFS2.Checked; |
||
60 | pnlMPFSClassic.Visible = radMPFSClassic.Checked; |
||
61 | } |
||
62 | |||
63 | /// <summary> |
||
64 | /// Restores the default settings |
||
65 | /// </summary> |
||
66 | /// <param name="sender"></param> |
||
67 | /// <param name="e"></param> |
||
68 | private void btnDefaults_Click(object sender, EventArgs e) |
||
69 | { |
||
70 | radMPFS2.Checked = true; |
||
71 | txtReserveBlockClassic.Text = "64"; |
||
72 | txtDynamicFiles.Text = "*.htm, *.html, *.cgi, *.xml"; |
||
73 | txtNoCompress.Text = "*.inc, snmp.bib"; |
||
74 | } |
||
75 | |||
76 | /// <summary> |
||
77 | /// Do manual data marshalling |
||
78 | /// </summary> |
||
79 | /// <param name="sender"></param> |
||
80 | /// <param name="e"></param> |
||
81 | private void AdvancedOptions_Load(object sender, EventArgs e) |
||
82 | { |
||
83 | // Manual data marshalling |
||
84 | if (Settings.Default.OutputVersion == 1) |
||
85 | radMPFSClassic.Checked = true; |
||
86 | else |
||
87 | radMPFS2.Checked = true; |
||
88 | txtReserveBlockClassic.Text = Settings.Default.ReserveBlockClassic.ToString(); |
||
89 | txtDynamicFiles.Text = Settings.Default.DynamicFiles; |
||
90 | txtNoCompress.Text = Settings.Default.NoCompressFiles; |
||
91 | } |
||
92 | |||
93 | /// <summary> |
||
94 | /// Do manual marshalling data back to settings file |
||
95 | /// </summary> |
||
96 | /// <param name="sender"></param> |
||
97 | /// <param name="e"></param> |
||
98 | private void btnOK_Click(object sender, EventArgs e) |
||
99 | { |
||
100 | if (radMPFSClassic.Checked) |
||
101 | Settings.Default.OutputVersion = 1; |
||
102 | else |
||
103 | Settings.Default.OutputVersion = 2; |
||
104 | Settings.Default.ReserveBlockClassic = Convert.ToInt32(txtReserveBlockClassic.Text); |
||
105 | Settings.Default.DynamicFiles = txtDynamicFiles.Text; |
||
106 | Settings.Default.NoCompressFiles = txtNoCompress.Text; |
||
107 | } |
||
108 | } |
||
109 | } |
Powered by WebSVN v2.8.3