|
1 /* |
|
2 * Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 using System; |
|
19 using System.Collections.Generic; |
|
20 using System.ComponentModel; |
|
21 using System.Data; |
|
22 using System.Drawing; |
|
23 using System.Text; |
|
24 using System.Windows.Forms; |
|
25 using SymbianUtils; |
|
26 using SymbianUtils.Settings; |
|
27 |
|
28 namespace CAPluginRawStackUi.Dialogs |
|
29 { |
|
30 public partial class RawStackImportDialog : Form |
|
31 { |
|
32 #region Constructors |
|
33 public static DialogResult ShowDialog( XmlSettings aSettings, out string aFileName, out string aFilter ) |
|
34 { |
|
35 RawStackImportDialog self = new RawStackImportDialog( aSettings ); |
|
36 DialogResult result = self.ShowDialog(); |
|
37 // |
|
38 if ( result == DialogResult.OK ) |
|
39 { |
|
40 aFileName = self.iFileName; |
|
41 aFilter = self.iFilter; |
|
42 } |
|
43 else |
|
44 { |
|
45 aFileName = string.Empty; |
|
46 aFilter = string.Empty; |
|
47 } |
|
48 // |
|
49 return result; |
|
50 } |
|
51 #endregion |
|
52 |
|
53 #region Constructors |
|
54 public RawStackImportDialog( XmlSettings aSettings ) |
|
55 { |
|
56 iSettings = aSettings; |
|
57 // |
|
58 InitializeComponent(); |
|
59 } |
|
60 #endregion |
|
61 |
|
62 #region Event handlers |
|
63 private void iFBrowse_FileName_FileSelectionChanged( SymbianUtilsUi.Controls.SymbianFileControl aSelf, string aFileName ) |
|
64 { |
|
65 |
|
66 } |
|
67 |
|
68 private void iBT_Cancel_Click( object sender, EventArgs e ) |
|
69 { |
|
70 DialogResult = DialogResult.Cancel; |
|
71 Close(); |
|
72 } |
|
73 |
|
74 private void iBT_OK_Click( object sender, EventArgs e ) |
|
75 { |
|
76 iFileName = iFBrowse_FileName.EntityName; |
|
77 iFilter = iTB_FilterText.Text; |
|
78 // |
|
79 DialogResult = DialogResult.OK; |
|
80 Close(); |
|
81 } |
|
82 |
|
83 private void RawStackImportDialog_Load( object sender, EventArgs e ) |
|
84 { |
|
85 iFBrowse_FileName.EntityName = iSettings[ "RawStackImportDialog", "iFBrowse_FileName" ]; |
|
86 iSettings.Load( "RawStackImportDialog", iTB_FilterText ); |
|
87 } |
|
88 |
|
89 private void RawStackImportDialog_FormClosed( object sender, FormClosedEventArgs e ) |
|
90 { |
|
91 if ( DialogResult == DialogResult.OK ) |
|
92 { |
|
93 iSettings[ "RawStackImportDialog", "iFBrowse_FileName" ] = iFBrowse_FileName.EntityName; |
|
94 iSettings.Save( "RawStackImportDialog", iTB_FilterText ); |
|
95 } |
|
96 } |
|
97 #endregion |
|
98 |
|
99 #region Data members |
|
100 private readonly XmlSettings iSettings; |
|
101 private string iFilter = string.Empty; |
|
102 private string iFileName = string.Empty; |
|
103 #endregion |
|
104 } |
|
105 } |