Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MES_Wind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debolskiy Andrey
MES_Wind
Commits
a1680bce
Commit
a1680bce
authored
8 years ago
by
Debolskiy Andrey
Browse files
Options
Downloads
Patches
Plain Diff
Added automated DotSpatial Extentions coping to executable path
parent
bf9aeafb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MES_Wind/Program.cs
+23
-0
23 additions, 0 deletions
MES_Wind/Program.cs
MES_Wind/frmMain.cs
+10
-2
10 additions, 2 deletions
MES_Wind/frmMain.cs
with
33 additions
and
2 deletions
MES_Wind/Program.cs
+
23
−
0
View file @
a1680bce
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Windows.Forms
;
using
System.IO
;
namespace
MES_Wind
{
...
...
@@ -16,6 +17,28 @@ namespace MES_Wind
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
Run
(
new
frmMain
());
}
}
public
static
class
CommUtils
{
public
static
DirectoryInfo
CopyTo
(
this
DirectoryInfo
sourceDir
,
string
destinationPath
,
bool
overwrite
=
false
)
{
var
sourcePath
=
sourceDir
.
FullName
;
var
destination
=
new
DirectoryInfo
(
destinationPath
);
destination
.
Create
();
foreach
(
var
sourceSubDirPath
in
Directory
.
EnumerateDirectories
(
sourcePath
,
"*"
,
SearchOption
.
AllDirectories
))
Directory
.
CreateDirectory
(
sourceSubDirPath
.
Replace
(
sourcePath
,
destinationPath
));
foreach
(
var
file
in
Directory
.
EnumerateFiles
(
sourcePath
,
"*"
,
SearchOption
.
AllDirectories
))
File
.
Copy
(
file
,
file
.
Replace
(
sourcePath
,
destinationPath
),
overwrite
);
return
destination
;
}
}
}
This diff is collapsed.
Click to expand it.
MES_Wind/frmMain.cs
+
10
−
2
View file @
a1680bce
...
...
@@ -5,6 +5,7 @@ using System.Data;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.IO
;
using
System.Windows.Forms
;
using
System.ComponentModel.Composition
;
using
DotSpatial.Controls
;
...
...
@@ -25,6 +26,14 @@ namespace MES_Wind
InitializeComponent
();
if
(
DesignMode
)
return
;
Shell
=
this
;
//check if needed extensions are in executable path
try
{
string
extRelativeDir
=
"\\place_content_of_the_folder_to_bindebug"
;
DirectoryInfo
extDir
=
new
DirectoryInfo
(
Directory
.
GetParent
(
Directory
.
GetParent
(
Environment
.
CurrentDirectory
).
FullName
)
+
extRelativeDir
);
extDir
.
CopyTo
(
Directory
.
GetCurrentDirectory
());
}
catch
{
}
appManager1
.
LoadExtensions
();
}
#
region
...
...
@@ -76,7 +85,7 @@ namespace MES_Wind
{
string
curDir
=
Environment
.
CurrentDirectory
;
string
pathToTests
=
"\\MES_test_new\\"
;
string
file_path
=
System
.
IO
.
Directory
.
GetParent
(
System
.
IO
.
Directory
.
GetParent
(
curDir
).
FullName
).
FullName
+
pathToTests
;
string
file_path
=
Directory
.
GetParent
(
Directory
.
GetParent
(
curDir
).
FullName
).
FullName
+
pathToTests
;
string
test
=
file_path
+
"u_test.asc"
;
map1
.
AddLayer
(
file_path
+
"newstats.shp"
);
...
...
@@ -329,5 +338,4 @@ namespace MES_Wind
public
double
Y
;
public
bool
Ifbroken
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment