Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VIZ.Package
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘龙飞
VIZ.Package
Commits
1d77b812
Commit
1d77b812
authored
Feb 27, 2023
by
wangonghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
媒体资源库视频导出得下载
parent
7337f8b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
VIZ.Package.Module/Resource/MediaResource/ViewModel/MediaResourcePanelViewModel.cs
+26
-26
No files found.
VIZ.Package.Module/Resource/MediaResource/ViewModel/MediaResourcePanelViewModel.cs
View file @
1d77b812
...
@@ -17,6 +17,7 @@ using System.Windows.Forms;
...
@@ -17,6 +17,7 @@ using System.Windows.Forms;
using
System.Windows.Shapes
;
using
System.Windows.Shapes
;
using
VIZ.Framework.Core
;
using
VIZ.Framework.Core
;
using
VIZ.Package.Domain
;
using
VIZ.Package.Domain
;
using
static
System
.
Net
.
WebRequestMethods
;
namespace
VIZ.Package.Module
namespace
VIZ.Package.Module
...
@@ -716,7 +717,7 @@ namespace VIZ.Package.Module
...
@@ -716,7 +717,7 @@ namespace VIZ.Package.Module
public
VCommand
ExportFolderFilesCommand
{
get
;
set
;
}
public
VCommand
ExportFolderFilesCommand
{
get
;
set
;
}
private
void
ExportFolderFiles
()
private
async
void
ExportFolderFiles
()
{
{
if
(
SelectedFolderModel
==
null
||
FileModels
==
null
)
return
;
if
(
SelectedFolderModel
==
null
||
FileModels
==
null
)
return
;
...
@@ -729,11 +730,17 @@ namespace VIZ.Package.Module
...
@@ -729,11 +730,17 @@ namespace VIZ.Package.Module
string
path
=
ofd
.
SelectedPath
;
string
path
=
ofd
.
SelectedPath
;
foreach
(
var
fileModel
in
FileModels
)
foreach
(
var
fileModel
in
FileModels
)
{
{
string
url
=
string
.
Format
(
"{0}GetFile?filePath={1}&isResize=false"
,
ApplicationDomainEx
.
MediaConfig
.
Url
,
fileModel
.
Path
);
var
fileResult
=
await
MediaResourceFileService
.
GetImage
(
url
);
Image
img
=
Image
.
FromStream
(
fileResult
);
string
filePath
=
String
.
Format
(
"{0}\\{1}"
,
path
,
fileModel
.
Name
);
string
filePath
=
String
.
Format
(
"{0}\\{1}"
,
path
,
fileModel
.
Name
);
if
(!
File
.
Exists
(
filePath
))
if
(!
System
.
IO
.
File
.
Exists
(
filePath
))
{
{
fileModel
.
OriginThumbnailBitmap
.
Save
(
filePath
);
img
.
Save
(
filePath
);
}
}
}
}
...
@@ -759,28 +766,9 @@ namespace VIZ.Package.Module
...
@@ -759,28 +766,9 @@ namespace VIZ.Package.Module
public
VCommand
ExportFileCommand
{
get
;
set
;
}
public
VCommand
ExportFileCommand
{
get
;
set
;
}
private
void
ExprotFile
()
private
async
void
ExprotFile
()
{
{
//if (SelectedFileModel == null) return;
//var saveFileDialog1 = new SaveFileDialog
//{
// Filter = "JPeg Image|*.jpg|Bitmap Image|*.bmp|Gif Image|*.gif",
// Title = "Save File"
//};
//saveFileDialog1.ShowDialog();
//if (string.IsNullOrEmpty(saveFileDialog1.FileName)) return;
//Bitmap bitmap = SelectedFileModel.ThumbnailBitmap;
//bitmap.Save(saveFileDialog1.FileName);
//using (var sw = new StreamWriter(selectedFileModel.ThumbnailBitmap))
//{
// sw.Write("Writing Text ");
// sw.WriteLine("Here we go.");
// sw.WriteLine("-------------------");
// sw.Write("Today is is: " + DateTime.Now);
// sw.WriteLine("Done");
//}
if
(
SelectedFileModel
==
null
)
return
;
if
(
SelectedFileModel
==
null
)
return
;
...
@@ -789,13 +777,23 @@ namespace VIZ.Package.Module
...
@@ -789,13 +777,23 @@ namespace VIZ.Package.Module
System
.
Windows
.
Forms
.
FolderBrowserDialog
ofd
=
new
System
.
Windows
.
Forms
.
FolderBrowserDialog
();
System
.
Windows
.
Forms
.
FolderBrowserDialog
ofd
=
new
System
.
Windows
.
Forms
.
FolderBrowserDialog
();
if
(
ofd
.
ShowDialog
()
==
System
.
Windows
.
Forms
.
DialogResult
.
OK
)
if
(
ofd
.
ShowDialog
()
==
System
.
Windows
.
Forms
.
DialogResult
.
OK
)
{
{
string
path
=
ofd
.
SelectedPath
;
string
path
=
ofd
.
SelectedPath
;
string
filePath
=
String
.
Format
(
"{0}\\{1}"
,
path
,
SelectedFileModel
.
Name
);
string
filePath
=
String
.
Format
(
"{0}\\{1}"
,
path
,
SelectedFileModel
.
Name
);
if
(!
File
.
Exists
(
filePath
))
string
url
=
string
.
Format
(
"{0}GetFile?filePath={1}&isResize=false"
,
ApplicationDomainEx
.
MediaConfig
.
Url
,
SelectedFileModel
.
Path
);
var
fileResult
=
await
MediaResourceFileService
.
GetImage
(
url
);
Image
img
=
Image
.
FromStream
(
fileResult
);
if
(!
System
.
IO
.
File
.
Exists
(
filePath
))
{
{
SelectedFileModel
.
OriginThumbnailBitmap
.
Save
(
filePath
);
img
.
Save
(
filePath
);
}
}
DXMessageBox
.
Show
(
"素材导出成功"
);
DXMessageBox
.
Show
(
"素材导出成功"
);
}
}
...
@@ -947,6 +945,8 @@ namespace VIZ.Package.Module
...
@@ -947,6 +945,8 @@ namespace VIZ.Package.Module
if
(
result
.
status
==
"0"
)
if
(
result
.
status
==
"0"
)
{
{
DXMessageBox
.
Show
(
"文件还原成功!"
);
DXMessageBox
.
Show
(
"文件还原成功!"
);
RefreshFile
();
}
}
else
else
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment