1 |
cycrow |
1 |
#pragma once
|
|
|
2 |
|
|
|
3 |
using namespace System;
|
|
|
4 |
using namespace System::ComponentModel;
|
|
|
5 |
using namespace System::Collections;
|
|
|
6 |
using namespace System::Windows::Forms;
|
|
|
7 |
using namespace System::Data;
|
|
|
8 |
using namespace System::Drawing;
|
|
|
9 |
|
|
|
10 |
namespace SpkExplorer {
|
|
|
11 |
|
|
|
12 |
/// <summary>
|
|
|
13 |
/// Summary for ConvertFile
|
|
|
14 |
///
|
|
|
15 |
/// WARNING: If you change the name of this class, you will need to change the
|
|
|
16 |
/// 'Resource File Name' property for the managed resource compiler tool
|
|
|
17 |
/// associated with all .resx files this class depends on. Otherwise,
|
|
|
18 |
/// the designers will not be able to interact properly with localized
|
|
|
19 |
/// resources associated with this form.
|
|
|
20 |
/// </summary>
|
|
|
21 |
public ref class ConvertFile : public System::Windows::Forms::Form
|
|
|
22 |
{
|
|
|
23 |
public:
|
|
|
24 |
ConvertFile(String ^file)
|
|
|
25 |
{
|
|
|
26 |
InitializeComponent();
|
|
|
27 |
|
|
|
28 |
this->label2->Text = file;
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
protected:
|
|
|
32 |
/// <summary>
|
|
|
33 |
/// Clean up any resources being used.
|
|
|
34 |
/// </summary>
|
|
|
35 |
~ConvertFile()
|
|
|
36 |
{
|
|
|
37 |
if (components)
|
|
|
38 |
{
|
|
|
39 |
delete components;
|
|
|
40 |
}
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
private:
|
|
|
44 |
/// <summary>
|
|
|
45 |
/// Required designer variable.
|
|
|
46 |
/// </summary>
|
|
|
47 |
private: System::ComponentModel::BackgroundWorker ^ backgroundWorker1;
|
|
|
48 |
private: System::Windows::Forms::Panel^ panel1;
|
|
|
49 |
private: System::Windows::Forms::ProgressBar^ progressBar1;
|
|
|
50 |
private: System::Windows::Forms::Label^ label1;
|
|
|
51 |
private: System::Windows::Forms::Label^ label2;
|
|
|
52 |
System::ComponentModel::Container ^components;
|
|
|
53 |
|
|
|
54 |
#pragma region Windows Form Designer generated code
|
|
|
55 |
/// <summary>
|
|
|
56 |
/// Required method for Designer support - do not modify
|
|
|
57 |
/// the contents of this method with the code editor.
|
|
|
58 |
/// </summary>
|
|
|
59 |
void InitializeComponent(void)
|
|
|
60 |
{
|
|
|
61 |
this->backgroundWorker1 = (gcnew System::ComponentModel::BackgroundWorker());
|
|
|
62 |
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
|
|
|
63 |
this->label1 = (gcnew System::Windows::Forms::Label());
|
|
|
64 |
this->label2 = (gcnew System::Windows::Forms::Label());
|
|
|
65 |
this->panel1 = (gcnew System::Windows::Forms::Panel());
|
|
|
66 |
this->panel1->SuspendLayout();
|
|
|
67 |
this->SuspendLayout();
|
|
|
68 |
//
|
|
|
69 |
// backgroundWorker1
|
|
|
70 |
//
|
|
|
71 |
this->backgroundWorker1->DoWork += gcnew System::ComponentModel::DoWorkEventHandler(this, &ConvertFile::backgroundWorker1_DoWork);
|
|
|
72 |
this->backgroundWorker1->RunWorkerCompleted += gcnew System::ComponentModel::RunWorkerCompletedEventHandler(this, &ConvertFile::backgroundWorker1_RunWorkerCompleted);
|
|
|
73 |
//
|
|
|
74 |
// progressBar1
|
|
|
75 |
//
|
|
|
76 |
this->progressBar1->Dock = System::Windows::Forms::DockStyle::Bottom;
|
|
|
77 |
this->progressBar1->Location = System::Drawing::Point(5, 87);
|
|
|
78 |
this->progressBar1->Name = L"progressBar1";
|
|
|
79 |
this->progressBar1->Size = System::Drawing::Size(407, 30);
|
|
|
80 |
this->progressBar1->Style = System::Windows::Forms::ProgressBarStyle::Marquee;
|
|
|
81 |
this->progressBar1->TabIndex = 0;
|
|
|
82 |
//
|
|
|
83 |
// label1
|
|
|
84 |
//
|
|
|
85 |
this->label1->Dock = System::Windows::Forms::DockStyle::Top;
|
|
|
86 |
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
|
|
|
87 |
static_cast<System::Byte>(0)));
|
|
|
88 |
this->label1->Location = System::Drawing::Point(5, 5);
|
|
|
89 |
this->label1->Name = L"label1";
|
|
|
90 |
this->label1->Size = System::Drawing::Size(407, 36);
|
|
|
91 |
this->label1->TabIndex = 1;
|
|
|
92 |
this->label1->Text = L"Converting File";
|
|
|
93 |
this->label1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
|
|
|
94 |
//
|
|
|
95 |
// label2
|
|
|
96 |
//
|
|
|
97 |
this->label2->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
98 |
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point,
|
|
|
99 |
static_cast<System::Byte>(0)));
|
|
|
100 |
this->label2->Location = System::Drawing::Point(5, 41);
|
|
|
101 |
this->label2->Name = L"label2";
|
|
|
102 |
this->label2->Size = System::Drawing::Size(407, 46);
|
|
|
103 |
this->label2->TabIndex = 2;
|
|
|
104 |
this->label2->Text = L"label2";
|
|
|
105 |
this->label2->TextAlign = System::Drawing::ContentAlignment::MiddleCenter;
|
|
|
106 |
//
|
|
|
107 |
// panel1
|
|
|
108 |
//
|
|
|
109 |
this->panel1->BackColor = System::Drawing::SystemColors::Control;
|
|
|
110 |
this->panel1->Controls->Add(this->label2);
|
|
|
111 |
this->panel1->Controls->Add(this->progressBar1);
|
|
|
112 |
this->panel1->Controls->Add(this->label1);
|
|
|
113 |
this->panel1->Dock = System::Windows::Forms::DockStyle::Fill;
|
|
|
114 |
this->panel1->Location = System::Drawing::Point(5, 5);
|
|
|
115 |
this->panel1->Margin = System::Windows::Forms::Padding(5);
|
|
|
116 |
this->panel1->Name = L"panel1";
|
|
|
117 |
this->panel1->Padding = System::Windows::Forms::Padding(5);
|
|
|
118 |
this->panel1->Size = System::Drawing::Size(417, 122);
|
|
|
119 |
this->panel1->TabIndex = 3;
|
|
|
120 |
//
|
|
|
121 |
// ConvertFile
|
|
|
122 |
//
|
|
|
123 |
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
|
|
|
124 |
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
|
|
|
125 |
this->BackColor = System::Drawing::SystemColors::ControlDark;
|
|
|
126 |
this->ClientSize = System::Drawing::Size(427, 132);
|
|
|
127 |
this->ControlBox = false;
|
|
|
128 |
this->Controls->Add(this->panel1);
|
|
|
129 |
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
|
|
|
130 |
this->Name = L"ConvertFile";
|
|
|
131 |
this->Padding = System::Windows::Forms::Padding(5);
|
|
|
132 |
this->ShowIcon = false;
|
|
|
133 |
this->ShowInTaskbar = false;
|
|
|
134 |
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterParent;
|
|
|
135 |
this->Text = L"ConvertFile";
|
|
|
136 |
this->Load += gcnew System::EventHandler(this, &ConvertFile::ConvertFile_Load);
|
|
|
137 |
this->panel1->ResumeLayout(false);
|
|
|
138 |
this->ResumeLayout(false);
|
|
|
139 |
|
|
|
140 |
}
|
|
|
141 |
#pragma endregion
|
|
|
142 |
private: System::Void ConvertFile_Load(System::Object^ sender, System::EventArgs^ e) {
|
|
|
143 |
this->backgroundWorker1->RunWorkerAsync();
|
|
|
144 |
|
|
|
145 |
}
|
|
|
146 |
private: System::Void backgroundWorker1_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) {
|
|
|
147 |
System::Threading::Thread::Sleep(100);
|
|
|
148 |
CXspFile *xsp = new CXspFile;
|
218 |
cycrow |
149 |
Utils::WString sFile = _WS(this->label2->Text);
|
|
|
150 |
if ( xsp->convertOld(sFile) )
|
1 |
cycrow |
151 |
{
|
175 |
cycrow |
152 |
if ( xsp->writeFile(sFile) )
|
1 |
cycrow |
153 |
this->DialogResult = Windows::Forms::DialogResult::OK;
|
|
|
154 |
}
|
|
|
155 |
|
|
|
156 |
delete xsp;
|
|
|
157 |
}
|
|
|
158 |
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^ sender, System::ComponentModel::RunWorkerCompletedEventArgs^ e) {
|
|
|
159 |
this->Close();
|
|
|
160 |
}
|
|
|
161 |
};
|
|
|
162 |
}
|