Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bufdio/Bufdio.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
Expand Down
3 changes: 2 additions & 1 deletion Bufdio/Players/AudioPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ private void RunEngine()
continue;
}

var samples = MemoryMarshal.Cast<byte, float>(frame.Data);
float[] samplesArray = MemoryMarshal.Cast<byte, float>(frame.Data).ToArray();
Span<float> samples = samplesArray.AsSpan();
ProcessSampleProcessors(samples);

SetAndRaiseStateChanged(PlaybackState.Playing);
Expand Down
2 changes: 1 addition & 1 deletion CoreSpectrum/CoreSpectrum.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion HeadlessEmulator/HeadlessEmulator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Binary file added MsBox.Avalonia - copia/Assets/battery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/bluetooth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/eye.ttf
Binary file not shown.
Binary file added MsBox.Avalonia - copia/Assets/folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/forbidden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/lock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/speakerless.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/speakermore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/stopwatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MsBox.Avalonia - copia/Assets/wifi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions MsBox.Avalonia - copia/AttachadProperty/HyperLinkCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System.Windows.Input;
using Avalonia;
using Avalonia.Data;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Reactive;

namespace MsBox.Avalonia.AttachadProperty;

public class HyperLinkCommand : AvaloniaObject
{
static HyperLinkCommand()
{
CommandProperty.Changed.Subscribe(new AnonymousObserver<AvaloniaPropertyChangedEventArgs<ICommand>>(x =>
HandleCommandChanged(x.Sender, x.NewValue.GetValueOrDefault<ICommand>())));
}

public static readonly AttachedProperty<ICommand> CommandProperty =
AvaloniaProperty.RegisterAttached<HyperLinkCommand, Interactive, ICommand>(
"Command", default(ICommand), false, BindingMode.OneWay);

private static void HandleCommandChanged(AvaloniaObject element, ICommand commandValue)
{
if (element is Interactive interactElem)
{
if (commandValue != null)
{
// Add non-null value
interactElem.AddHandler(InputElement.PointerPressedEvent, Handler);
}
else
{
// remove prev value
interactElem.RemoveHandler(InputElement.PointerPressedEvent, Handler);
}
}

// local handler fcn
static void Handler(object s, RoutedEventArgs e)
{
if (s is Interactive interactElem)
{
// This is how we get the parameter off of the gui element.
var commandValue = interactElem.GetValue(CommandProperty);
commandValue.Execute(null);
}
}
}

/// <summary>
/// Accessor for Attached property <see cref="CommandProperty"/>.
/// </summary>
public static void SetCommand(AvaloniaObject element, ICommand commandValue)
{
element.SetValue(CommandProperty, commandValue);
}

/// <summary>
/// Accessor for Attached property <see cref="CommandProperty"/>.
/// </summary>
public static ICommand GetCommand(AvaloniaObject element)
{
return element.GetValue(CommandProperty);
}
}
6 changes: 6 additions & 0 deletions MsBox.Avalonia - copia/Base/IClose.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MsBox.Avalonia.Base;

public interface IClose
{
void Close();
}
8 changes: 8 additions & 0 deletions MsBox.Avalonia - copia/Base/ICopy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System.Threading.Tasks;

namespace MsBox.Avalonia.Base;

public interface ICopy
{
Task Copy();
}
7 changes: 7 additions & 0 deletions MsBox.Avalonia - copia/Base/IFullApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace MsBox.Avalonia.Base;

public interface IFullApi<T>: IClose//ICopy, IClose
{
void SetButtonResult(T bdName);
T GetButtonResult();
}
11 changes: 11 additions & 0 deletions MsBox.Avalonia - copia/Base/IInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MsBox.Avalonia.Base
{
public interface IInput
{
string InputValue { get; }
}
}
14 changes: 14 additions & 0 deletions MsBox.Avalonia - copia/Base/IMsBox.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Threading.Tasks;
using Avalonia.Controls;

namespace MsBox.Avalonia.Base;

public interface IMsBox<T>
{
Task<T> ShowAsync();
Task<T> ShowWindowAsync();
Task<T> ShowWindowDialogAsync(Window owner);
Task<T> ShowAsPopupAsync(ContentControl owner);
Task<T> ShowAsPopupAsync(Window owner);
string InputValue { get; }
}
8 changes: 8 additions & 0 deletions MsBox.Avalonia - copia/Base/ISetCloseAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace MsBox.Avalonia.Base;

public interface ISetCloseAction
{
void SetCloseAction(Action closeAction);
}
6 changes: 6 additions & 0 deletions MsBox.Avalonia - copia/Base/ISetFullApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MsBox.Avalonia.Base;

public interface ISetFullApi<T>
{
void SetFullApi(IFullApi<T> fullApi);
}
139 changes: 139 additions & 0 deletions MsBox.Avalonia - copia/Controls/MsBoxCustomView.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<UserControl xmlns="https://github.com/avaloniaui"
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:avalonia="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia"
xmlns:viewModels="clr-namespace:MsBox.Avalonia.ViewModels"
xmlns:attachadProperty="clr-namespace:MsBox.Avalonia.AttachadProperty"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
d:DataContext="{x:Static viewModels:DesignDataContexts.CustomHyperlinkInputViewModel}"
x:Class="MsBox.Avalonia.Controls.MsBoxCustomView" MinWidth="{Binding MinWidth}"
x:DataType="viewModels:MsBoxCustomViewModel"
MaxWidth="{Binding MaxWidth}"
Width="{Binding Width}"
MinHeight="{Binding MinHeight}"
MaxHeight="{Binding MaxHeight}"
Height="{Binding Height}"
FontFamily="{Binding FontFamily}">
<!-- <UserControl.KeyBindings>
<KeyBinding Gesture="Ctrl+C" Command="{Binding Copy}" />
</UserControl.KeyBindings> -->
<UserControl.Styles>
<Style Selector="TextBox.styled">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="AcceptsReturn" Value="True" />
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="CaretBrush" Value="Transparent" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
</Style>
<Style Selector="TextBox.styled:pointerover /template/ Border#border">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="TextBox.styled:pointerover /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="TextBox.styled:focus /template/ Border#border">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="TextBox.styled:focus /template/ Border#PART_BorderElement">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="TextBox.header">
<Setter Property="FontWeight" Value="Bold" />
</Style>
<Style Selector="Button">
<Setter Property="Margin" Value="15 0 0 0" />
<Setter Property="MinHeight" Value="24" />
<Setter Property="MinWidth" Value="75" />
</Style>
<Style Selector="TextBlock.hyperlink">
<Setter Property="Foreground" Value="#3483eb" />
</Style>
<Style Selector="TextBlock.hyperlink:pointerover">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="TextDecorations" Value="Underline" />
<Setter Property="Foreground" Value="#3496eb" />
</Style>
</UserControl.Styles>
<Grid Classes="MsBoxCustomContainer">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="15" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="15" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="15" />
<RowDefinition Height="*" />
<RowDefinition Height="15" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="15" />
</Grid.RowDefinitions>
<!--Icon-->
<Image Grid.Row="1" Grid.Column="1" MaxHeight="50" MaxWidth="50" VerticalAlignment="Top"
IsVisible="{Binding HasIcon}"
Source="{Binding ImagePath}" />
<Grid Grid.Row="1" Grid.Column="3" RowDefinitions="Auto,15,*,Auto">
<!--Bold text-->
<TextBox Grid.Row="0" Classes="header styled" FontFamily="{Binding FontFamily}" Text="{Binding ContentHeader}"
IsVisible="{Binding HasHeader}" />
<!--Content text-->
<TextBox Grid.Row="2" Classes="contentMessage styled" FontFamily="{Binding FontFamily}"
Text="{Binding ContentMessage}" IsVisible="{Binding !Markdown}" />
<avalonia:MarkdownScrollViewer Grid.Row="2"
Markdown="{Binding ContentMessage}"
IsVisible="{Binding Markdown}" />

<!--HyperLink-->
<TextBlock Grid.Row="3" IsVisible="{Binding IsHyperLinkVisible }" Name="HyperLink" Classes="hyperlink"
Text="{Binding HyperLinkText}"
attachadProperty:HyperLinkCommand.Command="{Binding HyperLinkCommand}">
</TextBlock>

</Grid>
<!--Input-->
<Grid Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" IsVisible="{Binding IsInputVisible}" Margin="0,0,0,15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock FontFamily="{Binding FontFamily}" IsVisible="{Binding IsInputVisible}" Text="{Binding InputLabel}" VerticalAlignment="Center" Margin="0,0,15,0" />
<TextBox Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding InputValue, Mode=TwoWay}" FontFamily="{Binding FontFamily}" IsVisible="{Binding IsInputVisible}" />
</Grid>
<!--Buttons-->
<ItemsControl Name="ButtonItemsPresenter" Classes="buttons-item-presenter"
ItemsSource="{Binding ButtonDefinitions}" Grid.Row="4"
Grid.Column="1" Grid.ColumnSpan="3"
HorizontalAlignment="Right">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Name="Btn"
HorizontalContentAlignment="Center"
Classes.buttons="true"
Classes.default="{Binding IsDefault}"
Classes.cancel="{Binding IsCancel}"
Command="{Binding ((viewModels:MsBoxCustomViewModel)DataContext).ButtonClickCommand, RelativeSource={RelativeSource AncestorType=UserControl, AncestorLevel=1}}"
CommandParameter="{Binding #Btn.Content}"
Content="{Binding Name}"
Margin="0 0 5 0"
IsDefault="{Binding IsDefault}"
IsCancel="{Binding IsCancel}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</UserControl>
45 changes: 45 additions & 0 deletions MsBox.Avalonia - copia/Controls/MsBoxCustomView.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Input;
using MsBox.Avalonia.AttachadProperty;
using MsBox.Avalonia.Base;
namespace MsBox.Avalonia.Controls;

public partial class MsBoxCustomView : UserControl, IFullApi<string>, ISetCloseAction
{
private string _buttonResult;
private Action _closeAction;

public MsBoxCustomView()
{
InitializeComponent();
}


public void SetButtonResult(string bdName)
{
_buttonResult = bdName;
}

public string GetButtonResult()
{
return _buttonResult;
}

//public Task Copy()
//{
// throw new System.NotImplementedException();
//}

public void Close()
{
_closeAction?.Invoke();
}

public void SetCloseAction(Action closeAction)
{
_closeAction = closeAction;
}

}
Loading
Loading