Initial commit
This commit is contained in:
Коммит
f5cd3bee90
|
@ -0,0 +1,11 @@
|
|||
; This file is for unifying the coding style for different editors and IDEs.
|
||||
; More information at http://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = CRLF
|
||||
|
||||
[*.cs]
|
||||
indent_style = space
|
||||
indent_size = 4
|
|
@ -0,0 +1,17 @@
|
|||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
# Standard to msysgit
|
||||
*.doc diff=astextplain
|
||||
*.DOC diff=astextplain
|
||||
*.docx diff=astextplain
|
||||
*.DOCX diff=astextplain
|
||||
*.dot diff=astextplain
|
||||
*.DOT diff=astextplain
|
||||
*.pdf diff=astextplain
|
||||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
|
@ -0,0 +1,288 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
**/Properties/launchSettings.json
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Wiesław Šoltés
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27703.2026
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicroStationTagExplorer", "src\MicroStationTagExplorer\MicroStationTagExplorer.csproj", "{59F5B5F5-2569-4263-9E94-D53DA097FCAD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{59F5B5F5-2569-4263-9E94-D53DA097FCAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{59F5B5F5-2569-4263-9E94-D53DA097FCAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{59F5B5F5-2569-4263-9E94-D53DA097FCAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{59F5B5F5-2569-4263-9E94-D53DA097FCAD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4E264536-B566-4146-96C3-B6A810B59EB8}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,9 @@
|
|||
# MicroStation Tag Explorer
|
||||
|
||||
## Resources
|
||||
|
||||
* [GitHub source code repository.](https://github.com/wieslawsoltes/MicroStationTagExplorer)
|
||||
|
||||
## License
|
||||
|
||||
MicroStation Tag Explorer is licensed under the [MIT license](LICENSE.TXT).
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
|
@ -0,0 +1,6 @@
|
|||
<Application x:Class="MicroStationTagExplorer.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:MicroStationTagExplorer"
|
||||
StartupUri="MainWindow.xaml">
|
||||
</Application>
|
|
@ -0,0 +1,8 @@
|
|||
using System.Windows;
|
||||
|
||||
namespace MicroStationTagExplorer
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<Window x:Class="MicroStationTagExplorer.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:MicroStationTagExplorer"
|
||||
mc:Ignorable="d"
|
||||
Title="MicroStation Tag Explorer" Height="650" Width="1000"
|
||||
WindowStartupLocation="CenterScreen" WindowState="Normal"
|
||||
UseLayoutRounding="True" TextOptions.TextFormattingMode="Display" SnapsToDevicePixels="True">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Menu>
|
||||
<MenuItem Header="_File">
|
||||
<MenuItem x:Name="FileAdd" Header="Add..." Click="FileAdd_Click"/>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
|
||||
<DataGrid x:Name="DataGridFiles" ItemsSource="{Binding}" Margin="4" Grid.Row="1"/>
|
||||
<DataGrid x:Name="DataGridTags" DataContext="{Binding ElementName=DataGridFiles, Path=SelectedItem.Tags}" ItemsSource="{Binding}" Margin="4" Grid.Row="2"/>
|
||||
<DataGrid x:Name="DataGridTagSets" DataContext="{Binding ElementName=DataGridFiles, Path=SelectedItem.TagSets}" ItemsSource="{Binding}" Margin="4" Grid.Row="3"/>
|
||||
<Grid Grid.Row="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Name="TextBlockStatus" TextTrimming="CharacterEllipsis" Grid.Column="0" Margin="4" Padding="4"/>
|
||||
<Button x:Name="ButtonGetData" Content="Get Data" Grid.Column="1" Margin="4" Padding="4" Click="ButtonGetData_Click"/>
|
||||
<Button x:Name="ButtonExportData" Content="Export Data" Grid.Column="2" Margin="4" Padding="4" Click="ButtonExportData_Click"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
|
@ -0,0 +1,200 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using Microsoft.Win32;
|
||||
using Excel = Microsoft.Office.Interop.Excel;
|
||||
|
||||
namespace MicroStationTagExplorer
|
||||
{
|
||||
public class Tag
|
||||
{
|
||||
public string TagSetName { get; set; }
|
||||
public string TagDefinitionName { get; set; }
|
||||
public object Value { get; set; }
|
||||
public MicroStationDGN.DLong ID { get; set; }
|
||||
public MicroStationDGN.DLong HostID { get; set; }
|
||||
}
|
||||
|
||||
public class TagDefinition
|
||||
{
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class TagSet
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public IList<TagDefinition> TagDefinitions { get; set; }
|
||||
}
|
||||
|
||||
public class DgnFile
|
||||
{
|
||||
public string Path { get; set; }
|
||||
public IList<TagSet> TagSets { get; set; }
|
||||
public IList<Tag> Tags { get; set; }
|
||||
}
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private T CreateObject<T>(string progID)
|
||||
{
|
||||
return (T)Activator.CreateInstance(Type.GetTypeFromProgID(progID));
|
||||
}
|
||||
|
||||
private void GetTagData(DgnFile dgnFile)
|
||||
{
|
||||
MicroStationDGN.Application app = CreateObject<MicroStationDGN.Application>("MicroStationDGN.Application");
|
||||
app.Visible = true;
|
||||
|
||||
MicroStationDGN.DesignFile designFile = app.OpenDesignFile(dgnFile.Path);
|
||||
|
||||
foreach (MicroStationDGN.ModelReference model in designFile.Models)
|
||||
{
|
||||
if (model.Type == MicroStationDGN.MsdModelType.msdModelTypeNormal)
|
||||
{
|
||||
model.Activate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dgnFile.TagSets = GetTagSets(designFile);
|
||||
dgnFile.Tags = GetTags(app.ActiveModelReference);
|
||||
}
|
||||
|
||||
private IList<TagSet> GetTagSets(MicroStationDGN.DesignFile designFile)
|
||||
{
|
||||
var tagSets = new List<TagSet>();
|
||||
|
||||
foreach (MicroStationDGN.TagSet ts in designFile.TagSets)
|
||||
{
|
||||
var tagSet = new TagSet()
|
||||
{
|
||||
Name = ts.Name,
|
||||
TagDefinitions = new List<TagDefinition>()
|
||||
};
|
||||
tagSets.Add(tagSet);
|
||||
|
||||
foreach (MicroStationDGN.TagDefinition td in ts.TagDefinitions)
|
||||
{
|
||||
var tagDefinition = new TagDefinition()
|
||||
{
|
||||
Name = td.Name
|
||||
};
|
||||
tagSet.TagDefinitions.Add(tagDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
return tagSets;
|
||||
}
|
||||
|
||||
private IList<Tag> GetTags(MicroStationDGN.ModelReference model)
|
||||
{
|
||||
MicroStationDGN.ElementScanCriteria sc = CreateObject<MicroStationDGN.ElementScanCriteria>("MicroStationDGN.ElementScanCriteria");
|
||||
sc.ExcludeAllTypes();
|
||||
sc.IncludeType(MicroStationDGN.MsdElementType.msdElementTypeTag);
|
||||
|
||||
MicroStationDGN.ElementEnumerator ee = model.Scan(sc);
|
||||
Array elements = ee.BuildArrayFromContents();
|
||||
|
||||
var tags = new List<Tag>();
|
||||
|
||||
foreach (MicroStationDGN.Element element in elements)
|
||||
{
|
||||
MicroStationDGN.TagElement te = element as MicroStationDGN.TagElement;
|
||||
|
||||
var tag = new Tag()
|
||||
{
|
||||
TagSetName = te.TagSetName,
|
||||
TagDefinitionName = te.TagDefinitionName,
|
||||
Value = te.Value,
|
||||
ID = te.ID,
|
||||
HostID = te.BaseElement != null ? te.BaseElement.ID : new MicroStationDGN.DLong(),
|
||||
};
|
||||
tags.Add(tag);
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
private void FileAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new OpenFileDialog
|
||||
{
|
||||
Filter = "ALl Files (*.*)|*.*",
|
||||
Multiselect = true
|
||||
};
|
||||
var result = dlg.ShowDialog(this);
|
||||
if (result == true)
|
||||
{
|
||||
IList<DgnFile> dgnFiles = null;
|
||||
if (DataGridFiles.DataContext != null)
|
||||
{
|
||||
dgnFiles = DataGridFiles.DataContext as IList<DgnFile>;
|
||||
}
|
||||
else
|
||||
{
|
||||
dgnFiles = new List<DgnFile>();
|
||||
}
|
||||
|
||||
foreach (var fileName in dlg.FileNames)
|
||||
{
|
||||
var dgnFile = new DgnFile()
|
||||
{
|
||||
Path = fileName
|
||||
};
|
||||
dgnFiles.Add(dgnFile);
|
||||
}
|
||||
|
||||
DataGridFiles.DataContext = dgnFiles;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonGetData_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataGridFiles.DataContext != null)
|
||||
{
|
||||
int selectedIndex = DataGridFiles.SelectedIndex;
|
||||
IList<DgnFile> dgnFiles = DataGridFiles.DataContext as IList<DgnFile>;
|
||||
if (dgnFiles != null)
|
||||
{
|
||||
ButtonGetData.IsEnabled = false;
|
||||
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Dispatcher.Invoke(() => TextBlockStatus.Text = "");
|
||||
foreach (var dgnFile in dgnFiles)
|
||||
{
|
||||
Dispatcher.Invoke(() => TextBlockStatus.Text = dgnFile.Path);
|
||||
GetTagData(dgnFile);
|
||||
}
|
||||
Dispatcher.Invoke(() => TextBlockStatus.Text = "");
|
||||
Dispatcher.Invoke(() => ButtonGetData.IsEnabled = true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
Debug.WriteLine(ex.StackTrace);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonExportData_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Excel.Application app = CreateObject<Excel.Application>("Excel.Application");
|
||||
app.Visible = true;
|
||||
|
||||
Excel.Workbook wb = app.Workbooks.Add();
|
||||
Excel.Worksheet ws = wb.Worksheets.Add();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{59F5B5F5-2569-4263-9E94-D53DA097FCAD}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>MicroStationTagExplorer</RootNamespace>
|
||||
<AssemblyName>MicroStationTagExplorer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="Microsoft.Office.Core">
|
||||
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>8</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="Microsoft.Office.Interop.Excel">
|
||||
<Guid>{00020813-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>9</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="MicroStationDGN">
|
||||
<Guid>{CF9F97BF-39F2-4B8E-835C-8BE9E99DAF5B}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="VBIDE">
|
||||
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>5</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,16 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
[assembly: AssemblyTitle("MicroStationTagExplorer")]
|
||||
[assembly: AssemblyDescription("MicroStation Tag Explorer")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Wiesław Šoltés")]
|
||||
[assembly: AssemblyProduct("MicroStationTagExplorer")]
|
||||
[assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Загрузка…
Ссылка в новой задаче