/// <summary> /// 点击了确定按钮 /// </summary> private void DoOKCommond() { if (!File.Exists(SelectedFileName)) { MessageBox.ShowDialogErrorMsg("请先选择文件!"); return; } EnumOSType selectPlatform = _dicOSType[SelectedPlatform]; if (selectPlatform == EnumOSType.None) { MessageBox.ShowDialogErrorMsg("请先选择系统类型!"); return; } _selectedFile = new LocalFileDevice() { IsDirectory = false, PathName = SelectedFileName }; if (selectPlatform == EnumOSType.YunOS) { selectPlatform = EnumOSType.Android; } _selectedFile.OSType = selectPlatform; if (_dicFlshType.ContainsKey(selectPlatform)) //如果是山寨机,则设置芯片类型和设备类型 { _selectedFile.CottageFlshType = _dicFlshType[selectPlatform].Item1; _selectedFile.CottageDevType = _dicFlshType[selectPlatform].Item2; } base.DialogResult = true; base.CloseView(); }
/// <summary> /// 选择单个文件 /// </summary> private void DoSelectFileCommond() { LocalFileDevice file = _fileDlg.ShowDialogWindow(ExportKeys.DeviceSelectFileView) as LocalFileDevice; if (file != null) { CreateDevice(file); } }
/// <summary> /// 选择文件夹 /// </summary> private void DoSelectFolderCommond() { string path = _fileDlg.SelectFolderDialog(); if (string.IsNullOrWhiteSpace(path)) { return; } LocalFileDevice file = new LocalFileDevice() { IsDirectory = true, PathName = path }; CreateDevice(file); }
/// <summary> /// 点击了取消按钮 /// </summary> private void DoCancelCommond() { _selectedFile = null; base.CloseView(); }