136 lines
8.0 KiB
XML
136 lines
8.0 KiB
XML
<Window x:Class="CodeMerger.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:avalon="http://icsharpcode.net/sharpdevelop/avalonedit" xmlns:controls="clr-namespace:CodeMerger.Controls"
|
|
Title="Code Merger" Height="{Binding Settings.WindowHeight, Mode=TwoWay}"
|
|
Width="{Binding Settings.WindowWidth, Mode=TwoWay}" Left="{Binding Settings.WindowLeft, Mode=TwoWay}"
|
|
Top="{Binding Settings.WindowTop, Mode=TwoWay}" WindowState="{Binding Settings.WindowState, Mode=TwoWay}"
|
|
Closing="Window_Closing">
|
|
<Grid Margin="10">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="200" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Panel de Ejemplos de Test -->
|
|
<Expander Grid.Row="0" Header="Test Examples" IsExpanded="False">
|
|
<controls:TestExamplesControl x:Name="testExamplesControl" />
|
|
</Expander>
|
|
|
|
<!-- Panel de Controles -->
|
|
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,10,0,10">
|
|
<GroupBox Header="Original Code" Margin="0,0,10,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Button Content="Paste" Width="80" Margin="5" Command="{Binding PasteOriginalCommand}" />
|
|
<Button Content="Copy" Width="80" Margin="5" Command="{Binding CopyOriginalCommand}" />
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<GroupBox Header="LLM Code" Margin="0,0,10,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Button Content="Paste" Width="80" Margin="5" Command="{Binding PasteLLMCommand}" />
|
|
<Button Content="Copy" Width="80" Margin="5" Command="{Binding CopyLLMCommand}" />
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<GroupBox Header="Merged Code" Margin="0,0,10,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Button Content="Copy" Width="80" Margin="5" Command="{Binding CopyMergedCommand}" />
|
|
</StackPanel>
|
|
</GroupBox>
|
|
|
|
<Separator Margin="10,0" Width="2" Background="LightGray" />
|
|
|
|
<TextBox x:Name="txtSearch" Width="200" Height="30" Margin="0,0,5,0" VerticalContentAlignment="Center"
|
|
Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}">
|
|
<TextBox.InputBindings>
|
|
<KeyBinding Key="Return" Command="{Binding SearchCommand}" />
|
|
</TextBox.InputBindings>
|
|
</TextBox>
|
|
<Button Content="Find" Width="80" Height="30" Margin="0,0,20,0" Command="{Binding SearchCommand}" />
|
|
|
|
<Button Content="Clear All" Width="120" Height="30" Margin="0,0,20,0" Command="{Binding ClearAllCommand}" />
|
|
<Button Content="Analyze" Width="120" Height="30" Margin="0,0,10,0" Command="{Binding AnalyzeCodeCommand}" />
|
|
<Button Content="Merge Code" Width="120" Height="30" Margin="0,0,0,0" Command="{Binding MergeCodeCommand}" />
|
|
</StackPanel>
|
|
|
|
<!-- Editores de Código -->
|
|
<Grid Grid.Row="2" Name="EditorsGrid">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="{Binding FirstColumnWidth, Mode=TwoWay}" MinWidth="100" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="{Binding SecondColumnWidth, Mode=TwoWay}" MinWidth="100" />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="{Binding ThirdColumnWidth, Mode=TwoWay}" MinWidth="100" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Editor de código original -->
|
|
<GroupBox Header="Original Code" Grid.Column="1">
|
|
<DockPanel LastChildFill="True">
|
|
<Button DockPanel.Dock="Top" Content="Show Structure" Height="30" Margin="0,0,0,5"
|
|
Command="{Binding ShowOriginalStructureCommand}" />
|
|
<Button DockPanel.Dock="Bottom" Content="Analyze" Height="30" Margin="0,5,0,0"
|
|
Command="{Binding AnalyzeCodeCommand}" />
|
|
<avalon:TextEditor x:Name="txtOriginalCode" ShowLineNumbers="True" FontFamily="Consolas"
|
|
SyntaxHighlighting="C#" Document="{Binding OriginalDocument}" WordWrap="True"
|
|
Loaded="txtOriginalCode_Loaded" MouseDoubleClick="TextEditor_MouseDoubleClick" />
|
|
</DockPanel>
|
|
</GroupBox>
|
|
|
|
<!-- Separador -->
|
|
<GridSplitter Grid.Column="2" Width="5" HorizontalAlignment="Center" Background="LightGray"
|
|
ShowsPreview="True" DragCompleted="GridSplitter_DragCompleted" />
|
|
|
|
<!-- Editor de código LLM -->
|
|
<GroupBox Header="LLM Code" Grid.Column="3">
|
|
<DockPanel LastChildFill="True">
|
|
<Button DockPanel.Dock="Top" Content="Show Structure" Height="30" Margin="0,0,0,5"
|
|
Command="{Binding ShowLLMStructureCommand}" />
|
|
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,5">
|
|
<TextBlock Text="Default Namespace:" VerticalAlignment="Center" Margin="0,0,5,0" />
|
|
<ComboBox x:Name="cbLLMNamespace" Width="180"
|
|
ItemsSource="{Binding OriginalNamespaces, Mode=OneWay}"
|
|
SelectedItem="{Binding SelectedLLMNamespace}" Margin="0,0,10,0" />
|
|
<TextBlock Text="Default Class:" VerticalAlignment="Center" Margin="0,0,5,0" />
|
|
<ComboBox x:Name="cbLLMClass" Width="180" ItemsSource="{Binding OriginalClasses, Mode=OneWay}"
|
|
SelectedItem="{Binding SelectedLLMClass}" />
|
|
</StackPanel>
|
|
<Button DockPanel.Dock="Bottom" Content="Analyze" Height="30" Margin="0,5,0,0"
|
|
Command="{Binding AnalyzeCodeCommand}" />
|
|
<avalon:TextEditor x:Name="txtLLMCode" ShowLineNumbers="True" FontFamily="Consolas"
|
|
SyntaxHighlighting="C#" Document="{Binding LLMDocument}" WordWrap="True"
|
|
Loaded="txtLLMCode_Loaded" MouseDoubleClick="TextEditor_MouseDoubleClick" />
|
|
</DockPanel>
|
|
</GroupBox>
|
|
|
|
<!-- Separador -->
|
|
<GridSplitter Grid.Column="4" Width="5" HorizontalAlignment="Center" Background="LightGray"
|
|
ShowsPreview="True" DragCompleted="GridSplitter_DragCompleted" />
|
|
|
|
<!-- Editor de código fusionado -->
|
|
<GroupBox Header="Merged Code" Grid.Column="5">
|
|
<DockPanel LastChildFill="True">
|
|
<Button DockPanel.Dock="Top" Content="Show Structure" Height="30" Margin="0,0,0,5"
|
|
Command="{Binding ShowMergedStructureCommand}" />
|
|
<Button DockPanel.Dock="Bottom" Content="Analyze" Height="30" Margin="0,5,0,0"
|
|
Command="{Binding AnalyzeCodeCommand}" />
|
|
<avalon:TextEditor x:Name="txtMergedCode" ShowLineNumbers="True" FontFamily="Consolas"
|
|
SyntaxHighlighting="C#" Document="{Binding MergedDocument}" WordWrap="True"
|
|
Loaded="txtMergedCode_Loaded" IsReadOnly="True"
|
|
MouseDoubleClick="TextEditor_MouseDoubleClick" />
|
|
</DockPanel>
|
|
</GroupBox>
|
|
</Grid>
|
|
|
|
<!-- Separador -->
|
|
<GridSplitter Grid.Row="3" Height="5" HorizontalAlignment="Stretch" Background="LightGray" ShowsPreview="True" />
|
|
|
|
<!-- Panel de Log -->
|
|
<Expander Grid.Row="4" Header="Log" IsExpanded="True">
|
|
<controls:SimpleMergeLogControl x:Name="logControl" />
|
|
</Expander>
|
|
</Grid>
|
|
</Window> |