コード例 #1
0
ファイル: MainFrm.cs プロジェクト: shangdawei/MiFlash
 private void InitializeComponent()
 {
     components         = new Container();
     txtPath            = new TextBox();
     btnBrwDic          = new Button();
     fbdSelect          = new FolderBrowserDialog();
     btnRefresh         = new Button();
     btnFlash           = new Button();
     devicelist         = new ListView();
     clnID              = new ColumnHeader();
     clnDevice          = new ColumnHeader();
     clnProgress        = new ColumnHeader();
     clnTime            = new ColumnHeader();
     clnStatus          = new ColumnHeader();
     clnResult          = new ColumnHeader();
     txtLog             = new RichTextBox();
     timer_updateStatus = new System.Windows.Forms.Timer(components);
     statusStrp         = new StatusStrip();
     statusLblMsg       = new ToolStripStatusLabel();
     statusTab          = new ToolStripStatusLabel();
     rdoCleanAll        = new RadioStripItem();
     rdoSaveUserData    = new RadioStripItem();
     rdoCleanAllAndLock = new RadioStripItem();
     lblMD5             = new Label();
     menuStrip1         = new MenuStrip();
     miConfiguration    = new ToolStripMenuItem();
     miFlashConfigurationToolStripMenuItem = new ToolStripMenuItem();
     statusStrp.SuspendLayout();
     menuStrip1.SuspendLayout();
     SuspendLayout();
     //
     // txtPath
     //
     txtPath.Anchor = (((AnchorStyles.Top | AnchorStyles.Bottom)
                        | AnchorStyles.Left)
                       | AnchorStyles.Right);
     txtPath.Location = new Point(98, 33);
     txtPath.Name     = "txtPath";
     txtPath.Size     = new Size(668, 20);
     txtPath.TabIndex = 0;
     //
     // btnBrwDic
     //
     btnBrwDic.Location = new Point(21, 31);
     btnBrwDic.Name     = "btnBrwDic";
     btnBrwDic.Size     = new Size(75, 23);
     btnBrwDic.TabIndex = 1;
     btnBrwDic.Text     = "Pilih";
     btnBrwDic.UseVisualStyleBackColor = true;
     btnBrwDic.Click += new EventHandler(btnBrwDic_Click);
     //
     // fbdSelect
     //
     fbdSelect.Description = "Pilih Folder SW";
     //
     // btnRefresh
     //
     btnRefresh.Anchor   = (AnchorStyles.Top | AnchorStyles.Right);
     btnRefresh.Location = new Point(831, 29);
     btnRefresh.Name     = "btnRefresh";
     btnRefresh.Size     = new Size(75, 23);
     btnRefresh.TabIndex = 2;
     btnRefresh.Text     = "Refresh";
     btnRefresh.UseVisualStyleBackColor = true;
     btnRefresh.Click += new EventHandler(btnRefresh_Click);
     //
     // btnFlash
     //
     btnFlash.Anchor   = (AnchorStyles.Top | AnchorStyles.Right);
     btnFlash.Location = new Point(951, 28);
     btnFlash.Name     = "btnFlash";
     btnFlash.Size     = new Size(75, 23);
     btnFlash.TabIndex = 3;
     btnFlash.Text     = "flash";
     btnFlash.UseVisualStyleBackColor = true;
     btnFlash.Click += new EventHandler(btnFlash_Click);
     //
     // devicelist
     //
     devicelist.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom
                          | AnchorStyles.Left
                          | AnchorStyles.Right);
     devicelist.Columns.AddRange(new ColumnHeader[] {
         clnID,
         clnDevice,
         clnProgress,
         clnTime,
         clnStatus,
         clnResult
     });
     devicelist.GridLines = true;
     devicelist.Location  = new Point(21, 86);
     devicelist.Name      = "devicelist";
     devicelist.Size      = new Size(1005, 316);
     devicelist.TabIndex  = 4;
     devicelist.UseCompatibleStateImageBehavior = false;
     devicelist.View = View.Details;
     devicelist.ColumnWidthChanging += new ColumnWidthChangingEventHandler(devicelist_ColumnWidthChanging);
     //
     // clnID
     //
     clnID.Text = "ID";
     //
     // clnDevice
     //
     clnDevice.Text  = "Kenzo";
     clnDevice.Width = 90;
     //
     // clnProgress
     //
     clnProgress.Text  = "Progres";
     clnProgress.Width = 107;
     //
     // clnTime
     //
     clnTime.Text = "Waktu";
     //
     // clnStatus
     //
     clnStatus.Text  = "Status";
     clnStatus.Width = 500;
     //
     // clnResult
     //
     clnResult.Text  = "Hasil";
     clnResult.Width = 126;
     //
     // txtLog
     //
     txtLog.Location = new Point(37, 421);
     txtLog.Name     = "txtLog";
     txtLog.Size     = new Size(949, 65);
     txtLog.TabIndex = 6;
     txtLog.Text     = "";
     txtLog.Visible  = false;
     //
     // timer_updateStatus
     //
     timer_updateStatus.Interval = 1000;
     timer_updateStatus.Tick    += new EventHandler(timer_updateStatus_Tick);
     //
     // statusStrp
     //
     statusStrp.Items.AddRange(new ToolStripItem[] {
         statusLblMsg,
         statusTab,
         rdoCleanAll,
         rdoSaveUserData,
         rdoCleanAllAndLock
     });
     statusStrp.Location = new Point(0, 422);
     statusStrp.Name     = "statusStrp";
     statusStrp.Size     = new Size(1094, 22);
     statusStrp.TabIndex = 7;
     statusStrp.Text     = "statusStrip1";
     //
     // statusLblMsg
     //
     statusLblMsg.Name = "statusLblMsg";
     statusLblMsg.Size = new System.Drawing.Size(0, 17);
     //
     // statusTab
     //
     statusTab.Name   = "statusTab";
     statusTab.Size   = new System.Drawing.Size(708, 17);
     statusTab.Spring = true;
     //
     // rdoCleanAll
     //
     rdoCleanAll.IsChecked = false;
     rdoCleanAll.Name      = "rdoCleanAll";
     rdoCleanAll.Size      = new System.Drawing.Size(98, 20);
     rdoCleanAll.Text      = "Hapus Semua";
     //
     // rdoSaveUserData
     //
     rdoSaveUserData.IsChecked = true;
     rdoSaveUserData.Name      = "rdoSaveUserData";
     rdoSaveUserData.Size      = new System.Drawing.Size(118, 20);
     rdoSaveUserData.Text      = "Simpan Data User";
     //
     // rdoCleanAllAndLock
     //
     rdoCleanAllAndLock.IsChecked = false;
     rdoCleanAllAndLock.Name      = "rdoCleanAllAndLock";
     rdoCleanAllAndLock.Size      = new System.Drawing.Size(155, 20);
     rdoCleanAllAndLock.Text      = "Hapus Semua Dan Kunci";
     //
     // lblMD5
     //
     lblMD5.AutoSize = true;
     lblMD5.Location = new System.Drawing.Point(96, 68);
     lblMD5.Name     = "lblMD5";
     lblMD5.Size     = new System.Drawing.Size(0, 13);
     lblMD5.TabIndex = 8;
     //
     // menuStrip1
     //
     menuStrip1.BackColor = SystemColors.ControlLight;
     menuStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Visible;
     menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         miConfiguration
     });
     menuStrip1.Location   = new System.Drawing.Point(0, 0);
     menuStrip1.Name       = "menuStrip1";
     menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
     menuStrip1.Size       = new System.Drawing.Size(1094, 24);
     menuStrip1.TabIndex   = 9;
     menuStrip1.Text       = "menuStrip1";
     //
     // miConfiguration
     //
     miConfiguration.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         miFlashConfigurationToolStripMenuItem
     });
     miConfiguration.Name = "miConfiguration";
     miConfiguration.Size = new System.Drawing.Size(93, 20);
     miConfiguration.Text = "Configuration";
     //
     // miFlashConfigurationToolStripMenuItem
     //
     miFlashConfigurationToolStripMenuItem.Name   = "miFlashConfigurationToolStripMenuItem";
     miFlashConfigurationToolStripMenuItem.Size   = new Size(178, 22);
     miFlashConfigurationToolStripMenuItem.Text   = "Konfigurasi MiFlash";
     miFlashConfigurationToolStripMenuItem.Click += new EventHandler(miFlashConfigurationToolStripMenuItem_Click);
     //
     // MainFrm
     //
     ClientSize = new Size(1094, 444);
     Controls.Add(lblMD5);
     Controls.Add(statusStrp);
     Controls.Add(menuStrip1);
     Controls.Add(txtLog);
     Controls.Add(devicelist);
     Controls.Add(btnFlash);
     Controls.Add(btnRefresh);
     Controls.Add(btnBrwDic);
     Controls.Add(txtPath);
     MainMenuStrip = menuStrip1;
     Name          = "MainFrm";
     StartPosition = FormStartPosition.CenterScreen;
     Text          = "XiaoMiFlash(Beta)";
     FormClosing  += new FormClosingEventHandler(MainFrm_FormClosing);
     FormClosed   += new FormClosedEventHandler(MainFrm_FormClosed);
     Load         += new EventHandler(MainFrm_Load);
     statusStrp.ResumeLayout(false);
     statusStrp.PerformLayout();
     menuStrip1.ResumeLayout(false);
     menuStrip1.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }
コード例 #2
0
ファイル: MainFrm.cs プロジェクト: gryffyn/QFlashKit
 private void InitializeComponent()
 {
     CheckAdmin(IsRunAsAdmin());
     components          = new Container();
     _txtPath            = new TextBox();
     _btnBrwDic          = new Button();
     _fbdSelect          = new FolderBrowserDialog();
     _btnRefresh         = new Button();
     _btnFlash           = new Button();
     _devicelist         = new ListView();
     _clnID              = new ColumnHeader();
     _clnDevice          = new ColumnHeader();
     _clnProgress        = new ColumnHeader();
     _clnTime            = new ColumnHeader();
     _clnStatus          = new ColumnHeader();
     _clnResult          = new ColumnHeader();
     _txtLog             = new RichTextBox();
     _timerUpdateStatus  = new Timer(components);
     _statusStrp         = new StatusStrip();
     _statusLblMsg       = new ToolStripStatusLabel();
     _statusTab          = new ToolStripStatusLabel();
     _rdoCleanAll        = new RadioStripItem();
     _rdoSaveUserData    = new RadioStripItem();
     _rdoCleanAllAndLock = new RadioStripItem();
     _lblMD5             = new Label();
     _menuStrip1         = new MenuStrip();
     _miConfiguration    = new ToolStripMenuItem();
     _miFlashConfigurationToolStripMenuItem = new ToolStripMenuItem();
     _miInstallDrivers = new ToolStripMenuItem();
     _statusStrp.SuspendLayout();
     _menuStrip1.SuspendLayout();
     SuspendLayout();
     //
     // txtPath
     //
     _txtPath.Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                       | AnchorStyles.Left
                       | AnchorStyles.Right;
     _txtPath.Location = new Point(98, 33);
     _txtPath.Name     = "_txtPath";
     _txtPath.Size     = new Size(668, 20);
     _txtPath.TabIndex = 0;
     //
     // btnBrwDic
     //
     _btnBrwDic.Location = new Point(21, 31);
     _btnBrwDic.Name     = "_btnBrwDic";
     _btnBrwDic.Size     = new Size(75, 23);
     _btnBrwDic.TabIndex = 1;
     _btnBrwDic.Text     = "Location";
     _btnBrwDic.UseVisualStyleBackColor = true;
     _btnBrwDic.Click += btnBrwDic_Click;
     //
     // fbdSelect
     //
     _fbdSelect.Description = "Fastboot ROM";
     //
     // btnRefresh
     //
     _btnRefresh.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
     _btnRefresh.Location = new Point(831, 29);
     _btnRefresh.Name     = "_btnRefresh";
     _btnRefresh.Size     = new Size(75, 23);
     _btnRefresh.TabIndex = 2;
     _btnRefresh.Text     = "Refresh";
     _btnRefresh.UseVisualStyleBackColor = true;
     _btnRefresh.Click += btnRefresh_Click;
     //
     // btnFlash
     //
     _btnFlash.Anchor   = AnchorStyles.Top | AnchorStyles.Right;
     _btnFlash.Location = new Point(951, 28);
     _btnFlash.Name     = "_btnFlash";
     _btnFlash.Size     = new Size(75, 23);
     _btnFlash.TabIndex = 3;
     _btnFlash.Text     = "flash";
     _btnFlash.UseVisualStyleBackColor = true;
     _btnFlash.Click += btnFlash_Click;
     //
     // devicelist
     //
     _devicelist.Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                          | AnchorStyles.Left
                          | AnchorStyles.Right;
     _devicelist.Columns.AddRange(new[]
     {
         _clnID,
         _clnDevice,
         _clnProgress,
         _clnTime,
         _clnStatus,
         _clnResult
     });
     _devicelist.GridLines = true;
     _devicelist.Location  = new Point(21, 86);
     _devicelist.Name      = "_devicelist";
     _devicelist.Size      = new Size(1005, 316);
     _devicelist.TabIndex  = 4;
     _devicelist.UseCompatibleStateImageBehavior = false;
     _devicelist.View = View.Details;
     _devicelist.ColumnWidthChanging += devicelist_ColumnWidthChanging;
     //
     // clnID
     //
     _clnID.Text = "ID";
     //
     // clnDevice
     //
     _clnDevice.Text  = "Kenzo";
     _clnDevice.Width = 90;
     //
     // clnProgress
     //
     _clnProgress.Text  = "Progres";
     _clnProgress.Width = 107;
     //
     // clnTime
     //
     _clnTime.Text = "Waktu";
     //
     // clnStatus
     //
     _clnStatus.Text  = "Status";
     _clnStatus.Width = 500;
     //
     // clnResult
     //
     _clnResult.Text  = "Hasil";
     _clnResult.Width = 126;
     //
     // txtLog
     //
     _txtLog.Location = new Point(37, 421);
     _txtLog.Name     = "_txtLog";
     _txtLog.Size     = new Size(949, 65);
     _txtLog.TabIndex = 6;
     _txtLog.Text     = "";
     _txtLog.Visible  = false;
     //
     // timer_updateStatus
     //
     _timerUpdateStatus.Interval = 1000;
     _timerUpdateStatus.Tick    += timer_updateStatus_Tick;
     //
     // statusStrp
     //
     _statusStrp.Items.AddRange(new ToolStripItem[]
     {
         _statusLblMsg,
         _statusTab,
         _rdoCleanAll,
         _rdoSaveUserData,
         _rdoCleanAllAndLock
     });
     _statusStrp.Location = new Point(0, 422);
     _statusStrp.Name     = "_statusStrp";
     _statusStrp.Size     = new Size(1094, 22);
     _statusStrp.TabIndex = 7;
     _statusStrp.Text     = "statusStrip1";
     //
     // statusLblMsg
     //
     _statusLblMsg.Name = "_statusLblMsg";
     _statusLblMsg.Size = new Size(0, 17);
     //
     // statusTab
     //
     _statusTab.Name   = "_statusTab";
     _statusTab.Size   = new Size(708, 17);
     _statusTab.Spring = true;
     //
     // rdoCleanAll
     //
     _rdoCleanAll.IsChecked = false;
     _rdoCleanAll.Name      = "_rdoCleanAll";
     _rdoCleanAll.Size      = new Size(98, 20);
     _rdoCleanAll.Text      = "Hapus Semua";
     //
     // rdoSaveUserData
     //
     _rdoSaveUserData.IsChecked = true;
     _rdoSaveUserData.Name      = "_rdoSaveUserData";
     _rdoSaveUserData.Size      = new Size(118, 20);
     _rdoSaveUserData.Text      = "Simpan Data User";
     //
     // rdoCleanAllAndLock
     //
     _rdoCleanAllAndLock.IsChecked = false;
     _rdoCleanAllAndLock.Name      = "_rdoCleanAllAndLock";
     _rdoCleanAllAndLock.Size      = new Size(155, 20);
     _rdoCleanAllAndLock.Text      = "Hapus Semua Dan Kunci";
     //
     // lblMD5
     //
     _lblMD5.AutoSize = true;
     _lblMD5.Location = new Point(96, 68);
     _lblMD5.Name     = "_lblMD5";
     _lblMD5.Size     = new Size(0, 13);
     _lblMD5.TabIndex = 8;
     //
     // menuStrip1
     //
     _menuStrip1.BackColor = SystemColors.ControlLight;
     _menuStrip1.GripStyle = ToolStripGripStyle.Visible;
     _menuStrip1.Items.AddRange(new ToolStripItem[]
     {
         _miConfiguration
     });
     _menuStrip1.Location   = new Point(0, 0);
     _menuStrip1.Name       = "_menuStrip1";
     _menuStrip1.RenderMode = ToolStripRenderMode.System;
     _menuStrip1.Size       = new Size(1094, 24);
     _menuStrip1.TabIndex   = 9;
     _menuStrip1.Text       = "menuStrip1";
     //
     // miConfiguration
     //
     _miConfiguration.DropDownItems.AddRange(new ToolStripItem[]
     {
         _miFlashConfigurationToolStripMenuItem, _miInstallDrivers
     });
     _miConfiguration.Name = "_miConfiguration";
     _miConfiguration.Size = new Size(93, 40);
     _miConfiguration.Text = "Configuration";
     //
     // miFlashConfigurationToolStripMenuItem
     //
     _miFlashConfigurationToolStripMenuItem.Name   = "_miFlashConfigurationToolStripMenuItem";
     _miFlashConfigurationToolStripMenuItem.Size   = new Size(178, 22);
     _miFlashConfigurationToolStripMenuItem.Text   = "Configure MiFlash";
     _miFlashConfigurationToolStripMenuItem.Click += miFlashConfigurationToolStripMenuItem_Click;
     //
     // miInstallDriver
     //
     _miInstallDrivers.Name   = "_miInstallDrivers";
     _miInstallDrivers.Size   = new Size(178, 22);
     _miInstallDrivers.Text   = "Install Drivers";
     _miInstallDrivers.Click += miInstallDrivers_Click;
     //
     // MainFrm
     //
     ClientSize = new Size(1094, 444);
     Controls.Add(_lblMD5);
     Controls.Add(_statusStrp);
     Controls.Add(_menuStrip1);
     Controls.Add(_txtLog);
     Controls.Add(_devicelist);
     Controls.Add(_btnFlash);
     Controls.Add(_btnRefresh);
     Controls.Add(_btnBrwDic);
     Controls.Add(_txtPath);
     MainMenuStrip = _menuStrip1;
     Name          = "MainFrm";
     StartPosition = FormStartPosition.CenterScreen;
     Text          = "QFlashKit (Beta)";
     FormClosing  += MainFrm_FormClosing;
     FormClosed   += MainFrm_FormClosed;
     Load         += MainFrm_Load;
     _statusStrp.ResumeLayout(false);
     _statusStrp.PerformLayout();
     _menuStrip1.ResumeLayout(false);
     _menuStrip1.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }