Make search syntax dialog field names scrollable

This commit is contained in:
Michael Bucari-Tovo 2025-07-22 15:39:43 -06:00
parent 0f4197924e
commit 1f473039e1
4 changed files with 364 additions and 133 deletions

View File

@ -2,71 +2,73 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="650" xmlns:dialogs="clr-namespace:LibationAvalonia.Dialogs"
MinWidth="800" MinHeight="650" x:DataType="dialogs:SearchSyntaxDialog"
MaxWidth="800" MaxHeight="650" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="50"
MinWidth="500" MinHeight="650"
Width="800" Height="650" Width="800" Height="650"
x:Class="LibationAvalonia.Dialogs.SearchSyntaxDialog" x:Class="LibationAvalonia.Dialogs.SearchSyntaxDialog"
Title="Filter Options" Title="Filter Options"
WindowStartupLocation="CenterOwner"> WindowStartupLocation="CenterOwner">
<Grid <Grid
Margin="10,0,10,10" RowDefinitions="Auto,*"
RowDefinitions="Auto,Auto,*" ColumnDefinitions="*,*,*,*">
ColumnDefinitions="Auto,Auto,Auto,Auto">
<Grid.Styles> <Grid.Styles>
<Style Selector="Grid > Grid">
<Setter Property="Margin" Value="10,0" />
</Style>
<Style Selector="Grid > TextBlock">
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
<Style Selector="TextBlock"> <Style Selector="TextBlock">
<Setter Property="FontSize" Value="12" /> <Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="10" /> <Setter Property="Margin" Value="0,5" />
</Style>
<Style Selector="ListBox">
<Setter Property="Margin" Value="0,5,0,10"/>
<Style Selector="^ > ListBoxItem">
<Setter Property="Padding" Value="0"/>
<Style Selector="^ TextBlock">
<Setter Property="Margin" Value="8,1"/>
</Style>
</Style>
</Style> </Style>
</Grid.Styles> </Grid.Styles>
<TextBlock <Grid
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="4" Grid.ColumnSpan="4"
Text="Full Lucene query syntax is supported&#xa;Fields with similar names are synomyns (eg: Author, Authors, AuthorNames)&#xa;&#xa;TAG FORMAT: [tagName]" /> RowDefinitions="Auto,Auto">
<TextBlock <TextBlock
Grid.Row="1" Text="Full Lucene query syntax is supported&#xa;Fields with similar names are synomyns (eg: Author, Authors, AuthorNames)" />
Grid.Column="0"
Text="STRING FIELDS" /> <TextBlock Grid.Row="1" Text="TAG FORMAT: [tagName]" />
</Grid>
<TextBlock
Grid.Row="1" <Grid Grid.Row="1" RowDefinitions="Auto,Auto,*">
Grid.Column="1" <TextBlock Text="NUMBER FIELDS" />
Text="NUMBER FIELDS" /> <TextBlock Grid.Row="1" Text="{CompiledBinding StringUsage}" />
<ListBox Grid.Row="2" ItemsSource="{CompiledBinding StringFields}"/>
<TextBlock </Grid>
Grid.Row="1"
Grid.Column="2" <Grid Grid.Row="1" Grid.Column="1" RowDefinitions="Auto,Auto,*">
Text="BOOLEAN (TRUE/FALSE) FIELDS" /> <TextBlock Text="STRING FIELDS" />
<TextBlock Grid.Row="1" Text="{CompiledBinding NumberUsage}" />
<TextBlock <ListBox Grid.Row="2" ItemsSource="{CompiledBinding NumberFields}"/>
Grid.Row="1" </Grid>
Grid.Column="3"
Text="ID FIELDS" /> <Grid Grid.Row="1" Grid.Column="2" RowDefinitions="Auto,Auto,*">
<TextBlock Text="BOOLEAN (TRUE/FALSE) FIELDS" />
<TextBlock <TextBlock Grid.Row="1" Text="{CompiledBinding BoolUsage}" />
Grid.Row="2" <ListBox Grid.Row="2" ItemsSource="{CompiledBinding BoolFields}"/>
Grid.Column="0" </Grid>
Text="{Binding StringFields}" />
<Grid Grid.Row="1" Grid.Column="3" RowDefinitions="Auto,Auto,*">
<TextBlock <TextBlock Text="ID FIELDS" />
Grid.Row="2" <TextBlock Grid.Row="1" Text="{CompiledBinding IdUsage}" />
Grid.Column="1" <ListBox Grid.Row="2" ItemsSource="{CompiledBinding IdFields}"/>
Text="{Binding NumberFields}" /> </Grid>
<TextBlock
Grid.Row="2"
Grid.Column="2"
Text="{Binding BoolFields}" />
<TextBlock
Grid.Row="2"
Grid.Column="3"
Text="{Binding IdFields}" />
</Grid> </Grid>
</Window> </Window>

View File

@ -1,59 +1,55 @@
using LibationSearchEngine; using LibationSearchEngine;
using System.Linq;
namespace LibationAvalonia.Dialogs namespace LibationAvalonia.Dialogs
{ {
public partial class SearchSyntaxDialog : DialogWindow public partial class SearchSyntaxDialog : DialogWindow
{ {
public string StringFields { get; init; } public string StringUsage { get; }
public string NumberFields { get; init; } public string NumberUsage { get; }
public string BoolFields { get; init; } public string BoolUsage { get; }
public string IdFields { get; init; } public string IdUsage { get; }
public string[] StringFields { get; } = SearchEngine.FieldIndexRules.StringFieldNames.ToArray();
public string[] NumberFields { get; } = SearchEngine.FieldIndexRules.NumberFieldNames.ToArray();
public string[] BoolFields { get; } = SearchEngine.FieldIndexRules.BoolFieldNames.ToArray();
public string[] IdFields { get; } = SearchEngine.FieldIndexRules.IdFieldNames.ToArray();
public SearchSyntaxDialog() public SearchSyntaxDialog()
{ {
InitializeComponent(); InitializeComponent();
StringFields = @" StringUsage = """
Search for wizard of oz: Search for wizard of oz:
title:oz title:oz
title:""wizard of oz"" title:"wizard of oz"
""";
NumberUsage = """
Find books between 1-100 minutes long
length:[1 TO 100]
Find books exactly 1 hr long
length:60
Find books published from 2020-1-1 to
2023-12-31
datepublished:[20200101 TO 20231231]
""";
" + string.Join("\r\n", SearchEngine.FieldIndexRules.StringFieldNames); BoolUsage = """
Find books that you haven't rated:
-IsRated
""";
NumberFields = @" IdUsage = """
Find books between 1-100 minutes long Alice's Adventures in
length:[1 TO 100] Wonderland (ID: B015D78L0U)
Find books exactly 1 hr long
length:60
Find books published from 2020-1-1 to
2023-12-31
datepublished:[20200101 TO 20231231]
id:B015D78L0U
" + string.Join("\r\n", SearchEngine.FieldIndexRules.NumberFieldNames); All of these are synonyms
for the ID field
BoolFields = @" """;
Find books that you haven't rated:
-IsRated
" + string.Join("\r\n", SearchEngine.FieldIndexRules.BoolFieldNames);
IdFields = @"
Alice's Adventures in
Wonderland (ID: B015D78L0U)
id:B015D78L0U
All of these are synonyms
for the ID field
" + string.Join("\r\n", SearchEngine.FieldIndexRules.IdFieldNames);
DataContext = this; DataContext = this;
} }
} }
} }

View File

@ -34,7 +34,26 @@
label3 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label();
label4 = new System.Windows.Forms.Label(); label4 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label(); label5 = new System.Windows.Forms.Label();
closeBtn = new System.Windows.Forms.Button(); tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
lboxIdFields = new System.Windows.Forms.ListBox();
label9 = new System.Windows.Forms.Label();
tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
lboxBoolFields = new System.Windows.Forms.ListBox();
label8 = new System.Windows.Forms.Label();
tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
lboxNumberFields = new System.Windows.Forms.ListBox();
label7 = new System.Windows.Forms.Label();
tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
lboxStringFields = new System.Windows.Forms.ListBox();
label6 = new System.Windows.Forms.Label();
label10 = new System.Windows.Forms.Label();
label11 = new System.Windows.Forms.Label();
tableLayoutPanel1.SuspendLayout();
tableLayoutPanel5.SuspendLayout();
tableLayoutPanel4.SuspendLayout();
tableLayoutPanel3.SuspendLayout();
tableLayoutPanel2.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
// label1 // label1
@ -43,75 +62,262 @@
label1.Location = new System.Drawing.Point(14, 10); label1.Location = new System.Drawing.Point(14, 10);
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label1.Name = "label1"; label1.Name = "label1";
label1.Size = new System.Drawing.Size(410, 60); label1.Size = new System.Drawing.Size(410, 30);
label1.TabIndex = 0; label1.TabIndex = 0;
label1.Text = "Full Lucene query syntax is supported\r\nFields with similar names are synomyns (eg: Author, Authors, AuthorNames)\r\n\r\nTAG FORMAT: [tagName]"; label1.Text = "Full Lucene query syntax is supported\r\nFields with similar names are synomyns (eg: Author, Authors, AuthorNames)";
// //
// label2 // label2
// //
label2.Anchor = System.Windows.Forms.AnchorStyles.Top;
label2.AutoSize = true; label2.AutoSize = true;
label2.Location = new System.Drawing.Point(14, 82); label2.Location = new System.Drawing.Point(48, 18);
label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label2.Name = "label2"; label2.Name = "label2";
label2.Size = new System.Drawing.Size(129, 75); label2.Size = new System.Drawing.Size(129, 45);
label2.TabIndex = 1; label2.TabIndex = 1;
label2.Text = "STRING FIELDS\r\n\r\nSearch for wizard of oz:\r\n title:oz\r\n title:\"wizard of oz\""; label2.Text = "Search for wizard of oz:\r\n title:oz\r\n title:\"wizard of oz\"";
// //
// label3 // label3
// //
label3.Anchor = System.Windows.Forms.AnchorStyles.Top;
label3.AutoSize = true; label3.AutoSize = true;
label3.Location = new System.Drawing.Point(272, 82); label3.Location = new System.Drawing.Point(4, 18);
label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label3.Name = "label3"; label3.Name = "label3";
label3.Size = new System.Drawing.Size(224, 135); label3.Size = new System.Drawing.Size(218, 120);
label3.TabIndex = 2; label3.TabIndex = 2;
label3.Text = resources.GetString("label3.Text"); label3.Text = resources.GetString("label3.Text");
// //
// label4 // label4
// //
label4.Anchor = System.Windows.Forms.AnchorStyles.Top;
label4.AutoSize = true; label4.AutoSize = true;
label4.Location = new System.Drawing.Point(530, 82); label4.Location = new System.Drawing.Point(19, 18);
label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label4.Name = "label4"; label4.Name = "label4";
label4.Size = new System.Drawing.Size(187, 60); label4.Size = new System.Drawing.Size(187, 30);
label4.TabIndex = 3; label4.TabIndex = 3;
label4.Text = "BOOLEAN (TRUE/FALSE) FIELDS\r\n\r\nFind books that you haven't rated:\r\n -IsRated"; label4.Text = "Find books that you haven't rated:\r\n -IsRated";
// //
// label5 // label5
// //
label5.Anchor = System.Windows.Forms.AnchorStyles.Top;
label5.AutoSize = true; label5.AutoSize = true;
label5.Location = new System.Drawing.Point(785, 82); label5.Location = new System.Drawing.Point(8, 18);
label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
label5.Name = "label5"; label5.Name = "label5";
label5.Size = new System.Drawing.Size(278, 90); label5.Size = new System.Drawing.Size(209, 90);
label5.TabIndex = 4; label5.TabIndex = 4;
label5.Text = "ID FIELDS\r\n\r\nAlice's Adventures in Wonderland (ID: B015D78L0U)\r\n id:B015D78L0U\r\n\r\nAll of these are synonyms for the ID field"; label5.Text = "Alice's Adventures in Wonderland (ID: B015D78L0U)\r\n id:B015D78L0U\r\n\r\nAll of these are synonyms for the ID field";
// //
// closeBtn // tableLayoutPanel1
// //
closeBtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right; tableLayoutPanel1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
closeBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; tableLayoutPanel1.ColumnCount = 4;
closeBtn.Location = new System.Drawing.Point(1038, 537); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
closeBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
closeBtn.Name = "closeBtn"; tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
closeBtn.Size = new System.Drawing.Size(88, 27); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
closeBtn.TabIndex = 5; tableLayoutPanel1.Controls.Add(tableLayoutPanel5, 3, 0);
closeBtn.Text = "Close"; tableLayoutPanel1.Controls.Add(tableLayoutPanel4, 2, 0);
closeBtn.UseVisualStyleBackColor = true; tableLayoutPanel1.Controls.Add(tableLayoutPanel3, 1, 0);
closeBtn.Click += CloseBtn_Click; tableLayoutPanel1.Controls.Add(tableLayoutPanel2, 0, 0);
tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
tableLayoutPanel1.Location = new System.Drawing.Point(12, 51);
tableLayoutPanel1.Name = "tableLayoutPanel1";
tableLayoutPanel1.RowCount = 1;
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel1.Size = new System.Drawing.Size(928, 425);
tableLayoutPanel1.TabIndex = 6;
//
// tableLayoutPanel5
//
tableLayoutPanel5.ColumnCount = 1;
tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel5.Controls.Add(lboxIdFields, 0, 2);
tableLayoutPanel5.Controls.Add(label5, 0, 1);
tableLayoutPanel5.Controls.Add(label9, 0, 0);
tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel5.Location = new System.Drawing.Point(699, 3);
tableLayoutPanel5.Name = "tableLayoutPanel5";
tableLayoutPanel5.RowCount = 3;
tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel5.Size = new System.Drawing.Size(226, 419);
tableLayoutPanel5.TabIndex = 10;
//
// lboxIdFields
//
lboxIdFields.Dock = System.Windows.Forms.DockStyle.Fill;
lboxIdFields.FormattingEnabled = true;
lboxIdFields.Location = new System.Drawing.Point(3, 111);
lboxIdFields.Name = "lboxIdFields";
lboxIdFields.Size = new System.Drawing.Size(220, 305);
lboxIdFields.TabIndex = 0;
//
// label9
//
label9.Anchor = System.Windows.Forms.AnchorStyles.Top;
label9.AutoSize = true;
label9.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline);
label9.Location = new System.Drawing.Point(86, 0);
label9.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
label9.Name = "label9";
label9.Size = new System.Drawing.Size(54, 15);
label9.TabIndex = 7;
label9.Text = "ID Fields";
label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel4
//
tableLayoutPanel4.ColumnCount = 1;
tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel4.Controls.Add(lboxBoolFields, 0, 2);
tableLayoutPanel4.Controls.Add(label4, 0, 1);
tableLayoutPanel4.Controls.Add(label8, 0, 0);
tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel4.Location = new System.Drawing.Point(467, 3);
tableLayoutPanel4.Name = "tableLayoutPanel4";
tableLayoutPanel4.RowCount = 3;
tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel4.Size = new System.Drawing.Size(226, 419);
tableLayoutPanel4.TabIndex = 9;
//
// lboxBoolFields
//
lboxBoolFields.Dock = System.Windows.Forms.DockStyle.Fill;
lboxBoolFields.FormattingEnabled = true;
lboxBoolFields.Location = new System.Drawing.Point(3, 51);
lboxBoolFields.Name = "lboxBoolFields";
lboxBoolFields.Size = new System.Drawing.Size(220, 365);
lboxBoolFields.TabIndex = 0;
//
// label8
//
label8.Anchor = System.Windows.Forms.AnchorStyles.Top;
label8.AutoSize = true;
label8.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline);
label8.Location = new System.Drawing.Point(36, 0);
label8.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
label8.Name = "label8";
label8.Size = new System.Drawing.Size(154, 15);
label8.TabIndex = 7;
label8.Text = "Boolean (True/False) Fields";
label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel3
//
tableLayoutPanel3.ColumnCount = 1;
tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel3.Controls.Add(lboxNumberFields, 0, 2);
tableLayoutPanel3.Controls.Add(label3, 0, 1);
tableLayoutPanel3.Controls.Add(label7, 0, 0);
tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel3.Location = new System.Drawing.Point(235, 3);
tableLayoutPanel3.Name = "tableLayoutPanel3";
tableLayoutPanel3.RowCount = 3;
tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel3.Size = new System.Drawing.Size(226, 419);
tableLayoutPanel3.TabIndex = 8;
//
// lboxNumberFields
//
lboxNumberFields.Dock = System.Windows.Forms.DockStyle.Fill;
lboxNumberFields.FormattingEnabled = true;
lboxNumberFields.Location = new System.Drawing.Point(3, 141);
lboxNumberFields.Name = "lboxNumberFields";
lboxNumberFields.Size = new System.Drawing.Size(220, 275);
lboxNumberFields.TabIndex = 0;
//
// label7
//
label7.Anchor = System.Windows.Forms.AnchorStyles.Top;
label7.AutoSize = true;
label7.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline);
label7.Location = new System.Drawing.Point(69, 0);
label7.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
label7.Name = "label7";
label7.Size = new System.Drawing.Size(87, 15);
label7.TabIndex = 7;
label7.Text = "Number Fields";
label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tableLayoutPanel2
//
tableLayoutPanel2.ColumnCount = 1;
tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel2.Controls.Add(lboxStringFields, 0, 2);
tableLayoutPanel2.Controls.Add(label2, 0, 1);
tableLayoutPanel2.Controls.Add(label6, 0, 0);
tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel2.Location = new System.Drawing.Point(3, 3);
tableLayoutPanel2.Name = "tableLayoutPanel2";
tableLayoutPanel2.RowCount = 3;
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
tableLayoutPanel2.Size = new System.Drawing.Size(226, 419);
tableLayoutPanel2.TabIndex = 7;
//
// lboxStringFields
//
lboxStringFields.Dock = System.Windows.Forms.DockStyle.Fill;
lboxStringFields.FormattingEnabled = true;
lboxStringFields.Location = new System.Drawing.Point(3, 66);
lboxStringFields.Name = "lboxStringFields";
lboxStringFields.Size = new System.Drawing.Size(220, 350);
lboxStringFields.TabIndex = 0;
//
// label6
//
label6.Anchor = System.Windows.Forms.AnchorStyles.Top;
label6.AutoSize = true;
label6.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline);
label6.Location = new System.Drawing.Point(75, 0);
label6.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
label6.Name = "label6";
label6.Size = new System.Drawing.Size(75, 15);
label6.TabIndex = 0;
label6.Text = "String Fields";
label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label10
//
label10.AutoSize = true;
label10.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline);
label10.Location = new System.Drawing.Point(515, 25);
label10.Margin = new System.Windows.Forms.Padding(3, 8, 3, 8);
label10.Name = "label10";
label10.Size = new System.Drawing.Size(72, 15);
label10.TabIndex = 7;
label10.Text = "Tag Format:";
label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label11
//
label11.AutoSize = true;
label11.Font = new System.Drawing.Font("Segoe UI", 9F);
label11.Location = new System.Drawing.Point(596, 25);
label11.Margin = new System.Windows.Forms.Padding(3, 8, 3, 8);
label11.Name = "label11";
label11.Size = new System.Drawing.Size(64, 15);
label11.TabIndex = 8;
label11.Text = "[tagName]";
label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// SearchSyntaxDialog // SearchSyntaxDialog
// //
AcceptButton = closeBtn;
AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
CancelButton = closeBtn; ClientSize = new System.Drawing.Size(952, 488);
ClientSize = new System.Drawing.Size(1140, 577); Controls.Add(label11);
Controls.Add(closeBtn); Controls.Add(label10);
Controls.Add(label5); Controls.Add(tableLayoutPanel1);
Controls.Add(label4);
Controls.Add(label3);
Controls.Add(label2);
Controls.Add(label1); Controls.Add(label1);
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MaximizeBox = false; MaximizeBox = false;
@ -119,6 +325,15 @@
Name = "SearchSyntaxDialog"; Name = "SearchSyntaxDialog";
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
Text = "Filter options"; Text = "Filter options";
tableLayoutPanel1.ResumeLayout(false);
tableLayoutPanel5.ResumeLayout(false);
tableLayoutPanel5.PerformLayout();
tableLayoutPanel4.ResumeLayout(false);
tableLayoutPanel4.PerformLayout();
tableLayoutPanel3.ResumeLayout(false);
tableLayoutPanel3.PerformLayout();
tableLayoutPanel2.ResumeLayout(false);
tableLayoutPanel2.PerformLayout();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
} }
@ -130,6 +345,20 @@
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4; private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label5;
private System.Windows.Forms.Button closeBtn; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.ListBox lboxIdFields;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.ListBox lboxBoolFields;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.ListBox lboxNumberFields;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.ListBox lboxStringFields;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
} }
} }

View File

@ -1,5 +1,5 @@
using LibationSearchEngine; using LibationSearchEngine;
using System; using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
@ -11,13 +11,17 @@ namespace LibationWinForms.Dialogs
{ {
InitializeComponent(); InitializeComponent();
label2.Text += "\r\n\r\n" + string.Join("\r\n", SearchEngine.FieldIndexRules.StringFieldNames); lboxNumberFields.Items.AddRange(SearchEngine.FieldIndexRules.NumberFieldNames.ToArray());
label3.Text += "\r\n\r\n" + string.Join("\r\n", SearchEngine.FieldIndexRules.NumberFieldNames); lboxStringFields.Items.AddRange(SearchEngine.FieldIndexRules.StringFieldNames.ToArray());
label4.Text += "\r\n\r\n" + string.Join("\r\n", SearchEngine.FieldIndexRules.BoolFieldNames); lboxBoolFields.Items.AddRange(SearchEngine.FieldIndexRules.BoolFieldNames.ToArray());
label5.Text += "\r\n\r\n" + string.Join("\r\n", SearchEngine.FieldIndexRules.IdFieldNames); lboxIdFields.Items.AddRange(SearchEngine.FieldIndexRules.IdFieldNames.ToArray());
this.SetLibationIcon(); this.SetLibationIcon();
this.RestoreSizeAndLocation(LibationFileManager.Configuration.Instance);
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
this.SaveSizeAndLocation(LibationFileManager.Configuration.Instance);
} }
private void CloseBtn_Click(object sender, EventArgs e) => this.Close();
} }
} }