Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Client.Canon.V4.5
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶然
Kivii.Client.Canon.V4.5
Commits
43c1f7c8
Commit
43c1f7c8
authored
Jun 25, 2024
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化相机拍照后文件下载问题
parent
6de5be6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
20 deletions
+25
-20
CanonForm.cs
Src/CanonForm.cs
+25
-20
No files found.
Src/CanonForm.cs
View file @
43c1f7c8
...
...
@@ -60,7 +60,7 @@ namespace Kivii.Canon
try
{
IsInit
=
false
;
MainCamera
.
CloseSession
();
MainCamera
?
.
CloseSession
();
MainCamera
?.
Dispose
();
APIHandler
?.
Dispose
();
}
...
...
@@ -109,27 +109,32 @@ namespace Kivii.Canon
{
try
{
string
dir
=
null
;
Invoke
((
Action
)
delegate
{
dir
=
SavePathTextBox
.
Text
;
});
sender
.
DownloadFile
(
Info
,
dir
);
Info
.
FileName
=
$"
{
DateTime
.
Now
.
ToString
(
"ssfff"
)}
_
{
Info
.
FileName
}
"
;
//string dir = null;
var
steam
=
sender
.
DownloadFile
(
Info
);
//Invoke((Action)delegate { dir = SavePathTextBox.Text; });
//sender.DownloadFile(Info, dir);
Invoke
((
Action
)
delegate
{
MainProgressBar
.
Value
=
0
;
});
//延时等待图片下载完毕后抛出事件
var
task
=
Task
.
Run
(
async
delegate
if
(
DownloadCompletely
!=
null
)
{
var
filePath
=
$"
{
dir
}
\\
{
Info
.
FileName
}
"
;
await
Task
.
Delay
(
500
);
if
(!
File
.
Exists
(
filePath
))
{
return
;
}
if
(
DownloadCompletely
!=
null
)
{
DownloadCompletely
(
filePath
,
EventArgs
.
Empty
);
}
return
;
});
DownloadCompletely
(
steam
,
EventArgs
.
Empty
);
}
////延时等待图片下载完毕后抛出事件
//var task = Task.Run(async delegate
//{
// var filePath = $"{dir}\\{Info.FileName}";
// await Task.Delay(500);
// if (!File.Exists(filePath))
// {
// return;
// }
// if (DownloadCompletely != null)
// {
// DownloadCompletely(steam, EventArgs.Empty);
// }
// return;
//});
}
catch
(
Exception
ex
)
{
ReportError
(
ex
.
Message
,
false
);
}
}
...
...
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