text stringlengths 14 100k | source stringclasses 1
value | repo stringclasses 810
values | language stringclasses 13
values |
|---|---|---|---|
<|fim_prefix|>namespace DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(typeof(IDataTypeDetector))]
[DataTypeName(PredefinedCommonDataTypeNames.Date, baseName: PredefinedCommonDataTypeNames.Text)]
internal sealed partial class DateDataTypeDetector : IDataTypeDetector
{
public ValueTask<DataDetectionResult> TryDe... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(typeof(IDataT<|fim_suffix|>ength == 1)
{
return ValueTask.FromResult(new DataDetectionResult(Success: true, Data: dataFiles[0]));
}
return ValueTask.FromResult(DataDetectionResult.Unsuccessful);
}
}
<|fim... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespa<|fim_suffix|>nToken cancellationToken)
{
if (data is FileInfo[] dataFiles)
{
return ValueTask.FromResult(new DataDetectionResult(true, dataFiles));
}
return ValueTask.FromResult(DataDetectionResult.Unsuccessful);
}
}
<|fim_middle|>ce DevToys.Bl... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(typeof(IDataTypeDetector))]
[DataTypeName(PredefinedCommonDataTypeNames.GZip, baseName: PredefinedCommonDataTypeNames.Text)]
internal sealed partial class GZipTextDataTypeDetector : IDataTypeDetector
{
public ValueTask<DataDetectionResult> T... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using SixLabors.ImageSharp;
namespace DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(typeof(IDataTypeDetector))]
[DataTypeName(PredefinedCommonDataTypeNames.Image)]
internal sealed partial class ImageDataTypeDetector : IDataTypeDetector
{
public Va<|fim_suffix|>rs.ImageSharp.PixelFormats.Rgba32> ... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>(dataFile.Extension, StringComparer.OrdinalIgnoreCase))
{
return ValueTask.FromResult(new DataDetectionResult(Success: true, Data: dataFile));
}
}
return ValueTask.FromResult(DataDetectionResult.Unsuccessful);
}
}
<|fim_prefix|>namespace DevToy... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using Newtonsoft.Json.Linq;
namespace DevToys.Blazor.BuiltInDataTypeDetectors;
/// <summary>
/// Detect non-empty JSO<|fim_suffix|>ValueTask<DataDetectionResult> TryDetectDataAsync(
object data,
DataDetectionResult? resultFromBaseDetector,
CancellationToken cancellationToken)
... | fim | DevToys-app/DevToys | csharp |
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
namespace DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(typeof(IDataTypeDetector))]
[DataTypeName(PredefinedCommonDataTypeNames.Json, baseName: PredefinedCommonDataTypeNames.Text)]
internal sealed partial class JsonDataTypeDete... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>taString && !string.IsNullOrEmpty(dataString))
{
return ValueTask.FromResult(new DataDetectionResult(true, dataString));
}
return ValueTask.FromResult(DataDetectionResult.Unsuccessful);
}
}
<|fim_prefix|>namespace DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using System.Xml;
using Microsoft.Extensions.Logging;
namespac<|fim_suffix|>
{
return true;
}
return false;
}
}
return false;
}
}
<|fim_middle|>e DevToys.Blazor.BuiltInDataTypeDetectors;
[Export(typeof(... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|> }
catch (Exception ex) when (ex is XmlException || ex is XmlSchemaException)
{
return false;
}
catch (Exception ex)
{
logger.LogError(ex, "Invalid data detected.");
return false;
}
}
}
<|fim_prefix|>using System... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>IconFontName = "DevToys-Tools-Icons";
IconGlyph = '\u0103';
DisplayTitle = Groups.ConvertersGroupDisplayTitle;
AccessibleName = Groups.ConvertersGroupAccessibleName;
}
}
<|fim_prefix|>namespace DevToys.Blazor.BuiltInGroups;
[Export(typeof(Gu<|fim_middle|>iToolGroup))]
[Name(P... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>al sealed class EncodersDecodersGroup : GuiToolGroup
{
[ImportingConstructor]
internal EncodersDecodersGroup()
{
IconFontName = "DevToys-Tools-Icons";
IconGlyph = '\u0105';
DisplayTitle = Groups.EncodersDecodersGroupDisplayTitle;
AccessibleName = Groups.Encoders... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>essibleName;
}
}
<|fim_prefix|>namespace DevToys.Blazor.BuiltInGroups;
[Export(typeof(GuiToolGroup))]
[Name(PredefinedCommonToolGroupNames.Formatters)]
internal class FormattersGroup : GuiToolGroup
{
[ImportingConstructor]
internal FormattersGroup()
{
IconFontName = "DevToy<|fim_... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>;
AccessibleName = Groups.GeneratorsGroupAccessibleName;
}
}
<|fim_prefix|>namespace DevToys.Blazor.BuiltInGroups;
[Export(typeof(GuiToolGroup))]
[Name(PredefinedCommonToolGroupNames.Generators)]
internal sealed class GeneratorsGroup : GuiToolGroup
{
[ImportingConstructor]
internal G... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.BuiltInGroups;
[Export(typeof(GuiToolGroup))]
[Name(Predefine<|fim_suffix|>.Graphic)]
internal sealed class GraphicGroup : GuiToolGroup
{
[ImportingConstructor]
internal GraphicGroup()
{
IconFontName = "DevToys-Tools-Icons";
IconGlyph = '\u0129';
... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-g... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.BuiltInGroups;
[Export(typeof(GuiToolGroup))]
[Name(PredefinedCommonToolGroupNames.Testers)]
internal sealed class TestersGroup : GuiToolGr<|fim_suffix|>;
}
}
<|fim_middle|>oup
{
[ImportingConstructor]
internal TestersGroup()
{
IconFontName = "FluentSyste... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>
}
<|fim_prefix|>namespace DevToys.Blazor.BuiltInGroups;
[Export(typeof(GuiToolGroup))]
[Name(PredefinedCommonToolGroupNames.Text)]
internal sealed class TextGroup : GuiToolGroup
{
[ImportingConstructor]
internal TextGroup()
{
<|fim_middle|> IconFontName = "DevToys-Tools-Icons";
... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>stemIcons", fluentSystemIconsResourceStream),
new FontDefinition("DevToys-Tools-Icons", devToysToolsIconsResourceStream)
]);
}
}
<|fim_prefix|>using System.Reflection;
namespace DevToys.Blazor.BuiltInTools;
[Export(typeof(IResourceAssemblyIdentifier))]
[Name(nameof(DevToysBlazor... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using System.Runtime.InteropServices;
using DevToys.Core.Web;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json.Linq;
using NuGet.Packaging;
namespace DevToys.Blazor.BuiltInTools.ExtensionsManager;
public static class ExtensionInstallationManager
{
private static readonly ILogger logger = t... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using NuGet.Packaging;
namespace DevToys.Blazor.BuiltInTools.ExtensionsManager;
internal class ExtensionInstallationResult
{
internal bool HasSucceeded => string.IsNullOrWhiteSpa<|fim_suffix|>alled, NuspecReader nuspecReader, string extensionInstallationPath)
{
AlreadyInstalled = alread... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-g... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>ist,
GridColumns.Left,
GridColumns.Right,
_extensionList
.ForbidSelectItem())));
}
}
public void OnDataReceived(string dataTypeName, object? parsedData)
... | fim | DevToys-app/DevToys | csharp |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//--... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using System.Reflection;
using DevToys.Blazor.Core.Languages;
using DevToys.Core;
using DevToys.Core.Logging;
using DevToys.Core.Settings;
namespace DevToys.Blazor.BuiltInTools.Settings;
[Export(typeof(IGuiTool))]
[Name(SettingsInternalToolName)]
[ToolDisplayInformation(
IconFontName = "FluentSyste... | fim | DevToys-app/DevToys | csharp |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//--... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|> .Text("Open WinGet"),
Button()
.HyperlinkAppearance()
.Text("Open Chocolatey"))))));
public void OnDataReceived(string dataTypeName, object? parsedData)
{
... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class Button : JSStyledComponentBase, IFocusable
{
[Parameter]
public ButtonAppearance Appearance { get; set; } = ButtonAppearance.Neutral;
[Parameter]
public string? ToolTip { get; set; }
/// <summary>
/// Gets or sets the co... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|> internal static readonly ButtonAppearance Stealth = new("stealth");
internal static readonly ButtonAppearance Hyperlink = new("hyperlink");
private ButtonAppearance(string className)
{
Guard.IsNotNullOrWhiteSpace(className);
Class = className;
}
public string Clas... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>ter]
public EventCallback<bool> IsCheckedChanged { get; set; }
public ValueTask<bool> FocusAsync()
{
return JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.DOM.setFocus", Element);
}
private void OnChange(ChangeEventArgs ev)
{
bool value = (ev.Value as bool?) ... | fim | DevToys-app/DevToys | csharp |
using DevToys.Blazor.Core.Services;
using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
public partial class ComboBox<TElement> : SelectBase<TElement> where TElement : class
{
private bool _isOpen;
private ElementReference? _listBox;
private ScrollViewer? _scrollViewer;
pr... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>anged notifyCollection)
{
notifyCollection.CollectionChanged += OnItemsChanged;
}
}
if (_isOpen && _listBox is not null)
{
await _listBox.FocusAsync();
}
}
private void ContextMenuService_CloseContextMenuRequeste... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>yph { get; set; }
internal string IconFontFamily { get; set; } = "FluentSystemIcons";
internal bool IsEnabled { get; set; } = true;
internal EventCallback<DropDownListItem> OnClick { get; set; }
}
<|fim_prefix|>namespace DevToys.Blazor.Components;
public class DropDownListItem
{
inte<... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class RadioButton : JSStyledComponentBase, IFocusable
{
/// <summary>
/// Gets or sets the text to display in the radio button.
/// </summary>
[Parameter]
public string? Text { get; set; }
/// <summary>
/// Gets or sets the... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>e;
OnCheckedChanged.InvokeAsync(value);
}
}
}
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class ToggleSwitch : JSStyledComponentBase, IFocusable
{
/// <summary>
/// Gets or sets the text to display in the toggle switch.
/// </summary>
[Parame... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>e);
}
internal void SelectNextRow()
{
if (Rows is not null)
{
if (SelectedIndex == -1 || SelectedIndex == Rows.Count - 1)
{
SetSelectedIndex(0, raiseEvent: RaiseSelectionEventOnKeyboardNavigation);
}
else
... | fim | DevToys-app/DevToys | csharp |
export function getActualHeight(element) {
return element.getBoundingClientRect().height;
}
//# sourceMappingURL=DataGrid.razor.js.map<|endoftext|> | fim | DevToys-app/DevToys | javascript |
<|fim_suffix|> return element.getBoundingClientRect().height;
}<|fim_prefix|>export function getActualHeight(element: HTMLElement): numbe<|fim_middle|>r {
<|endoftext|> | fim | DevToys-app/DevToys | typescript |
<|fim_suffix|>rMouseDown(MouseEventArgs args)
{
if (args.Detail > 1) // Double click clears the width, hence setting it to minimum size.
{
Width = null;
return;
}
Guard.IsNotNull(DataGrid);
_isResizing = await DataGrid.StartResizeColumn(this, args.Cli... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>export function ge<|fim_suffix|>h(element) {
return element.getBoundingClientRect().width;
}
//# sourceMappingURL=DataGridColumnHeader.razor.js.map<|fim_middle|>tActualWidt<|endoftext|> | fim | DevToys-app/DevToys | javascript |
<|fim_prefix|>export function getAc<|fim_suffix|>mber {
return element.getBoundingClientRect().width;
}<|fim_middle|>tualWidth(element: HTMLElement): nu<|endoftext|> | fim | DevToys-app/DevToys | typescript |
<|fim_prefix|>using System.Text.Json;
using DevToys.Blazor.Core.Services;
using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
internal sealed class DataGridColumnResizeService<TRow, TCell, TRowDetail> : IAsyncDisposable
where TRow : class, ICollection<TCell>, IDataGridRow<TRowDetail>
... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
public partial class GridView<TKey, TElement> : JSStyledComponentBase, IFocusable
{
private ScrollViewer? _scrollViewer = default!;
protected override string? JavaScriptFile => "./_content/DevToys.Blazor/Components... | fim | DevToys-app/DevToys | csharp |
export function initializeStickyHeaders(scrollViewerId) {
const gridView = document.getElementById(scrollViewerId);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const simpleBar = SimpleBar.instances.get(gridView);
simpleBar.getScrollElement().addEventListener("scroll",... | fim | DevToys-app/DevToys | javascript |
<|fim_suffix|>n fitGridViewItemsToContainer(gridView: HTMLElement, gridViewBounds: DOMRectReadOnly, itemMinWidth: number): void {
const gridViewContentContainerStyle = getComputedStyle(gridView.getElementsByClassName("grid-view")[0]);
const newGridViewContentSize = gridViewBounds;
const gridViewWidth
... | fim | DevToys-app/DevToys | typescript |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class ListBox<TEl<|fim_suffix|>e where TElement : class
{
[Parameter]
public string Role { get; set; } = "listbox";
[Parameter]
public bool UseNativeScrollBar { get; set; }
public ValueTask<bool> FocusAsync()
{
return ... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>OnClickAsync();
}
}
}
<|fim_prefix|>using System.Collections.ObjectModel;
using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
public partial class ListBoxItem : StyledComponentBase
{
private readonly ICollection<ContextMenuItem> _contextMenuItems = new Observ... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>MenuEventArgs(object? item, ICollection<ContextMenuItem> items)
{
Guard.IsNotNull(items);
ItemValue = item;
ContextMenuItems = items;
}
internal object? ItemValue { get; }
internal ICollection<ContextMenuItem> ContextMenuItems { get; }
}
<|fim_prefix|>namespace D... | fim | DevToys-app/DevToys | csharp |
using Microsoft.AspNetCore.Components.Web;
using System.Collections.Specialized;
namespace DevToys.Blazor.Components;
public abstract class SelectBase<TElement> : JSStyledComponentBase where TElement : class
{
private int _oldSelectedIndex = int.MinValue;
private TElement? _oldSelectedItem = null;
[Para... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>tSystemIcons";
[Parameter]
public int Rotation { get; set; }
protected override void OnParametersSet()
{
CSS.Clear();
CSS.Add(FontFamily);
base.OnParametersSet();
}
}
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class FontIcon : StyledC... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class InfoBar : StyledComponentBase
{
public InfoBar()
{
Vertica<|fim_suffix|> OnCloseButtonClicked()
{
IsOpened = false;
if (Closed.HasDelegate)
{
Closed.InvokeAsync();
}
}
priva... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public sealed class <|fim_suffix|> internal static readonly InfoBarSeverity Error = new("error");
internal static readonly InfoBarSeverity Informational = new("informational");
internal static readonly InfoBarSeverity Success = new("success");
internal st... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using System.ComponentModel.DataAnnotations;
namespace DevToys.Blazor.Components;
public partial class ProgressBar : StyledComponentBase
{
public ProgressBar()
{
VerticalAlignment = UIVerticalAlignment.Top;
}
[Parameter]
[Range(0d, 100d, ErrorMessage = $"{nameof(Value)} mus... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|> AdditionalAttributes.TryAdd("aria-valuenow", Value);
}
base.OnParametersSet();
}
}
<|fim_prefix|>using System.ComponentModel.DataAnnotations;
namespace DevToys.Blazor.Components;
public partial class ProgressRing : StyledComponentBase
{
private const int CircleElementR ... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>
internal interface IFocusable
{
ValueTask<bool> FocusAsync();
}
<|fim_prefix|>namespace DevToys.Blazor.Co<|fim_middle|>mponents;
<|endoftext|> | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>wait (await _jsModule).DisposeAsync();
}
}
catch (JSDisconnectedException)
{
}
}
Semaphore.Dispose();
GC.SuppressFinalize(this);
}
}
<|fim_prefix|>namespace DevToys.Blazor.Components;
public abstract class JSSt... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class Card : StyledComponentBase
{
[Parameter]
public char IconGlyph { get; set; }
[Parameter]
public string IconFontFamily { g<|fim_suffix|>g? Description { get; set; }
[Parameter]
public RenderFragment? Control { get; set; }... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>ilder.AddImportantStyle("align-items", "flex-end");
break;
case UIVerticalAlignment.Center:
styleBuilder.AddImportantStyle("height", "100%", !Height.HasValue);
styleBuilder.AddImportantStyle("align-items", "center");
break;
... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>ateHasChanged();
Closed?.Invoke(this, EventArgs.Empty);
if (OnClosed.HasDelegate)
{
OnClosed.InvokeAsync();
}
}
public override ValueTask DisposeAsync()
{
Close();
return base.DisposeAsync();
}
protected override void OnPar... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using Microsoft.AspNetCore.Components.Web;
namespace DevToys<|fim_suffix|> || string.Equals(ev.Code, "Space", StringComparison.OrdinalIgnoreCase))
{
OnClick();
}
}
}
<|fim_middle|>.Blazor.Components;
public partial class Expander : StyledComponentBase
{
public ... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>OrdinalIgnoreCase))
{
OnEscapeKeyPressed.InvokeAsync();
}
}
}
<|fim_prefix|>using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
public partial class FocusTrapper : JSStyledComponentBase, IFocusable
{
protected override string JavaScriptFil... | fim | DevToys-app/DevToys | csharp |
export function initializeFocusTracking(rootElement) {
rootElement.addEventListener("keydown", onKeyDown);
}
export function dispose(rootElement) {
rootElement.removeEventListener("keydown", onKeyDown);
}
function onKeyDown(e) {
const focusableElements = window.devtoys.DOM.getFocusableElements(e.currentTarg... | fim | DevToys-app/DevToys | javascript |
<|fim_suffix|>f (e.shiftKey) /* shift + tab */ {
if (document.activeElement === firstFocusableElement) {
lastFocusableElement.focus();
e.preventDefault();
}
} else /* tab */ {
if (document.activeElement === lastFocusableElement) {
... | fim | DevToys-app/DevToys | typescript |
<|fim_suffix|>l> ToggleFullScreenModeAsync(string elementId, IFocusable? elementToGiveFocusBack)
{
if (!IsInFullScreenMode)
{
_fullScreenElementId = elementId;
await (await JSModule).InvokeVoidWithErrorHandlingAsync("setToFullScreen", FullScreenId, elementId);
IsI... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>estoreFromFullScreen = document.getElementById(elementToRestoreFromFullScreenId);
parentOfElementToFullScreen.appendChild(elementToRestoreFromFullScreen);
parentOfElementToFullScreen = null;
}
//# sourceMappingURL=FullScreenContainer.razor.js.map<|fim_prefix|>let parentOfElementToFullScreen = null... | fim | DevToys-app/DevToys | javascript |
<|fim_prefix|>let parentOfElementToFullScreen: HTMLElement = null;
export function setToFullScreen(fullScreenHostId: string, elementToFullScreenId: string): void {
if (parentOfElementToFullScreen !== null) {
throw "ERROR: Looks like FullScreenContainer is already in full screen mode.";
}
const ful... | fim | DevToys-app/DevToys | typescript |
<|fim_prefix|>using System.ComponentModel.DataAnnotations;
using System.Text;
namespace DevToys.Blazor.Components;
public partial class Grid : StyledCo<|fim_suffix|>Append($" {item.Value}fr");
}
else if (item.IsAbsolute)
{
builder.Append($" {item.Value.ToPx()}");
... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using System.ComponentModel.DataAnnotations;
namespace DevToys.Blazor.Components;
public partial class GridCell : StyledComponentBase
{
protected string? GridCellStyleValue => new StyleBuilder()
.AddStyle("grid-column", $"{Column + 1}", ColumnSpan <= 1)
.AddStyle("grid-row", $"{Row ... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
public partial class Overlay : StyledComponentBase
{
private string OverlayClasses =>
new CssBuilder("overlay")
.AddClass("overlay-absolute", FitChildContent)
.AddClass(FinalCssClasses)
... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
<|fim_suffix|>ption("top-right")]
TopRight,
[Description("center-left")]
CenterLeft,
[Description("center-center")]
CenterCenter,
[Description("center-right")]
CenterRight,
[Description("bottom-left")]
BottomLeft,
[Descript... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>s,
}
<|fim_prefix|>namespace DevToys.Blazor.Components;
public<|fim_middle|> enum OverflowBehavior
{
FlipNever,
FlipOnOpen,
FlipAlway<|endoftext|> | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>owBehavior OverflowBehavior { get; set; } = OverflowBehavior.FlipOnOpen;
/// <summary>
/// If true, the popover will have the same width at its parent element, default to false
/// </summary>
[Parameter]
public bool RelativeWidth { get; set; } = false;
/// <summary>
/// Gets ... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using DevToys.Blazor.Core.Services;
namespace DevToys.Blazor.Components;
public partial class PopoverProvid<|fim_suffix|>ect? sender, EventArgs e)
{
InvokeAsync(StateHasChanged);
}
}
<|fim_middle|>er : IDisposable
{
private bool _isConnectedToService = false;
[Inject]
inter... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class ScrollViewer : JSStyledComponentBase
{
protected override string? JavaScriptFile => "./_content/DevToys.Blazor/Components/Layout/ScrollViewer/ScrollViewer.razor.js";
private string? _scrollViewerCssClasses;
/// <summary>
/// Get... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>export <|fim_suffix|>nst middle = absoluteElementTop - (scrollViewer.offsetHeight / 2);
scrollViewer.scrollTop = middle;
}
}
//# sourceMappingURL=ScrollViewer.razor.js.map<|fim_middle|>function scrollToElement(scrollViewer, elementToScrollToId) {
const elementToScrollTo = document.getEleme... | fim | DevToys-app/DevToys | javascript |
<|fim_prefix|>export function scrollToElement(scrollViewer: HTMLElement, elementToScrollToId: string): void {
const elementToScrollTo = document.getElementById(elementToScrollToId);
if (elementToScrollTo <|fim_suffix|> const middle = absoluteElementTop - (scrollViewer.offsetHeight / 2);
scrollViewer.... | fim | DevToys-app/DevToys | typescript |
namespace DevToys.Blazor.Components;
public partial class SplitGrid : JSStyledComponentBase
{
protected override string JavaScriptFile => "./_content/DevToys.Blazor/Components/Layout/SplitGrid/SplitGrid.razor.js";
private ElementReference _gutterElement;
protected string? StyleValue => new StyleBuilder(... | fim | DevToys-app/DevToys | csharp |
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
///<reference path="../../../node_modules/split-grid/index.d.ts" />
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { ... | fim | DevToys-app/DevToys | javascript |
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
///<reference path="../../../node_modules/split-grid/index.d.ts" />
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const require: any;
import { SplitInstance, SplitOptions } from "split-grid";
interface SplitHTMLElement ext... | fim | DevToys-app/DevToys | typescript |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public partial class StackPanel : StyledComponentBase
{
protected string? ClassValue => new CssBuilder(FinalCssClasses)
.AddClass("stack-horizontal", () => Orientation == UIOrientation.Horizontal)
.AddClass("stack-vertical", () => Orientation == U... | fim | DevToys-app/DevToys | csharp |
namespace DevToys.Blazor.Components;
public abstract class MefComponentBase : JSStyledComponentBase
{
[Inject]
protected IMefProvider MefProvider { get; set; } = default!;
protected override void OnInitialized()
{
MefProvider.SatisfyImports(this);
base.OnInitialized();
}
}
<|endof... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>using DevToys.Blazor.Core.Services;
using Microsoft.AspNetCore.Components.Web;
namespace DevToys.Blazor.Components;
public partial class ContextMenu : StyledComponentBase
{
private bool _isOpen;
private ListBox<ContextMenuItem>? _listBox;
[Inject]
internal ContextMenuService ContextMen... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public sealed class Cont<|fim_suffix|>tItem
{
internal string? KeyboardShortcut { get; set; } // TODO: Actually handle keyboard shortcuts?
}
<|fim_middle|>extMenuItem : DropDownLis<|endoftext|> | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>k<ListBoxItemBuildingContextMenuEventArgs> OnBuildingContextMenu { get; set; }
[Parameter]
public bool CanGoBack { get; set; }
[Parameter]
public EventCallback OnBackButtonClicked { get; set; }
/// <summary>
/// Gets or sets the content to be rendered inside the component.
/... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>.paddingBottom);
const navTagHeightWithoutPadding = navTag.offsetHeight - navTagPaddingTop - navTagPaddingBottom;
const newHeight = navTagHeightWithoutPadding - sidebarHeader.offsetHeight - sidebarFooter.offsetHeight;
sidebarBody.style.height = `${newHeight}px`;
}
//# sourceMappingURL=NavBar.r... | fim | DevToys-app/DevToys | javascript |
<|fim_prefix|>export function registerResizeHandler(id: string, navId: string, dotNetObjRef: DotNet.DotNetObject): void {
const navBar = document.getElementById(id);
const navTag = document.getElementById(navId);
const sidebarFooter = navTag.querySelector(".sidebar-footer") as HTMLElement;
// On nav ba... | fim | DevToys-app/DevToys | typescript |
<|fim_suffix|>ropertyName == nameof(IGroup.GroupShouldBeExpandedInUI))
{
_ignoreGroupShouldBeExpandedInUI = false;
}
}
}
<|fim_prefix|>using DevToys.Core;
namespace DevToys.Blazor.Components;
public partial class NavBarIte<|fim_middle|>m<TElement, TSearchElement>
: StyledComponent... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Component<|fim_suffix|>verlay = 8
}
<|fim_middle|>s;
[Flags]
internal enum NavBarSidebarStates
{
Hidden = 0,
Collapsed = 2,
Expanded = 4,
ExpandedO<|endoftext|> | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
internal sealed class NavBarState
{
private NavBarSidebarStates _widthBasedState = NavBarSidebarStates.Expanded;
private int _width;
internal string NavBarClassNames { get; private set; } = string.Empty;
internal bool IsExpandedOverlay { get; privat... | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public static <|fim_suffix|>barHiddenThreshold = 640;
public const int NavBarWidthSidebarCollapseThreshold = 1008;
}
<|fim_middle|>class NavBarThresholds
{
public const int NavBarWidthSide<|endoftext|> | fim | DevToys-app/DevToys | csharp |
<|fim_prefix|>namespace DevToys.Blazor.Components;
public abstract class StyledComponentBase : ComponentBase
{
private static readonly Random random = new();
private readonly Lazy<<|fim_suffix|>get; set; } = UIVerticalAlignment.Stretch;
/// <summary>
/// Gets or sets the width the component should h... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>Item == null && _resultListBox.Items?.Count > 0)
{
selectedItem = _resultListBox.Items.First();
}
}
QuerySubmitted.InvokeAsync(selectedItem);
_showDropDown = false;
}
}
public void Dispose()
{
... | fim | DevToys-app/DevToys | csharp |
///-------------------------------------------------------------------------------------------------------------
/// C# translation of the https://github.com/microsoft/monaco-editor/blob/main/website/typedoc/monaco.d.ts file
///------------------------------------------------------------------------------------------... | fim | DevToys-app/DevToys | csharp |
using System.Text.Json.Serialization;
///-------------------------------------------------------------------------------------------------------------
/// C# translation of the https://github.com/microsoft/monaco-editor/blob/main/website/typedoc/monaco.d.ts file
///---------------------------------------------------... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>DidChange = didChange;
}
}
<|fim_prefix|>///-------------------------------------------------------------------------------------------------------------
/// C# translation of the https://github.com/microsoft/monaco-editor/blob/main/website/typedoc/monaco.d.ts file
///-------------------------------... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>ic class BaseMouseTarget
{
/// <summary>
/// The target element
/// </summary>
public JsonElement? Element { get; set; }
/// <summary>
/// The 'approximate' editor position
/// </summary>
public Position? Position { get; set; }
/// <summary>
/// Desired mouse colu... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>Components.Monaco.Editor;
public class BracketPairColorizationOptions
{
/// <summary>
/// Enable or disable bracket pair colorization.
/// </summary>
public bool? Enabled { get; set; }
/// <summary>
/// Use independent color pool per bracket type.
/// </summary>
public bo... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|> string HcBlack = "hc-black";
public const string HcLight = "hc-light";
}
<|fim_prefix|>///---------------------------------------<|fim_middle|>----------------------------------------------------------------------
/// C# translation of the https://github.com/microsoft/monaco-editor/blob/main/websi... | fim | DevToys-app/DevToys | csharp |
<|fim_suffix|>-----------------------------------------------------------------------
namespace DevToys.Blazor.Components.Monaco.Editor;
public class ColorizerElementOptions : ColorizerOptions
{
public string? Theme { get; set; }
public string? MimeType { get; set; }
}
<|fim_prefix|>///---------------------... | fim | DevToys-app/DevToys | csharp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.