Compare commits

...

2 Commits

Author SHA1 Message Date
e20cc09a60 Windowing 2025-03-24 12:33:38 -04:00
f1f3cd2859 WIP 2025-03-24 06:32:23 -04:00
16 changed files with 728 additions and 68 deletions

File diff suppressed because one or more lines are too long

View File

@@ -2,44 +2,156 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ServiceBus98"
xmlns:controls="clr-namespace:ServiceBus98.Controls"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Brush x:Key="Teal">#008080</Brush>
<Brush x:Key="LightBlue">#1084D0</Brush>
<Brush x:Key="Blue">#000080</Brush>
<Brush x:Key="LightGray">#DFDFDF</Brush>
<Brush x:Key="Gray">#C0C0C0</Brush>
<Brush x:Key="MediumGray">#808080</Brush>
<Color x:Key="ColorLightBlue">#1084D0</Color>
<Color x:Key="ColorBlue">#000080</Color>
<!--<Style TargetType="{x:Type MenuItem}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Background="{StaticResource Gray}" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>-->
<ControlTemplate x:Key="Button9xTemplate" TargetType="{x:Type Button}">
<DockPanel LastChildFill="True">
<Border x:Name="OuterRightBorder" DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border x:Name="OuterBottomBorder" DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border x:Name="OuterLeftBorder" DockPanel.Dock="Left" Background="#FFFFFF" Width="1" />
<Border x:Name="OuterTopBorder" DockPanel.Dock="Top" Background="#FFFFFF" Height="1" />
<!-- This child DockPanel needs to have Background set or the button is clickable on the text itself :shrug: -->
<DockPanel Background="{StaticResource Gray}" LastChildFill="True">
<Border x:Name="InnerRightBorder" DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border x:Name="InnerBottomBorder" DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<Border x:Name="InnerLeftBorder" DockPanel.Dock="Left" Background="{StaticResource LightGray}" Width="1" />
<Border x:Name="InnerTopBorder" DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" />
</DockPanel>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseCaptured" Value="True">
<Setter TargetName="OuterRightBorder" Property="Background" Value="#000000" />
<Setter TargetName="OuterBottomBorder" Property="Background" Value="#000000" />
<Setter TargetName="OuterLeftBorder" Property="Background" Value="#000000" />
<Setter TargetName="OuterTopBorder" Property="Background" Value="#000000" />
<Setter TargetName="InnerRightBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="InnerBottomBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="InnerLeftBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="InnerTopBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="ContentPresenter" Property="Margin" Value="1,1,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="Window9xTemplate" TargetType="Window">
<DockPanel LastChildFill="True" Background="{StaticResource Gray}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
<Border DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Top" Background="#FFFFFF" Height="1" />
<Grid Margin="2">
<Grid.RowDefinitions>
<RowDefinition Height="24" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<DockPanel x:Name="Titlebar" LastChildFill="True" MouseDown="TitlebarMouseDown">
<DockPanel.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="{StaticResource ColorBlue}" Offset="0.0" />
<GradientStop Color="{StaticResource ColorLightBlue}" Offset="1.0" />
</LinearGradientBrush>
</DockPanel.Background>
<Image Source="../icons/envelope.ico" Width="16" Height="16" Margin="4,0" DockPanel.Dock="Left"/>
<Button x:Name="CloseButton" Template="{StaticResource Button9xTemplate}" DockPanel.Dock="Right" Width="19" Height="18" Margin="4,0" Click="CloseButtonClick">X</Button>
<TextBlock x:Name="TitlebarText" Foreground="#FFFFFF" FontWeight="Bold" Padding="0,3" Text="{TemplateBinding Title}"></TextBlock>
</DockPanel>
<ContentPresenter Grid.Row="1" />
</Grid>
</DockPanel>
</DockPanel>
</ControlTemplate>
<Style x:Key="Window9x" TargetType="Window">
<Setter Property="WindowStyle" Value="None" />
<Setter Property="ResizeMode" Value="CanMinimize" />
</Style>
<Style x:Key="ToolWindow9x" TargetType="Window" BasedOn="{StaticResource Window9x}">
<Setter Property="ShowInTaskbar" Value="False" />
<Setter Property="ResizeMode" Value="NoResize" />
</Style>
<Style x:Key="MenuSeparator" TargetType="{x:Type Separator}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<DockPanel Height="2">
<Border DockPanel.Dock="Top" Height="1" Background="{StaticResource MediumGray}" />
<Border DockPanel.Dock="Bottom" Height="1" Background="{StaticResource LightGray}" />
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--<Style TargetType="{x:Type Menu}">
<Setter Property="Background" Value="{StaticResource Gray}" />
<Setter Property="BorderBrush" Value="{StaticResource MediumGray}" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
</Style>-->
<Style x:Key="FormField" TargetType="{x:Type StackPanel}">
<Setter Property="Margin" Value="5" />
<Setter Property="Orientation" Value="Horizontal" />
</Style>
<Style x:Key="Header" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#008080" />
<Setter Property="FontSize" Value="36" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontStyle" Value="Italic" />
<Setter Property="FontFamily" Value="Comic Sans MS" />
<Setter Property="Margin" Value="10" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontFamily" Value="Tahoma" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style TargetType="{x:Type Label}">
<Setter Property="Width" Value="120" />
<Setter Property="FontFamily" Value="Tahoma" />
</Style>
<Style TargetType="{x:Type StatusBar}">
<Setter Property="Width" Value="640" />
<Setter Property="Height" Value="24" />
<Setter Property="Background" Value="#C3C3C3" />
<Setter Property="FontFamily" Value="Tahoma" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type StatusBar}">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Width="1" Background="#FFFFFF" />
<Border DockPanel.Dock="Bottom" Height="1" Background="#FFFFFF" />
<Border DockPanel.Dock="Left" Width="1" Background="{StaticResource MediumGray}" />
<Border DockPanel.Dock="Top" Height="1" Background="{StaticResource MediumGray}" />
<ItemsPresenter />
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Button}">
<!--<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="#008080"/>
<Setter Property="Template">
<Setter.Value>
@@ -58,7 +170,20 @@
<Setter Property="Background" Value="#FF0081"/>
</Trigger>
</Style.Triggers>
</Style>
</Style>-->
<!--<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="{StaticResource Gray}"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#010081"/>
</Trigger>
<Trigger Property="IsMouseCaptured" Value="True">
<Setter Property="Background" Value="#FF0081"/>
</Trigger>
</Style.Triggers>
</Style>-->
</ResourceDictionary>

View File

@@ -1,6 +1,7 @@
using System.Configuration;
using System.Data;
using System.Windows;
using System.Windows.Controls;
namespace ServiceBus98;
@@ -9,5 +10,19 @@ namespace ServiceBus98;
/// </summary>
public partial class App : Application
{
private void TitlebarMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
Window parent = Window.GetWindow((DockPanel)sender);
if (e.ChangedButton == System.Windows.Input.MouseButton.Left)
{
parent.DragMove();
}
}
private void CloseButtonClick(object sender, RoutedEventArgs e)
{
Window parent = Window.GetWindow((Button)sender);
parent.Close();
}
}

View File

@@ -0,0 +1,25 @@
<UserControl x:Class="ServiceBus98.Controls.BeveledPresenter"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ServiceBus98.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Top" Background="#FFFFFF" Height="1" />
<ContentPresenter />
</DockPanel>
</DockPanel>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
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;
namespace ServiceBus98.Controls
{
/// <summary>
/// Interaction logic for BeveledPresenter.xaml
/// </summary>
public partial class BeveledPresenter : UserControl
{
public BeveledPresenter()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,73 @@
<UserControl x:Class="ServiceBus98.Controls.Button9x"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ServiceBus98.Controls"
mc:Ignorable="d"
>
<UserControl.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="#008080"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border DockPanel.Dock="Left" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Top" Background="#FFFFFF" Height="1" />
<!-- This child DockPanel needs to have Background set or the button is clickable on the text itself :shrug: -->
<DockPanel Background="{StaticResource Gray}" LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</DockPanel>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseCaptured" Value="True">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<DockPanel Background="{StaticResource Gray}" LastChildFill="True">
<Border DockPanel.Dock="Left" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource Gray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource Gray}" Height="1" />
<Border DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</DockPanel>
</DockPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
<!--<Trigger Property="IsMouseCaptured" Value="True">
<Setter Property="Background" Value="#FF0081"/>
</Trigger>-->
</Style.Triggers>
</Style>
</UserControl.Resources>
<UserControl.Template>
<ControlTemplate TargetType="UserControl">
<Button Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Click="Button_Click">
<ContentPresenter />
</Button>
</ControlTemplate>
</UserControl.Template>
</UserControl>

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
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;
namespace ServiceBus98.Controls
{
/// <summary>
/// Interaction logic for Button9x.xaml
/// </summary>
public partial class Button9x : UserControl
{
public Button9x()
{
InitializeComponent();
}
public event EventHandler Click = null!;
private void Button_Click(object sender, RoutedEventArgs e)
{
Click?.Invoke(this, e);
}
}
}

View File

@@ -3,58 +3,236 @@
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:ServiceBus98"
xmlns:controls="clr-namespace:ServiceBus98.Controls"
mc:Ignorable="d"
Title="Service Bus 98" Height="480" Width="640"
Background="#C3C3C3"
Title="Service Bus 98" Height="600" Width="800"
Background="{StaticResource Gray}"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize"
Template="{StaticResource Window9xTemplate}"
Style="{StaticResource Window9x}"
>
<StackPanel>
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.New" Executed="CommandBinding_Executed" CanExecute="CommandBinding_CanExecute" />
<CommandBinding Command="ApplicationCommands.Help" Executed="CommandBinding_Executed_1" CanExecute="CommandBinding_CanExecute" />
<TextBlock Text="Service Bus 98" Style="{StaticResource Header}">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="2" Direction="315" Color="Black" Opacity="1" BlurRadius="0"/>
</TextBlock.Effect>
</TextBlock>
</Window.CommandBindings>
<StackPanel Style="{StaticResource FormField}">
<Label>Connection String:</Label>
<local:TextBox9x Width="490" x:Name="ConnectionString"/>
</StackPanel>
<Window.Resources>
<BooleanToVisibilityConverter x:Key="btv" />
<StackPanel Style="{StaticResource FormField}">
<Label>Queue Name:</Label>
<local:TextBox9x Width="490" x:Name="QueueName"/>
</StackPanel>
<StackPanel Style="{StaticResource FormField}">
<Label>Content Type:</Label>
<local:TextBox9x Width="490" x:Name="ContentType" Text="text/plain"/>
</StackPanel>
<StackPanel Style="{StaticResource FormField}">
<Label>Message:</Label>
<local:MultilineTextBox9x x:Name="Message" Width="490" Height="170" />
</StackPanel>
<Button Margin="124,10,10,10" Foreground="White" BorderThickness="2" BorderBrush="Black" FontFamily="Comic Sans MS" FontSize="16" Width="490" Height="30" x:Name="Send" Click="Send_Click">Send</Button>
<StatusBar Height="40">
<DockPanel LastChildFill="True" Width="618" Height="24">
<Border DockPanel.Dock="Left" Background="#818181" Width="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="#818181" Height="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<Border DockPanel.Dock="Right" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Right" Background="#C3C3C3" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#FFFFFF" Height="1" />
<Border DockPanel.Dock="Bottom" Background="#C3C3C3" Height="1" />
<TextBlock Padding="3" x:Name="StatusText">Status: Idle</TextBlock>
<!-- style a top level menu item -->
<ControlTemplate x:Key="TopMenuItem" TargetType="MenuItem">
<StackPanel Margin="1">
<!-- label, icons, etc. -->
<DockPanel x:Name="MenuItem" LastChildFill="True">
<Border x:Name="BottomBorder" DockPanel.Dock="Bottom" Background="{StaticResource Gray}" Height="1" />
<Border x:Name="RightBorder" DockPanel.Dock="Right" Background="{StaticResource Gray}" Width="1" />
<Border x:Name="TopBorder" DockPanel.Dock="Top" Background="{StaticResource Gray}" Height="1" />
<Border x:Name="LeftBorder" DockPanel.Dock="Left" Background="{StaticResource Gray}" Width="1" />
<Label Content="{TemplateBinding Header}" Padding="6,3"/>
</DockPanel>
</StatusBar>
<!-- sub items -->
<Popup IsOpen="{TemplateBinding IsSubmenuOpen}" Focusable="False">
<DockPanel LastChildFill="True" Background="{StaticResource Gray}">
<Border DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Top" Background="#FFFFFF" Height="1" />
<ItemsPresenter />
</DockPanel>
</DockPanel>
</Popup>
</StackPanel>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsHighlighted" Value="True" />
<Condition Property="IsSubmenuOpen" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="BottomBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="RightBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="TopBorder" Property="Background" Value="#FFFFFF" />
<Setter TargetName="LeftBorder" Property="Background" Value="#FFFFFF" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsHighlighted" Value="True" />
<Condition Property="IsSubmenuOpen" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="BottomBorder" Property="Background" Value="#FFFFFF" />
<Setter TargetName="RightBorder" Property="Background" Value="#FFFFFF" />
<Setter TargetName="TopBorder" Property="Background" Value="{StaticResource MediumGray}" />
<Setter TargetName="LeftBorder" Property="Background" Value="{StaticResource MediumGray}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- style a non-top level menu item -->
<ControlTemplate x:Key="NestedMenuItem" TargetType="MenuItem">
<DockPanel x:Name="panel" Background="{StaticResource Gray}" Margin="2" >
<!-- label, icons, etc. -->
<Image Source="{Binding Icon, RelativeSource={RelativeSource TemplatedParent}}" Width="20" />
<Label x:Name="MenuItemLabel" Padding="0,3" Content="{TemplateBinding Header}" Foreground="Black" />
<Label x:Name="MenuItemGestureText" DockPanel.Dock="Right" Padding="0,3" Content="{TemplateBinding InputGestureText}" Foreground="Black" />
<!-- draw the right arrow only if this menu item has sub items -->
<Image Source="/icons/envelope.ico" Visibility="{Binding HasItems, Converter={StaticResource btv}, RelativeSource={RelativeSource TemplatedParent}}" Width="20" />
<!-- sub items -->
<Popup IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" Placement="Right" >
<DockPanel LastChildFill="True" Background="{StaticResource Gray}">
<Border DockPanel.Dock="Right" Background="#000000" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#000000" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Top" Background="#FFFFFF" Height="1" />
<ItemsPresenter />
</DockPanel>
</DockPanel>
</Popup>
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="HasItems" Value="False">
<Setter TargetName="MenuItemLabel" Property="Margin" Value="0,0,20,0" />
<Setter TargetName="MenuItemGestureText" Property="Margin" Value="0,0,20,0" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter Property="Background" TargetName="panel" Value="{StaticResource Blue}" />
<Setter Property="Foreground" TargetName="MenuItemLabel" Value="#FFFFFF" />
<Setter Property="Foreground" TargetName="MenuItemGestureText" Value="#FFFFFF" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- style the separator -->
<ControlTemplate x:Key="VsMenuSep" TargetType="Separator">
<DockPanel Height="2" Margin="2,0">
<Border DockPanel.Dock="Top" Height="1" Background="{StaticResource MediumGray}" />
<Border DockPanel.Dock="Bottom" Height="1" Background="{StaticResource LightGray}" />
</DockPanel>
</ControlTemplate>
<!-- style the VSOnline -->
<!-- some base stuff -->
<Style TargetType="Menu">
<Setter Property="Background" Value="{StaticResource Gray}" />
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="27" />
<RowDefinition Height="26" />
<RowDefinition Height="*" />
<RowDefinition Height="24" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="240" MinWidth="180" MaxWidth="360" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Menu Grid.Row="0" Grid.ColumnSpan="3" BorderBrush="{StaticResource MediumGray}" BorderThickness="0,0,0,1">
<MenuItem Header="_File" Template="{StaticResource TopMenuItem}">
<MenuItem Header="_New Connection" InputGestureText="Ctrl+N" Template="{StaticResource NestedMenuItem}" Command="ApplicationCommands.New" />
<Separator Style="{StaticResource MenuSeparator}"/>
<MenuItem Header="E_xit" InputGestureText="Alt+F4" Template="{StaticResource NestedMenuItem}" Click="MenuItem_Click_1" />
</MenuItem>
<MenuItem Header="_Tools" Template="{StaticResource TopMenuItem}">
<MenuItem Header="_Options" Template="{StaticResource NestedMenuItem}" />
</MenuItem>
<MenuItem Header="_Help" Template="{StaticResource TopMenuItem}">
<MenuItem Header="_Help Topics" Template="{StaticResource NestedMenuItem}" Command="ApplicationCommands.Help" />
<Separator Style="{StaticResource MenuSeparator}"/>
<MenuItem Header="_About Service Bus 98" Template="{StaticResource NestedMenuItem}" Click="HelpAboutClick" />
</MenuItem>
</Menu>
<DockPanel Grid.Row="1" Grid.ColumnSpan="3">
<Border DockPanel.Dock="Top" Background="{StaticResource LightGray}" Height="1" />
<StackPanel />
</DockPanel>
<DockPanel Grid.Row="2" Grid.Column="0" Margin="0,2" LastChildFill="True">
<Border DockPanel.Dock="Right" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#FFFFFF" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource MediumGray}" Height="1" />
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource LightGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<TreeView BorderThickness="0">
<TreeViewItem Header="localhost">
<TreeViewItem Header="Queues">
ServiceBusQueue
</TreeViewItem>
<TreeViewItem Header="Topics" />
<TreeViewItem Header="Subscriptions" />
</TreeViewItem>
</TreeView>
</DockPanel>
</DockPanel>
<GridSplitter Grid.Row="2" Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Background="{StaticResource Gray}"
ShowsPreview="True"
Width="3"
/>
<DockPanel Grid.Row="2" Grid.Column="2" Margin="0,2" LastChildFill="True">
<Border DockPanel.Dock="Right" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#FFFFFF" Height="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource MediumGray}" Height="1" />
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Right" Background="{StaticResource LightGray}" Width="1" />
<Border DockPanel.Dock="Bottom" Background="{StaticResource LightGray}" Height="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<TextBlock>More Service Bus Action</TextBlock>
</DockPanel>
</DockPanel>
<StatusBar Grid.Row="3" Grid.ColumnSpan="3">
<StatusBarItem>
Status: Idle
</StatusBarItem>
</StatusBar>
</Grid>
</Window>

View File

@@ -1,4 +1,5 @@
using System.Windows;
using System.Windows.Controls;
using Azure.Messaging.ServiceBus;
namespace ServiceBus98;
@@ -13,6 +14,47 @@ public partial class MainWindow : Window
InitializeComponent();
}
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Clicked");
}
private void CommandBinding_Executed(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
{
MessageBox.Show("New Connection");
}
private void CommandBinding_CanExecute(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
{
Control target = (Control)e.Source;
if (target != null)
{
e.CanExecute = true;
}
else
{
e.CanExecute = false;
}
}
private void MenuItem_Click_1(object sender, RoutedEventArgs e)
{
this.Close();
}
private void CommandBinding_Executed_1(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
{
MessageBox.Show("Open git.ratermania.net");
}
private void HelpAboutClick(object sender, RoutedEventArgs e)
{
AboutWindow aboutWindow = new AboutWindow();
aboutWindow.ShowDialog();
}
/*
private async void Send_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(ConnectionString.Text))
@@ -72,4 +114,5 @@ public partial class MainWindow : Window
StatusText.Text = "Status: Idle";
}
}
*/
}

View File

@@ -6,9 +6,9 @@
xmlns:local="clr-namespace:ServiceBus98"
mc:Ignorable="d">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Left" Background="#818181" Width="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="#818181" Height="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<Border DockPanel.Dock="Right" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Right" Background="#C3C3C3" Width="1" />

View File

@@ -8,8 +8,16 @@
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<None Remove="icons\envelope.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.18.4" />
</ItemGroup>
<ItemGroup>
<Resource Include="icons\envelope.ico" />
</ItemGroup>
</Project>

View File

@@ -7,9 +7,9 @@
mc:Ignorable="d">
<DockPanel LastChildFill="True">
<Border DockPanel.Dock="Left" Background="#818181" Width="1" />
<Border DockPanel.Dock="Left" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="#818181" Height="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<Border DockPanel.Dock="Right" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Right" Background="#C3C3C3" Width="1" />

View File

@@ -0,0 +1,45 @@
<Window x:Class="ServiceBus98.AboutWindow"
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:ServiceBus98"
xmlns:controls="clr-namespace:ServiceBus98.Controls"
mc:Ignorable="d"
Title="About Service Bus 98"
Width="360"
Height="240"
WindowStartupLocation="CenterScreen"
Template="{StaticResource Window9xTemplate}"
Style="{StaticResource ToolWindow9x}">
<Window.Resources>
<Style x:Key="Header" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="Teal" />
<Setter Property="FontSize" Value="24" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontStyle" Value="Italic" />
<Setter Property="FontFamily" Value="Comic Sans MS" />
<Setter Property="Margin" Value="0" />
</Style>
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="ApplicationCommands.Close" CanExecute="CloseCanExecute" Executed="CloseExecuted" />
</Window.CommandBindings>
<StackPanel>
<TextBlock Style="{StaticResource Header}" Text="Service Bus 98">
<!--<TextBlock.RenderTransform>
<RotateTransform Angle="270" />
</TextBlock.RenderTransform>-->
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="2" Direction="315" Color="Black" Opacity="1" BlurRadius="0"/>
</TextBlock.Effect>
</TextBlock>
<TextBlock>Copyright (C) 1998-2025 Tommy</TextBlock>
<Button Command="ApplicationCommands.Close">OK</Button>
</StackPanel>
</Window>

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
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.Shapes;
namespace ServiceBus98
{
/// <summary>
/// Interaction logic for About.xaml
/// </summary>
public partial class AboutWindow : Window
{
public AboutWindow()
{
InitializeComponent();
}
private void CloseCanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = true;
}
private void CloseExecuted(object sender, ExecutedRoutedEventArgs e)
{
this.Close();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

46
ServiceBus98/original.txt Normal file
View File

@@ -0,0 +1,46 @@
<StackPanel>
<TextBlock Text="Service Bus 98" Style="{StaticResource Header}">
<TextBlock.Effect>
<DropShadowEffect ShadowDepth="2" Direction="315" Color="Black" Opacity="1" BlurRadius="0"/>
</TextBlock.Effect>
</TextBlock>
<StackPanel Style="{StaticResource FormField}">
<Label>Connection String:</Label>
<local:TextBox9x Width="490" x:Name="ConnectionString"/>
</StackPanel>
<StackPanel Style="{StaticResource FormField}">
<Label>Queue Name:</Label>
<local:TextBox9x Width="490" x:Name="QueueName"/>
</StackPanel>
<StackPanel Style="{StaticResource FormField}">
<Label>Content Type:</Label>
<local:TextBox9x Width="490" x:Name="ContentType" Text="text/plain"/>
</StackPanel>
<StackPanel Style="{StaticResource FormField}">
<Label>Message:</Label>
<local:MultilineTextBox9x x:Name="Message" Width="490" Height="170" />
</StackPanel>
<Button Margin="124,10,10,10" Foreground="White" BorderThickness="2" BorderBrush="Black" FontFamily="Comic Sans MS" FontSize="16" Width="490" Height="30" x:Name="Send" Click="Send_Click">Send</Button>
<StatusBar Height="40">
<DockPanel LastChildFill="True" Width="618" Height="24">
<Border DockPanel.Dock="Left" Background="{StaticResource MediumGray}" Width="1" />
<Border DockPanel.Dock="Left" Background="#000000" Width="1" />
<Border DockPanel.Dock="Top" Background="{StaticResource MediumGray}" Height="1" />
<Border DockPanel.Dock="Top" Background="#000000" Height="1" />
<Border DockPanel.Dock="Right" Background="#FFFFFF" Width="1" />
<Border DockPanel.Dock="Right" Background="#C3C3C3" Width="1" />
<Border DockPanel.Dock="Bottom" Background="#FFFFFF" Height="1" />
<Border DockPanel.Dock="Bottom" Background="#C3C3C3" Height="1" />
<TextBlock Padding="3" x:Name="StatusText">Status: Idle</TextBlock>
</DockPanel>
</StatusBar>
</StackPanel>