Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KenPanCS
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
KenPanCS
Commits
d1e38770
Commit
d1e38770
authored
Apr 06, 2022
by
tsuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
・例外処理の部分を関数化
・ディレクトリの作成/削除を関数化
parent
f75dbee2
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
110 deletions
+107
-110
FilePathSelect.cs
Code/CSRender/CSRender/FilePathSelect.cs
+48
-1
MainWindow.xaml.cs
Code/CSRender/CSRender/MainWindow.xaml.cs
+59
-109
No files found.
Code/CSRender/CSRender/FilePathSelect.cs
View file @
d1e38770
...
@@ -291,5 +291,52 @@ namespace CSRender
...
@@ -291,5 +291,52 @@ namespace CSRender
return
inFileName
;
return
inFileName
;
}
}
private
string
SelectFileTarget
(
bool
dummyFlag
,
string
targetBoxText
,
string
referenceBoxText
,
string
workBoxText
)
{
string
dummyFileName
=
""
;
//対象とリファレンスが同名ファイルであるか確認
string
TarFileName
=
System
.
IO
.
Path
.
GetFileName
(
referenceBoxText
);
string
RefFileName
=
System
.
IO
.
Path
.
GetFileName
(
targetBoxText
);
if
(
TarFileName
!=
RefFileName
)
{
//指定した作業フォルダ内にダミー用フォルダを設定(無ければ生成)
string
dummyDir
=
System
.
IO
.
Path
.
Combine
(
workBoxText
,
"Dummy"
);
if
(!
Directory
.
Exists
(
dummyDir
))
{
Directory
.
CreateDirectory
(
dummyDir
);
}
string
dummyTarDir
=
System
.
IO
.
Path
.
Combine
(
dummyDir
,
"Target"
);
if
(!
Directory
.
Exists
(
dummyTarDir
))
{
Directory
.
CreateDirectory
(
dummyTarDir
);
}
string
dummyRefDir
=
System
.
IO
.
Path
.
Combine
(
dummyDir
,
"Reference"
);
if
(!
Directory
.
Exists
(
dummyRefDir
))
{
Directory
.
CreateDirectory
(
dummyRefDir
);
}
//ダミーファイルを作成
dummyFileName
=
createDummyFile
(
targetBoxText
,
dummyTarDir
,
dummyFileName
);
dummyFileName
=
createDummyFile
(
referenceBoxText
,
dummyRefDir
,
dummyFileName
);
dummyFlag
=
true
;
//検版対象をダミーに指定
targetBoxText
=
dummyTarDir
;
referenceBoxText
=
dummyRefDir
;
}
return
dummyFileName
;
}
//指定のパスにディレクトリが無ければ作成
private
void
checkDirPath
(
string
inDirPath
)
{
if
(!
Directory
.
Exists
(
inDirPath
))
{
Directory
.
CreateDirectory
(
inDirPath
);
//パスにディレクトリが無ければ作成
}
}
//指定のパスにディレクトリがあれば削除し、新たな同名ディレクトリを作成
private
void
DeleteOldDir
(
string
inDirPath
)
{
if
(
Directory
.
Exists
(
inDirPath
))
{
Directory
.
Delete
(
inDirPath
,
true
);
//パスにディレクトリがあれば削除
}
Directory
.
CreateDirectory
(
inDirPath
);
//同名のディレクトリを作成
}
}
}
}
}
Code/CSRender/CSRender/MainWindow.xaml.cs
View file @
d1e38770
This diff is collapsed.
Click to expand it.
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