diff --git a/KB-Samples/TwoDiagramOnePalette/App.razor b/KB-Samples/TwoDiagramOnePalette/App.razor new file mode 100644 index 00000000..97f6f915 --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/App.razor @@ -0,0 +1,13 @@ +@namespace TwoDiagramOnePalette + + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
diff --git a/KB-Samples/TwoDiagramOnePalette/MainLayout.razor b/KB-Samples/TwoDiagramOnePalette/MainLayout.razor new file mode 100644 index 00000000..aa96363a --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/MainLayout.razor @@ -0,0 +1,3 @@ +@inherits LayoutComponentBase +@namespace TwoDiagramOnePalette +
@Body
diff --git a/KB-Samples/TwoDiagramOnePalette/Pages/Index.razor b/KB-Samples/TwoDiagramOnePalette/Pages/Index.razor new file mode 100644 index 00000000..a1de60d2 --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/Pages/Index.razor @@ -0,0 +1,294 @@ +@page "/" + +@using Syncfusion.Blazor.Navigations +@using System.Collections.ObjectModel +@using Syncfusion.Blazor.Diagram +@using Syncfusion.Blazor.Diagram.SymbolPalette +@using System.Collections.ObjectModel +@using Syncfusion.Blazor.Navigations +@using ChangeEventArgs = Microsoft.AspNetCore.Components.ChangeEventArgs + +
+ + +
+ +
+ + + + +
+
+
+ + + + + +
+
+
+
+ + + + + +
+
+ @*Hidden:Lines*@ +
+
+@*End:Hidden*@ + +@code{ + + DiagramSize SymbolDragPreviewSize; + + private void Drop(DropEventArgs args) + { + if (args.Position.X > 400) + { + args.Cancel = true; + + } + } + + + double symbolSizeWidth; + double symbolSizeHeight; + + SfDiagramComponent DInstance; + SfDiagramComponent DInstance1; + DiagramObjectCollection Dnodes = new DiagramObjectCollection(); + DiagramObjectCollection Dconnectors = new DiagramObjectCollection(); + DiagramObjectCollection Dnodes1 = new DiagramObjectCollection(); + DiagramObjectCollection Dconnectors1 = new DiagramObjectCollection(); + + SfSymbolPaletteComponent PaletteInstance; + DiagramObjectCollection Palettes = new DiagramObjectCollection(); + + DiagramObjectCollection nodes = new DiagramObjectCollection(); + DiagramObjectCollection Tnodes = new DiagramObjectCollection(); + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + PaletteInstance.Targets = new DiagramObjectCollection() { }; + PaletteInstance.Targets.Add(DInstance); + PaletteInstance.Targets.Add(DInstance1); + } + protected override void OnInitialized() + { + SymbolDragPreviewSize = new DiagramSize(); + SymbolDragPreviewSize.Width = 80; + SymbolDragPreviewSize.Height = 80; + //SymbolMargin.lef + symbolSizeWidth = 50; + symbolSizeHeight = 50; + + Tnodes = new DiagramObjectCollection(); + + + + Node Tnode2 = new Node() + { ID = "node1", Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Decision } }; + Tnodes.Add(Tnode2); + + Node Tnode3 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Document } }; + Tnodes.Add(Tnode3); + Node Tnode4 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.PreDefinedProcess } }; + Tnodes.Add(Tnode4); + Node Tnode5 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Terminator } }; + Tnodes.Add(Tnode5); + Node Tnode6 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.PaperTap } }; + Tnodes.Add(Tnode6); + Node Tnode7 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.DirectData } }; + Tnodes.Add(Tnode7); + Node Tnode8 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.SequentialData } }; + Tnodes.Add(Tnode8); + Node Tnode9 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Sort } }; + Tnodes.Add(Tnode9); + Node Tnode10 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.MultiDocument } }; + Tnodes.Add(Tnode10); + Node Tnode11 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Collate } }; + Tnodes.Add(Tnode11); + Node Tnode12 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.SummingJunction } }; + Tnodes.Add(Tnode12); + Node Tnode13 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Or } }; + Tnodes.Add(Tnode13); + Node Tnode14 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.InternalStorage } }; + Tnodes.Add(Tnode14); + Node Tnode15 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Extract } }; + Tnodes.Add(Tnode15); + Node Tnode16 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.ManualOperation } }; + Tnodes.Add(Tnode16); + Node Tnode17 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Merge } }; + Tnodes.Add(Tnode17); + Node Tnode18 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.OffPageReference } }; + Tnodes.Add(Tnode18); + Node Tnode19 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.SequentialAccessStorage } }; + Tnodes.Add(Tnode19); + Node Tnode20 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Annotation } }; + Tnodes.Add(Tnode20); + Node Tnode22 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Data } }; + Tnodes.Add(Tnode22); + Node Tnode23 = new Node() + { Shape = new FlowShape() { Type = NodeShapes.Flow, Shape = NodeFlowShapes.Card } }; + Tnodes.Add(Tnode23); + + Palettes = new DiagramObjectCollection() +{ + new Palette(){Symbols =Tnodes,Title="Flow Shapes",ID ="Flow Shapes" }, + + }; + } } diff --git a/KB-Samples/TwoDiagramOnePalette/Pages/_Host.cshtml b/KB-Samples/TwoDiagramOnePalette/Pages/_Host.cshtml new file mode 100644 index 00000000..e6dec86b --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/Pages/_Host.cshtml @@ -0,0 +1,32 @@ +@page "/" +@using Microsoft.AspNetCore.Components.Web +@namespace TwoDiagramOnePalette.Pages +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers + + + + + + + + + + + + + + +
+ + An error has occurred. This application may no longer respond until reloaded. + + + An unhandled exception has occurred. See browser dev tools for details. + + Reload + 🗙 +
+ + + + diff --git a/KB-Samples/TwoDiagramOnePalette/Program.cs b/KB-Samples/TwoDiagramOnePalette/Program.cs new file mode 100644 index 00000000..41e064c9 --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/Program.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; +using Syncfusion.Blazor; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddRazorPages(); +builder.Services.AddServerSideBlazor(); +builder.Services.AddSyncfusionBlazor(); +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); + +app.UseStaticFiles(); + +app.UseRouting(); + +app.MapBlazorHub(); +app.MapFallbackToPage("/_Host"); + +app.Run(); diff --git a/KB-Samples/TwoDiagramOnePalette/Properties/launchSettings.json b/KB-Samples/TwoDiagramOnePalette/Properties/launchSettings.json new file mode 100644 index 00000000..814473c5 --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/Properties/launchSettings.json @@ -0,0 +1,35 @@ +{ + "iisSettings": { + "iisExpress": { + "applicationUrl": "http://localhost:32445", + "sslPort": 44313 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5098", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7081;http://localhost:5098", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/KB-Samples/TwoDiagramOnePalette/TwoDiagramOnePalette_NET6.csproj b/KB-Samples/TwoDiagramOnePalette/TwoDiagramOnePalette_NET6.csproj new file mode 100644 index 00000000..7b44ed9f --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/TwoDiagramOnePalette_NET6.csproj @@ -0,0 +1,12 @@ + + + + net6.0 + enable + enable + + + + + + \ No newline at end of file diff --git a/KB-Samples/TwoDiagramOnePalette/TwoDiagramOnePalette_NET8.csproj b/KB-Samples/TwoDiagramOnePalette/TwoDiagramOnePalette_NET8.csproj new file mode 100644 index 00000000..3c5230c5 --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/TwoDiagramOnePalette_NET8.csproj @@ -0,0 +1,12 @@ + + + + net8.0 + enable + enable + + + + + + \ No newline at end of file diff --git a/KB-Samples/TwoDiagramOnePalette/_Imports.razor b/KB-Samples/TwoDiagramOnePalette/_Imports.razor new file mode 100644 index 00000000..fb4d1dcd --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/_Imports.razor @@ -0,0 +1,5 @@ +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.JSInterop +@using TwoDiagramOnePalette +@using Syncfusion.Blazor.Diagram diff --git a/KB-Samples/TwoDiagramOnePalette/appsettings.Development.json b/KB-Samples/TwoDiagramOnePalette/appsettings.Development.json new file mode 100644 index 00000000..770d3e93 --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "DetailedErrors": true, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/KB-Samples/TwoDiagramOnePalette/appsettings.json b/KB-Samples/TwoDiagramOnePalette/appsettings.json new file mode 100644 index 00000000..10f68b8c --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/KB-Samples/TwoDiagramOnePalette/wwwroot/css/site.css b/KB-Samples/TwoDiagramOnePalette/wwwroot/css/site.css new file mode 100644 index 00000000..08e7f0be --- /dev/null +++ b/KB-Samples/TwoDiagramOnePalette/wwwroot/css/site.css @@ -0,0 +1,28 @@ +#blazor-error-ui { + background: lightyellow; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + width: 100%; + z-index: 1000; +} + + #blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: 3.5rem; + top: 0.5rem; + } + +.blazor-error-boundary { + background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNT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