Commit b62febbc authored by AP matsuo koji's avatar AP matsuo koji 😲

Ver3.0.2

* native
* date Folder
* 上書き時の連番
parent 3a849104
......@@ -38,6 +38,7 @@ image:V300UI.png[]
[cols="a,a,a", options="header, autowidth"]
|===
| Version | 日付 | 内容
| Ver3.0.2 | 2026/04/20 | Nativeフォーマット追加、日付フォルダ作成を追加
| Ver3.0.1 | 2026/01/25-03/19| 微修正
| Ver3.0.0 | 2024/11/28|GUI更新、drawio作成、ヘルプページOPEN追加
| Ver2.0.0 | 2023/9/13 |GUI更新、雛形フォーマット追加
......@@ -48,6 +49,12 @@ image:V300UI.png[]
|===
== Detail
=== Ver 3.0.2
* Nativeフォーマット追加、config.adoc不要のシンプルなもの
* 日付フォルダ作成オプション追加
=== Ver 3.0.1
* doctypeをbookからarticleに初期値を変更
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,9 +6,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GetADoc"
mc:Ignorable="d"
Title="GetADoc" Height="380" Width="590" MinWidth="590" MinHeight="380" MaxHeight="380" MaxWidth="590"
Title="GetADoc" Height="291" Width="495" MinWidth="590" MinHeight="426" MaxHeight="426" MaxWidth="590"
Loaded="Window_Loaded">
<Grid>
<Grid Margin="0,0,0,4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="16*"/>
......@@ -17,20 +17,21 @@
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="96*"/>
<RowDefinition Height="29*"/>
<RowDefinition Height="57*"/>
<RowDefinition Height="159"/>
<RowDefinition Height="50"/>
<RowDefinition Height="55"/>
<RowDefinition Height="98"/>
</Grid.RowDefinitions>
<Label x:Name="TitleLabel" FontWeight="Bold" FontSize="18" Margin="3,0,14,29" Grid.RowSpan="3" Grid.ColumnSpan="2" Content="AsciiDocの雛形を作成します"/>
<Label x:Name="label1" Content="作成先のフォルダ:" HorizontalAlignment="Center" Margin="0,110,0,0" VerticalAlignment="Top" Height="26" Width="134" FontWeight="Bold" FontSize="14"/>
<TextBox x:Name="FolderPathBox" Margin="22,144,101,0" AllowDrop="True" Drop="textBox_Drop" DragOver="textBox_PreviewDragOver" Panel.ZIndex="6" GotFocus="DeleteCompLabel" FontSize="14" Height="28" VerticalAlignment="Top" Grid.ColumnSpan="2" VerticalContentAlignment="Center">
<Label x:Name="TitleLabel" FontWeight="Bold" FontSize="18" Margin="3,-2,14,0" Grid.RowSpan="4" Grid.ColumnSpan="2" Content="AsciiDocの雛形を作成します"/>
<Label x:Name="label1" Content="作成先のフォルダ:" HorizontalAlignment="Center" Margin="0,92,0,0" VerticalAlignment="Top" Height="26" Width="134" FontWeight="Bold" FontSize="14"/>
<TextBox x:Name="FolderPathBox" Margin="22,118,101,0" AllowDrop="True" Drop="textBox_Drop" DragOver="textBox_PreviewDragOver" Panel.ZIndex="6" GotFocus="DeleteCompLabel" FontSize="14" Height="28" VerticalAlignment="Top" Grid.ColumnSpan="2" VerticalContentAlignment="Center">
<フォルダ指定>
</TextBox>
<Label x:Name="label2" Content="ドキュメント名:" HorizontalAlignment="Left" Width="97" Margin="10,12,0,9" FontWeight="Bold" FontSize="14" Grid.Row="1"/>
<TextBox x:Name="ADocNameBox" Margin="116,0,101,0" AllowDrop="True" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="26" VerticalAlignment="Center" Grid.ColumnSpan="2" Grid.Row="1" VerticalContentAlignment="Center"/>
<Label x:Name="label2" Content="ドキュメント名:" HorizontalAlignment="Left" Width="98" Margin="16,8,0,7" FontWeight="Bold" FontSize="14" Grid.Row="1"/>
<TextBox x:Name="ADocNameBox" Margin="117,0,101,0" AllowDrop="True" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="26" VerticalAlignment="Center" VerticalContentAlignment="Center" Grid.Row="1" Grid.ColumnSpan="2"/>
<Label x:Name="label3" Content="(.adoc)" Margin="327,14,20,11" FontWeight="Bold" FontSize="14" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Grid.Row="1">
<Label x:Name="label3" Content="(.adoc)" Margin="327,12,20,13" FontWeight="Bold" FontSize="14" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Grid.Row="1">
<Label.RenderTransform>
<TransformGroup>
<ScaleTransform/>
......@@ -40,13 +41,25 @@
</TransformGroup>
</Label.RenderTransform>
</Label>
<Button x:Name="button1" Content="参照" Margin="335,144,25,0" VerticalAlignment="Top" Click="button1_Click" Panel.ZIndex="2" Height="28" GotFocus="DeleteCompLabel" FontWeight="Bold" FontSize="14" RenderTransformOrigin="0.509,1.356" Grid.Column="1"/>
<Button x:Name="button2" Content="作成" Margin="0,0,25,14" Panel.ZIndex="2" Click="button2_Click" Height="50" VerticalAlignment="Bottom" GotFocus="DeleteCompLabel" RenderTransformOrigin="0.726,1.024" FontSize="14" FontWeight="Bold" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" Width="97"/>
<CheckBox x:Name="ScreenCheckbox" Content="SCREEN Logo" Margin="35,44,15,0" Panel.ZIndex="2" Height="21" VerticalAlignment="Top" GotFocus="DeleteCompLabel" FontSize="14" Grid.Row="2"/>
<CheckBox x:Name="IconCheckbox" Content="カスタムアイコン" Margin="6.5,44,0,0" Panel.ZIndex="2" Height="21" VerticalAlignment="Top" GotFocus="DeleteCompLabel" HorizontalAlignment="Left" Width="114" FontSize="14" Grid.Row="2" Grid.Column="1"/>
<CheckBox x:Name="SepaDocCheckbox" Content="分割ドキュメント" Margin="35,71,10,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" FontSize="14" Grid.Row="2" Height="18" VerticalAlignment="Top"/>
<TextBox x:Name="allBox" TextWrapping="Wrap" Opacity="0" Cursor="Arrow" Margin="0,7,0,-7" Grid.RowSpan="3" Grid.ColumnSpan="2"/>
<Label x:Name="CompletedLabel" Content="作成が完了しました!" HorizontalAlignment="Left" Margin="150,38,0,0" VerticalAlignment="Top" Width="133" FontWeight="Bold" Foreground="#FFD70B0B" Height="26" FontSize="14" Grid.Row="2" Grid.Column="1" Visibility="Hidden"/>
<Grid Grid.Row="2" Grid.ColumnSpan="2" Margin="33,0,1,0" Height="26" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="136"/>
<ColumnDefinition Width="36"/>
<ColumnDefinition Width="124"/>
<ColumnDefinition Width="76"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox x:Name="DateFolderCheckbox" Content="日付付フォルダ作成" Panel.ZIndex="2" Height="21" VerticalAlignment="Center" GotFocus="DeleteCompLabel" Click="DateFolderOptionChanged" HorizontalAlignment="Left" Width="130" FontSize="14"/>
<DatePicker x:Name="FolderDatePicker" Grid.Column="2" VerticalAlignment="Center" Height="26" Width="118" SelectedDateFormat="Short" GotFocus="DeleteCompLabel" Panel.ZIndex="2"/>
<TextBox x:Name="DateFolderNameBox" Grid.Column="3" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="22" VerticalAlignment="Center" VerticalContentAlignment="Center" Grid.ColumnSpan="2" Margin="9,0,29,0"/>
</Grid>
<Button x:Name="button1" Content="参照" Margin="335,118,25,0" VerticalAlignment="Top" Click="button1_Click" Panel.ZIndex="2" Height="28" GotFocus="DeleteCompLabel" FontWeight="Bold" FontSize="14" RenderTransformOrigin="0.509,1.356" Grid.Column="1"/>
<Button x:Name="button2" Content="作成" Margin="283,52,0,0" Panel.ZIndex="2" Click="button2_Click" Height="37" VerticalAlignment="Top" GotFocus="DeleteCompLabel" RenderTransformOrigin="0.726,1.024" FontSize="14" FontWeight="Bold" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Width="120"/>
<CheckBox x:Name="ScreenCheckbox" Content="SCREEN Logo" Margin="35,44,15,0" Panel.ZIndex="2" Height="21" VerticalAlignment="Top" GotFocus="DeleteCompLabel" FontSize="14" Grid.Row="3"/>
<CheckBox x:Name="IconCheckbox" Content="カスタムアイコン" Margin="6,44,0,0" Panel.ZIndex="2" Height="21" VerticalAlignment="Top" GotFocus="DeleteCompLabel" HorizontalAlignment="Left" Width="114" FontSize="14" Grid.Row="3" Grid.Column="1"/>
<CheckBox x:Name="SepaDocCheckbox" Content="分割ドキュメント" Margin="35,71,10,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" FontSize="14" Grid.Row="3" Height="18" VerticalAlignment="Top"/>
<TextBox x:Name="allBox" TextWrapping="Wrap" Opacity="0" IsHitTestVisible="False" Cursor="Arrow" Margin="0,5,0,0" Grid.RowSpan="4" Grid.ColumnSpan="2" Text="&#x9;"/>
<Label x:Name="CompletedLabel" Content="作成が完了しました!" HorizontalAlignment="Left" Margin="150,38,0,0" VerticalAlignment="Top" Width="133" FontWeight="Bold" Foreground="#FFD70B0B" Height="26" FontSize="14" Grid.Row="3" Grid.Column="1" Visibility="Hidden"/>
<!-- Visibility="Hidden" -->
<!--<CheckBox x:Name="MyPathCheckbox" Content="保存Path" Margin="8,118,290,0" Panel.ZIndex="2" Height="22" VerticalAlignment="Top" GotFocus="DeleteCompLabel" Click="MyPathClick" FontWeight="Bold" FontSize="14" Grid.Column="1"/>-->
<Label x:Name="SavePathLabel" Content="Pathが未登録です&#xD;&#xA;これから出力するPathを登録します" HorizontalAlignment="Center" VerticalAlignment="Top" Width="184" FontWeight="Bold" Foreground="#FFD70B0B" Height="42" Margin="0,97,0,0" Grid.Column="1" Visibility="Hidden"/>
......@@ -55,17 +68,17 @@
<!-- Visibility="Hidden" -->
<!-- ここから2024追加分 -->
<Label x:Name="label4" Content="オプション:" HorizontalAlignment="Left" Margin="12,7,0,0" VerticalAlignment="Top" Height="26" Width="92" FontWeight="Bold" FontSize="14" Grid.Row="2"/>
<CheckBox x:Name="FreePageCheckbox" Content="フリーページ" Margin="6.5,71,306,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="18" VerticalAlignment="Top" FontSize="14" Grid.Row="2" Grid.Column="1"/>
<Label x:Name="label5" Content="文書フォーマット:" HorizontalAlignment="Left" VerticalAlignment="Top" Height="26" Width="109" Margin="12,57,0,0" FontWeight="Bold" FontSize="14"/>
<ComboBox HorizontalAlignment="Left" Name="DocStileBox" Margin="128,60,0,0" VerticalAlignment="Top" Width="306" Height="22" Grid.ColumnSpan="2"/>
<Label x:Name="label6" Content="JP      En" Margin="295,59,0,0" VerticalAlignment="Top" Height="26" HorizontalAlignment="Left" Width="112" Grid.Column="1"/>
<local:ToggleSwitch x:Name="ToggleButton" HorizontalAlignment="Left" Height="26" VerticalAlignment="Top" Width="60" Margin="318,59,0,0" TrackBackgroundOnColor="#FF1C87EA" TrackBackgroundOffColor="#FFECEAEA" CircleBackgroundColor="#FFBFD8FF" IsOn="{Binding Ts_Status()}" Grid.Column="1"/>
<Label x:Name="label4" Content="オプション:" HorizontalAlignment="Left" Margin="18,7,0,0" VerticalAlignment="Top" Height="26" Width="92" FontWeight="Bold" FontSize="14" Grid.Row="3"/>
<CheckBox x:Name="FreePageCheckbox" Content="フリーページ" Margin="6,71,306,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="18" VerticalAlignment="Top" FontSize="14" Grid.Row="3" Grid.Column="1"/>
<Label x:Name="label5" Content="文書フォーマット:" HorizontalAlignment="Left" VerticalAlignment="Top" Height="26" Width="109" Margin="14,54,0,0" FontWeight="Bold" FontSize="14"/>
<ComboBox HorizontalAlignment="Left" Name="DocStileBox" Margin="142,58,0,0" VerticalAlignment="Top" Width="306" Height="22" Grid.ColumnSpan="2"/>
<Label x:Name="label6" Content="JP      En" Margin="178,10,0,0" VerticalAlignment="Top" Height="26" HorizontalAlignment="Left" Width="112" Grid.Column="1"/>
<local:ToggleSwitch x:Name="ToggleButton" HorizontalAlignment="Left" Height="26" VerticalAlignment="Top" Width="60" Margin="200,12,0,0" TrackBackgroundOnColor="#FF1C87EA" TrackBackgroundOffColor="#FFECEAEA" CircleBackgroundColor="#FFBFD8FF" IsOn="{Binding Ts_Status}" Grid.Column="1"/>
<!--<CheckBox x:Name="RightClickCheckbox" Content="右クリックショートカット追加(初回のみ)" Margin="15,94,25,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="18" VerticalAlignment="Top" FontSize="14" Grid.Row="2" Grid.Column="1"/>-->
<Button x:Name="ToggleChanger" Grid.Column="1" Content="Button" HorizontalAlignment="Left" Height="23" Margin="324,61,0,0" VerticalAlignment="Top" Width="52" Opacity="0" Click="LanguageChange"/>
<Button x:Name="RightClickInstButton" Grid.Column="1" Content="右クリックショートカット追加" HorizontalAlignment="Left" Margin="15.5,11,0,0" Grid.Row="2" VerticalAlignment="Top" Width="148" FontWeight="Bold" Click="RightInstRun"/>
<CheckBox x:Name="Drawiobox" Content="drawioファイル" Margin="135.5,71,159,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="18" VerticalAlignment="Top" FontSize="14" Grid.Row="2" Grid.Column="1"/>
<Button x:Name="HelpPageButton" Grid.Column="1" Content="ヘルプ" HorizontalAlignment="Left" Margin="317,8,0,0" VerticalAlignment="Top" Width="64" FontWeight="Bold" Click="helpButton_Click"/>
<Button x:Name="ToggleChanger" Grid.Column="1" Content="Button" HorizontalAlignment="Left" Height="22" Margin="208,12,0,0" VerticalAlignment="Top" Width="52" Opacity="0" Click="LanguageChange"/>
<Button x:Name="RightClickInstButton" Grid.Column="1" Content="右クリックショートカット追加" HorizontalAlignment="Left" Margin="250,5,0,0" Grid.Row="3" VerticalAlignment="Top" Width="148" FontWeight="Bold" Click="RightInstRun" Height="20"/>
<CheckBox x:Name="Drawiobox" Content="drawioファイル" Margin="136,71,159,0" Panel.ZIndex="2" GotFocus="DeleteCompLabel" Height="18" VerticalAlignment="Top" FontSize="14" Grid.Row="3" Grid.Column="1"/>
<Button x:Name="HelpPageButton" Grid.Column="1" Content="ヘルプ" HorizontalAlignment="Left" Margin="334,15,0,0" VerticalAlignment="Top" Width="64" FontWeight="Bold" Click="helpButton_Click" Height="20"/>
</Grid>
</Window>
\ No newline at end of file
......@@ -48,6 +48,9 @@ namespace GetADoc
// //RightClickCheckbox.Visibility = Visibility.Collapsed; //チェックボックスがONになっていれば非表示(過去に右クリック登録済み)
//}
ToggleButton.IsOn = Properties.Settings.Default.languageSetting;
FolderDatePicker.SelectedDate = DateTime.Today;
DateFolderNameBox.Text = "";
SetDateFolderOptionState();
//Pathの初期設定(引数指定で起動していれば引数のpath、指定していなければ前回の値)
string[] argPathBox = Environment.GetCommandLineArgs();
......@@ -117,6 +120,84 @@ namespace GetADoc
ADocNameBox.Focus();
}
private void DateFolderOptionChanged(object sender, RoutedEventArgs e)
{
DeleteCompLabel(sender, e);
SetDateFolderOptionState();
}
private void SetDateFolderOptionState()
{
bool isEnabled = DateFolderCheckbox.IsChecked == true;
if (FolderDatePicker != null)
{
FolderDatePicker.IsEnabled = isEnabled;
}
if (DateFolderNameBox != null)
{
DateFolderNameBox.IsEnabled = isEnabled;
}
}
private string GetOutputFolderPath(string baseFolderPath)
{
if (DateFolderCheckbox.IsChecked != true)
{
return baseFolderPath + @"\";
}
if (!FolderDatePicker.SelectedDate.HasValue)
{
string errMsg = "日付を指定してください";
if (ToggleButton.IsOn)
{
errMsg = "Please select a date.";
}
CustomMsgBox.Show(mainWindow, errMsg, "Date", MessageBoxButton.OK, MessageBoxImage.Warning);
return null;
}
string folderName = DateFolderNameBox.Text == null ? string.Empty : DateFolderNameBox.Text.Trim();
char[] invalidFolderChars = System.IO.Path.GetInvalidFileNameChars();
if (folderName.IndexOfAny(invalidFolderChars) >= 0)
{
folderName = new string(folderName.Where(c => invalidFolderChars.Contains(c) == false).ToArray());
string errMsg = "フォルダ名に使用できない文字が存在したため\n一部フォルダ名を修正しました。\nもう一度作成ボタンをクリックしてください。";
if (ToggleButton.IsOn)
{
errMsg = "Some folder names have been modified because they contained invalid characters. Please click the Create button again.";
}
CustomMsgBox.Show(mainWindow, errMsg, "Renamed this folder", MessageBoxButton.OK, MessageBoxImage.Warning);
DateFolderNameBox.Text = folderName;
return null;
}
string dateFolderName = FolderDatePicker.SelectedDate.Value.ToString("yyyyMMdd");
if (folderName != string.Empty)
{
dateFolderName += "_" + folderName;
}
return System.IO.Path.Combine(baseFolderPath, dateFolderName) + @"\";
}
private string GetSequentialFileName(string filePath, string fileName)
{
string sequentialFileName = fileName;
int index = 1;
while (File.Exists(System.IO.Path.Combine(filePath, sequentialFileName + ".adoc")))
{
sequentialFileName = fileName + "_" + index;
index++;
}
return sequentialFileName;
}
//保存Pathのチェックボックスをクリックする(ONにする)と登録したPahtをTextBoxに表示  //2024/12/27 保存Path廃止
//private void MyPathClick(object sender, RoutedEventArgs e)
//{
......@@ -257,7 +338,11 @@ namespace GetADoc
fileName = "t";
}
//テキストボック1から保存場所を取得
var filePath = FolderPathBox.Text + @"\";
var filePath = GetOutputFolderPath(FolderPathBox.Text);
if (filePath == null)
{
return;
}
// ファイル名に使用不可の文字が含まれている場合の処理
char[] NgChars = System.IO.Path.GetInvalidFileNameChars();
......@@ -277,8 +362,16 @@ namespace GetADoc
return;
}
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
fileName = GetSequentialFileName(filePath, fileName);
ADocNameBox.Text = fileName;
//指定したフォルダに同名の.adocや既存の付属ファイル(config.adocなど)がある場合の処理
if (File.Exists(System.IO.Path.Combine(filePath, fileName + ".adoc")) || File.Exists(System.IO.Path.Combine(filePath, "config.adoc"))
if (File.Exists(System.IO.Path.Combine(filePath, "config.adoc"))
|| Directory.Exists(System.IO.Path.Combine(filePath, "Images")) || Directory.Exists(System.IO.Path.Combine(filePath, "icons"))
|| Directory.Exists(System.IO.Path.Combine(filePath, "Sub_First")) || Directory.Exists(System.IO.Path.Combine(filePath, "Sub_Second")))
{
......@@ -412,6 +505,9 @@ namespace GetADoc
label2.Content = "ドキュメント名:";
label4.Content = "オプション:";
label5.Content = "文書フォーマット:";
DateFolderCheckbox.Content = "日付フォルダ作成";
//label7.Content = "日付:";
//label8.Content = "フォルダ名:";
CompletedLabel.Content = "作成が完了しました!";
......@@ -453,6 +549,9 @@ namespace GetADoc
label2.Content = "File Name";
label4.Content = "Oputions";
label5.Content = "Format";
DateFolderCheckbox.Content = "Create dated folder";
//label7.Content = "Date:";
//label8.Content = "Folder Name:";
CompletedLabel.Content = "Completed!";
......
......@@ -51,5 +51,5 @@ using System.Windows;
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.1")]
[assembly: AssemblyFileVersion("3.0.0.1")]
[assembly: AssemblyVersion("3.0.0.2")]
[assembly: AssemblyFileVersion("3.0.0.2")]
......@@ -25,8 +25,6 @@ namespace GetADoc
//バッチファイルの実行
public static void runBatch(bool icon, bool screen, bool sepa, bool free, bool language, bool drawio, string fileName, string filePath, string tempType)
{
//コンソール呼び出し
ProcessStartInfo processStartInfo = new ProcessStartInfo();
string appPath = System.Reflection.Assembly.GetExecutingAssembly().Location; //モジュールのパスを取得
......@@ -87,7 +85,7 @@ namespace GetADoc
}
else if (tempType == "Native")
{
processStartInfo.Arguments += "/Templete Native ";
processStartInfo.Arguments += "/Template Native ";
}
else
{
......@@ -96,7 +94,7 @@ namespace GetADoc
//既存の生成物が指定先フォルダに存在する場合は上書きする
processStartInfo.Arguments += "/Force ";
var pathAndName = System.IO.Path.Combine(filePath, fileName);
pathAndName = "\"" + pathAndName + "\"";
processStartInfo.Arguments += pathAndName;
......@@ -105,8 +103,6 @@ namespace GetADoc
Process process = Process.Start(processStartInfo);
process.WaitForExit();
process.Close();
}
/// <summary>
......
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