Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GetAdocUI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QCD
Tools
GetAdocUI
Commits
04535f2d
Commit
04535f2d
authored
Oct 08, 2021
by
tsuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ファイル重複時のフリーズ等を修正
parent
a3468ff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
2 deletions
+39
-2
MainWindow.xaml.cs
GetADoc/MainWindow.xaml.cs
+39
-2
No files found.
GetADoc/MainWindow.xaml.cs
View file @
04535f2d
...
@@ -116,11 +116,48 @@ namespace GetADoc
...
@@ -116,11 +116,48 @@ namespace GetADoc
{
{
fileName
=
fileName
.
Replace
(
allNg
,
string
.
Empty
);
fileName
=
fileName
.
Replace
(
allNg
,
string
.
Empty
);
}
}
MessageBox
.
Show
(
"ファイル名に使用できない文字が存在したため\n一部ファイル名を修正しました。\nもう一度作成ボタンをクリックしてください。"
,
"Renamed this file"
,
MessageBoxButton
.
OK
,
MessageBoxImage
.
Warning
);
MessageBox
.
Show
(
"ファイル名に使用できない文字が存在したため\n一部ファイル名を修正しました。"
+
"\nもう一度作成ボタンをクリックしてください。"
,
"Renamed this file"
,
MessageBoxButton
.
OK
,
MessageBoxImage
.
Warning
);
box2
.
Text
=
fileName
;
box2
.
Text
=
fileName
;
return
;
return
;
}
}
//指定したフォルダに同名の.adocや既存の付属ファイル(config.adocなど)がある場合の処理
if
(
File
.
Exists
(
System
.
IO
.
Path
.
Combine
(
filePath
,
fileName
+
".adoc"
))
||
File
.
Exists
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"config.adoc"
)))
{
MessageBoxResult
OverwriteADoc
=
MessageBox
.
Show
(
"これから生成するファイルと同名のファイルが既に存在します"
+
"\n既存のファイルを上書きしますか?"
,
"指定したフォルダに既存のファイルが存在します"
,
MessageBoxButton
.
YesNo
);
if
(
OverwriteADoc
==
MessageBoxResult
.
Yes
)
{
File
.
Delete
(
filePath
+
fileName
+
".adoc"
);
File
.
Delete
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"config.adoc"
));
File
.
Delete
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"IncDoc.adoc"
));
if
(
Directory
.
Exists
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"Images"
)))
{
Directory
.
Delete
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"Images"
),
true
);
}
if
(
Directory
.
Exists
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"icons"
)))
{
Directory
.
Delete
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"icons"
),
true
);
}
if
(
Directory
.
Exists
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"Sub_First"
)))
{
Directory
.
Delete
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"Sub_First"
),
true
);
}
if
(
Directory
.
Exists
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"Sub_Second"
)))
{
Directory
.
Delete
(
System
.
IO
.
Path
.
Combine
(
filePath
,
"Sub_Second"
),
true
);
}
}
else
if
(
OverwriteADoc
==
MessageBoxResult
.
No
)
{
MessageBox
.
Show
(
"別のフォルダを指定してください"
);
return
;
}
}
//バッチファイルの実行
//バッチファイルの実行
ProcessStartInfo
processStartInfo
=
new
ProcessStartInfo
();
ProcessStartInfo
processStartInfo
=
new
ProcessStartInfo
();
string
stCurrentDir
=
System
.
IO
.
Directory
.
GetCurrentDirectory
();
string
stCurrentDir
=
System
.
IO
.
Directory
.
GetCurrentDirectory
();
...
@@ -151,7 +188,7 @@ namespace GetADoc
...
@@ -151,7 +188,7 @@ namespace GetADoc
//指定されたフォルダに生成物を移動
//指定されたフォルダに生成物を移動
File
.
Move
(
System
.
IO
.
Path
.
Combine
(
stCurrentDir
,
fileName
+
".adoc"
),
filePath
+
fileName
+
".adoc"
);
File
.
Move
(
System
.
IO
.
Path
.
Combine
(
stCurrentDir
,
fileName
+
".adoc"
),
filePath
+
fileName
+
".adoc"
);
File
.
Move
(
System
.
IO
.
Path
.
Combine
(
stCurrentDir
,
"config.adoc"
),
filePath
+
"/config.adoc"
);
File
.
Move
(
System
.
IO
.
Path
.
Combine
(
stCurrentDir
,
"config.adoc"
),
System
.
IO
.
Path
.
Combine
(
filePath
,
"config.adoc"
)
);
Directory
.
Move
(
System
.
IO
.
Path
.
Combine
(
stCurrentDir
,
"Images"
),
System
.
IO
.
Path
.
Combine
(
filePath
,
"Images"
));
Directory
.
Move
(
System
.
IO
.
Path
.
Combine
(
stCurrentDir
,
"Images"
),
System
.
IO
.
Path
.
Combine
(
filePath
,
"Images"
));
if
(
checkbox2
.
IsChecked
==
true
)
if
(
checkbox2
.
IsChecked
==
true
)
{
{
...
...
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