Commit a3468ff8 authored by tsuji's avatar tsuji

DotNetFreamework4.6.1版のGetADocを追加

parents

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1684
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetADoc", "GetADoc\GetADoc.csproj", "{7A8DE09F-1468-4C6C-8607-8A03548AFBAC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A8DE09F-1468-4C6C-8607-8A03548AFBAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A8DE09F-1468-4C6C-8607-8A03548AFBAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A8DE09F-1468-4C6C-8607-8A03548AFBAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A8DE09F-1468-4C6C-8607-8A03548AFBAC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8FE2213E-F014-4AFB-B86C-3F99200CDAFA}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="GetADoc.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<userSettings>
<GetADoc.Properties.Settings>
<setting name="box1Setting" serializeAs="String">
<value />
</setting>
<setting name="checkbox1Setting" serializeAs="String">
<value>False</value>
</setting>
<setting name="checkbox2Setting" serializeAs="String">
<value>False</value>
</setting>
<setting name="checkbox3Setting" serializeAs="String">
<value>False</value>
</setting>
</GetADoc.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file
<Application x:Class="GetADoc.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GetADoc"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace GetADoc
{
/// <summary>
/// App.xaml の相互作用ロジック
/// </summary>
public partial class App : Application
{
}
}
<?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>{7A8DE09F-1468-4C6C-8607-8A03548AFBAC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>GetADoc</RootNamespace>
<AssemblyName>GetADoc</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</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="Microsoft.WindowsAPICodePack, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Core.1.1.0.2\lib\Microsoft.WindowsAPICodePack.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.Shell, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.Shell.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAPICodePack.ShellExtensions, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.WindowsAPICodePack-Shell.1.1.0.0\lib\Microsoft.WindowsAPICodePack.ShellExtensions.dll</HintPath>
</Reference>
<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>
<SubType>Designer</SubType>
</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>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<Window x:Name="mainWindow" x:Class="GetADoc.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:GetADoc"
mc:Ignorable="d"
Title="MainWindow" Height="250" Width="400">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="323*"/>
<ColumnDefinition Width="77*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="67*"/>
<RowDefinition Height="69*"/>
<RowDefinition Height="48*"/>
</Grid.RowDefinitions>
<Label FontWeight="Bold" FontSize="18" Grid.RowSpan="3" Grid.ColumnSpan="1">
AsciiDocの雛形を作成します
</Label>
<Label x:Name="label1" Content="作成先のフォルダ:" HorizontalAlignment="Left" Margin="10,40,0,0" VerticalAlignment="Top" Height="26"/>
<TextBox x:Name="box1" Margin="10,67,0,68" Grid.RowSpan="2" AllowDrop="True" TextWrapping="Wrap" Drop="textBox_Drop" DragOver="textBox_PreviewDragOver" Panel.ZIndex="6" VerticalScrollBarVisibility="Auto">
<フォルダ指定>
</TextBox>
<Label x:Name="label2" Content="ドキュメント名:" Grid.Row="1" HorizontalAlignment="Left" Margin="10,24,0,0" VerticalAlignment="Top" Height="26" Width="92"/>
<TextBox x:Name="box2" Margin="10,50,100,10" Grid.Row="1" AllowDrop="True" Panel.ZIndex="2"/>
<Label x:Name="label3" Content="(.adoc)" HorizontalAlignment="Left" Margin="228,45,0,4" Grid.Row="1"/>
<Button x:Name="button1" Content="参照" Grid.Column="1" HorizontalAlignment="Left" Margin="12,69,0,0" VerticalAlignment="Top" Grid.RowSpan="2" Width="46" Click="button1_Click" Panel.ZIndex="2"/>
<Button x:Name="button2" Content="作成" Grid.Column="1" HorizontalAlignment="Left" Margin="5,0,0,0" Grid.Row="2" VerticalAlignment="Center" Height="38" Width="62" Panel.ZIndex="2" Click="button2_Click"/>
<CheckBox x:Name="checkbox1" Content="SCREEN Logo" Grid.Row="2" Margin="10,9,0,0" Panel.ZIndex="2"/>
<CheckBox x:Name="checkbox2" Content="カスタムアイコン" Grid.Row="2" Margin="110,9,0,0" Panel.ZIndex="2"/>
<CheckBox x:Name="checkbox3" Content="分割ドキュメント" Grid.Row="2" Margin="210,9,0,0" Panel.ZIndex="2"/>
<TextBox x:Name="allBox" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="400" Grid.ColumnSpan="2" Height="234" Grid.RowSpan="3" Opacity="0" Cursor="Arrow"/>
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Win32;
using MSAPI = Microsoft.WindowsAPICodePack;
namespace GetADoc
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
//デフォルトに前回の設定を表示
box1.Text = Properties.Settings.Default.box1Setting;
checkbox1.IsChecked = Properties.Settings.Default.checkbox1Setting;
checkbox2.IsChecked = Properties.Settings.Default.checkbox2Setting;
checkbox3.IsChecked = Properties.Settings.Default.checkbox3Setting;
//ドラッグ&ドロップイベントの追加
allBox.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
allBox.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
box1.AddHandler(TextBox.DragOverEvent, new DragEventHandler(textBox_PreviewDragOver), true);
box1.AddHandler(TextBox.DropEvent, new DragEventHandler(textBox_Drop), true);
}
//フォルダ指定のためにファイルをドラッグ
private void textBox_PreviewDragOver(object sender, System.Windows.DragEventArgs e)
{
if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop, true))
{
e.Effects = System.Windows.DragDropEffects.Copy;
}
else
{
e.Effects = System.Windows.DragDropEffects.None;
}
e.Handled = true;
}
//エクスプローラーからテキストボックスにドロップして指定フォルダの場所をペースト
private void textBox_Drop(object sender, System.Windows.DragEventArgs e)
{
var dropFiles = e.Data.GetData(System.Windows.DataFormats.FileDrop) as string[];
if (dropFiles == null) return;
//ドロップしたものがファイルの場合、1つ上の階層のフォルダを指す
if (File.Exists(dropFiles[0]))
{
dropFiles[0] = dropFiles[0].Substring(0, dropFiles[0].LastIndexOf(@"\"));
}
box1.Text = dropFiles[0];
}
//参照ボタンClickでフォルダ選択のダイアログを表示
private void button1_Click(object sender, RoutedEventArgs e)
{
var selectFile = new MSAPI::Dialogs.CommonOpenFileDialog();
selectFile.IsFolderPicker = true;
selectFile.Title = "フォルダを選択してください";
selectFile.InitialDirectory = @"C:";
if (selectFile.ShowDialog() != MSAPI::Dialogs.CommonFileDialogResult.Ok)
{
return;
}
box1.Text = selectFile.FileName;
}
//作成ボタンClickでチェックボックスで要求された仕様のADocファイル一式を指定先フォルダに生成
private void button2_Click(object sender, RoutedEventArgs e)
{
//ファイルパスが指定されていない or 指定したフォルダが存在しない場合
if (box1.Text == "" || !Directory.Exists(box1.Text))
{
MessageBox.Show("保存先が存在しません", "Folder not selected", MessageBoxButton.OK, MessageBoxImage.Warning);
Properties.Settings.Default.box1Setting = ""; //記憶していたパスを初期化
Properties.Settings.Default.Save();
return;
}
// テキストボックス2からfile名を取得
var fileName = box2.Text;
if (box2.Text == "")
{
fileName = "t";
}
//テキストボック1から保存場所を取得
var filePath = box1.Text + @"\";
// ファイル名に使用不可の文字が含まれている場合の処理
char[] NgChars = System.IO.Path.GetInvalidFileNameChars();
char[] cutComma = { '.' };
if (fileName.IndexOfAny(NgChars) >= 0 || fileName.IndexOfAny(cutComma) >= 0)
{
string[] charsToRemove = new string[] { @"\", ".", "/", ":", "*", "?", "<", ">", "|" };
foreach (var allNg in charsToRemove)
{
fileName = fileName.Replace(allNg, string.Empty);
}
MessageBox.Show("ファイル名に使用できない文字が存在したため\n一部ファイル名を修正しました。\nもう一度作成ボタンをクリックしてください。", "Renamed this file", MessageBoxButton.OK, MessageBoxImage.Warning);
box2.Text = fileName;
return;
}
//バッチファイルの実行
ProcessStartInfo processStartInfo = new ProcessStartInfo();
string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
processStartInfo.FileName = System.IO.Path.Combine(stCurrentDir, "getADoc.Data", "getADoc.bat");
processStartInfo.CreateNoWindow = true; // コマンドプロンプトを非表示
processStartInfo.UseShellExecute = false; // シェル機能オフ
//チェックボックスの状況に応じて引数を指定
processStartInfo.Arguments = "";
if (checkbox2.IsChecked == true)//Iconsチェックボックスがオンのとき
{
processStartInfo.Arguments += "/Icons ";
}
if (checkbox1.IsChecked == true)//SCREEN Logoチェックボックスがオンのとき
{
processStartInfo.Arguments += "/SCREEN ";
}
if (checkbox3.IsChecked == true)//分割ドキュチェックボックスがオンのとき
{
processStartInfo.Arguments += "/SepaDoc ";
}
processStartInfo.Arguments += fileName;
//GetADoc.batを実行
Process process = Process.Start(processStartInfo);
process.WaitForExit();
process.Close();
//指定されたフォルダに生成物を移動
File.Move(System.IO.Path.Combine(stCurrentDir, fileName + ".adoc"), filePath + fileName + ".adoc");
File.Move(System.IO.Path.Combine(stCurrentDir, "config.adoc"), filePath + "/config.adoc");
Directory.Move(System.IO.Path.Combine(stCurrentDir, "Images"), System.IO.Path.Combine(filePath, "Images"));
if (checkbox2.IsChecked == true)
{
Directory.Move(System.IO.Path.Combine(stCurrentDir, "icons"), System.IO.Path.Combine(filePath, "icons"));
}
if (checkbox3.IsChecked == true)
{
File.Move(System.IO.Path.Combine(stCurrentDir, "IncDoc.adoc"), System.IO.Path.Combine(filePath, "IncDoc.adoc"));
Directory.Move(System.IO.Path.Combine(stCurrentDir, "Sub_First"), System.IO.Path.Combine(filePath, "Sub_First"));
Directory.Move(System.IO.Path.Combine(stCurrentDir, "Sub_Second"), System.IO.Path.Combine(filePath, "Sub_Second"));
}
//指定されたファイルパスとチェックボックスを保存
Properties.Settings.Default.box1Setting = box1.Text;
Properties.Settings.Default.checkbox1Setting = ((bool)checkbox1.IsChecked);
Properties.Settings.Default.checkbox2Setting = ((bool)checkbox2.IsChecked);
Properties.Settings.Default.checkbox3Setting = ((bool)checkbox3.IsChecked);
Properties.Settings.Default.Save();
}
}
}
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("GetADoc")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GetADoc")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
//ローカライズ可能なアプリケーションのビルドを開始するには、
//.csproj ファイルの <UICulture>CultureYouAreCodingWith</UICulture> を
//<PropertyGroup> 内部で設定します。たとえば、
//ソース ファイルで英語を使用している場合、<UICulture> を en-US に設定します。次に、
//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を
//プロジェクト ファイルの UICulture 設定と一致するよう更新します。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所
//(リソースがページ、
//またはアプリケーション リソース ディクショナリに見つからない場合に使用されます)
ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所
//(リソースがページ、
//アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます)
)]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします
// </auto-generated>
//------------------------------------------------------------------------------
namespace GetADoc.Properties
{
/// <summary>
/// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
/// </summary>
// このクラスは StronglyTypedResourceBuilder クラスによって ResGen
// または Visual Studio のようなツールを使用して自動生成されました。
// メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
// ResGen を実行し直すか、または VS プロジェクトをリビルドします。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// このクラスで使用されるキャッシュされた ResourceManager インスタンスを返します。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GetADoc.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
/// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------
namespace GetADoc.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string box1Setting {
get {
return ((string)(this["box1Setting"]));
}
set {
this["box1Setting"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool checkbox1Setting {
get {
return ((bool)(this["checkbox1Setting"]));
}
set {
this["checkbox1Setting"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool checkbox2Setting {
get {
return ((bool)(this["checkbox2Setting"]));
}
set {
this["checkbox2Setting"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool checkbox3Setting {
get {
return ((bool)(this["checkbox3Setting"]));
}
set {
this["checkbox3Setting"] = value;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="GetADoc.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="box1Setting" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="checkbox1Setting" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="checkbox2Setting" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="checkbox3Setting" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.2" targetFramework="net461" />
<package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net461" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment