-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
修复 情景Tick方法执行
- Loading branch information
Showing
17 changed files
with
177 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Core/SDKs/Services/Plugin/PluginAvaloniaResourceManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Avalonia.Styling; | ||
|
||
namespace Core.SDKs.Services.Plugin; | ||
|
||
public static class PluginAvaloniaResourceManager | ||
{ | ||
private static Dictionary<string, IStyle> _resources = new(); | ||
|
||
public static IStyle GetStyle(string key) | ||
{ | ||
if (_resources.ContainsKey(key)) | ||
{ | ||
return _resources[key]; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public static IStyle AddStyle(string key, IStyle style) | ||
{ | ||
if (!_resources.ContainsKey(key)) | ||
{ | ||
_resources.Add(key, style); | ||
} | ||
|
||
return style; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using Avalonia.Controls.Templates; | ||
using Avalonia.Markup.Xaml.Styling; | ||
using PluginCore; | ||
|
||
namespace KitopiaEx; | ||
|
||
public class NodeInputConnector1 : INodeInputConnector | ||
{ | ||
public StyleInclude Style => | ||
new(new Uri("avares://KitopiaEx")) | ||
{ Source = new Uri("NodeInputConnector1Style.axaml", UriKind.Relative) }; | ||
|
||
public IDataTemplate IDataTemplate => | ||
new ResourceInclude(new Uri("avares://KitopiaEx")) | ||
{ Source = new Uri("NodeInputConnector1DataTemple.axaml", UriKind.Relative) } | ||
.TryGetResource("Template", null, out var variant) | ||
? (IDataTemplate)variant | ||
: null; | ||
|
||
public ObservableValue Value { get; } = new ObservableValue(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ResourceDictionary xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:customScenario="clr-namespace:Core.SDKs.CustomScenario;assembly=PluginCore"> | ||
<!-- Add Resources Here --> | ||
<DataTemplate x:Key="Template" DataType="customScenario:IConnectorItem"> | ||
<Button Height="30" Width="30" Foreground="Black"> | ||
<Ellipse Width="30" Height="30" Fill="Red" /> | ||
</Button> | ||
</DataTemplate> | ||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Styles xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="using:KitopiaEx"> | ||
<Design.PreviewWith> | ||
<controls:NodeInputConnector1Style /> | ||
</Design.PreviewWith> | ||
|
||
<Style Selector="controls|NodeInputConnector1Style"> | ||
<!-- Set Defaults --> | ||
<Setter Property="Template"> | ||
<ControlTemplate> | ||
<TextBlock Text="Templated Control" /> | ||
</ControlTemplate> | ||
</Setter> | ||
</Style> | ||
</Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using Avalonia.Controls.Primitives; | ||
|
||
namespace KitopiaEx; | ||
|
||
public class NodeInputConnector1Style : TemplatedControl | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using PluginCore.Attribute; | ||
|
||
namespace KitopiaEx; | ||
|
||
[CustomNodeInputType(typeof(NodeInputConnector1))] | ||
public class NodeInputType1 | ||
{ | ||
public string Name { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Styles xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | ||
<Design.PreviewWith> | ||
<Border Padding="20"> | ||
<!-- Add Controls for Previewer Here --> | ||
</Border> | ||
</Design.PreviewWith> | ||
|
||
<!-- Add Styles Here --> | ||
|
||
</Styles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule PluginCore
updated
5 files
+14 −0 | Attribute/CustomNodeInputType.cs | |
+37 −0 | IConnectorItem.cs | |
+12 −0 | INodeInputConnector.cs | |
+23 −0 | IScreenCapture.cs | |
+57 −0 | ObservableValue.cs |