using Serein.Library.Api; using Serein.Library.Utils; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Serein.Library { /// /// 不提供流程操作能力,仅提供容器功能 /// public class ContainerFlowEnvironment : IFlowEnvironment, ISereinIOC { /// /// 本地运行环境缓存的持久化实例 /// private Dictionary PersistennceInstance { get; } = new Dictionary(); public ContainerFlowEnvironment() { } private ISereinIOC sereinIOC => this; public ISereinIOC IOC => sereinIOC; public string EnvName => throw new NotImplementedException(); public string ProjectFileLocation => throw new NotImplementedException(); public bool IsGlobalInterrupt => throw new NotImplementedException(); public bool IsControlRemoteEnv => throw new NotImplementedException(); public InfoClass InfoClass { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public RunState FlowState { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public RunState FlipFlopState { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public IFlowEnvironment CurrentEnv => this; public UIContextOperation UIContextOperation { get; set; } public NodeMVVMManagement NodeMVVMManagement { get; set; } /// /// 设置在UI线程操作的线程上下文 /// /// public void SetUIContextOperation(UIContextOperation uiContextOperation) { this.UIContextOperation = uiContextOperation; } public void ActivateFlipflopNode(string nodeGuid) { throw new NotImplementedException(); } public Task ChangeParameter(string nodeGuid, bool isAdd, int paramIndex) { throw new NotImplementedException(); } public Task ConnectArgSourceNodeAsync(string fromNodeGuid, string toNodeGuid, JunctionType fromNodeJunctionType, JunctionType toNodeJunctionType, ConnectionArgSourceType argSourceType, int argIndex) { throw new NotImplementedException(); } public Task ConnectInvokeNodeAsync(string fromNodeGuid, string toNodeGuid, JunctionType fromNodeJunctionType, JunctionType toNodeJunctionType, ConnectionInvokeType invokeType) { throw new NotImplementedException(); } public Task<(bool, RemoteMsgUtil)> ConnectRemoteEnv(string addres, int port, string token) { throw new NotImplementedException(); } public Task CreateNodeAsync(NodeControlType nodeType, PositionOfUI position, MethodDetailsInfo methodDetailsInfo = null) { throw new NotImplementedException(); } public Task ExitFlowAsync() { throw new NotImplementedException(); } public void ExitRemoteEnv() { throw new NotImplementedException(); } public Task GetEnvInfoAsync() { throw new NotImplementedException(); } public Task GetProjectInfoAsync() { throw new NotImplementedException(); } public Task InvokeNodeAsync(IDynamicContext context, string nodeGuid) { throw new NotImplementedException(); } public void LoadAllNativeLibraryOfRuning(string path, bool isRecurrence = true) { throw new NotImplementedException(); } public void LoadLibrary(string dllPath) { throw new NotImplementedException(); } public bool LoadNativeLibraryOfRuning(string file) { throw new NotImplementedException(); } public Task LoadNodeInfosAsync(List nodeInfos) { throw new NotImplementedException(); } public void LoadProject(FlowEnvInfo flowEnvInfo, string filePath) { throw new NotImplementedException(); } public void MonitorObjectNotification(string nodeGuid, object monitorData, MonitorObjectEventArgs.ObjSourceType sourceType) { throw new NotImplementedException(); } public void MoveNode(string nodeGuid, double x, double y) { throw new NotImplementedException(); } public void NodeLocated(string nodeGuid) { throw new NotImplementedException(); } public Task NotificationNodeValueChangeAsync(string nodeGuid, string path, object value) { throw new NotImplementedException(); } public Task PlaceNodeToContainerAsync(string nodeGuid, string containerNodeGuid) { throw new NotImplementedException(); } public Task RemoveConnectArgSourceAsync(string fromNodeGuid, string toNodeGuid, int argIndex) { throw new NotImplementedException(); } public Task RemoveConnectInvokeAsync(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType) { throw new NotImplementedException(); } public Task RemoveNodeAsync(string nodeGuid) { throw new NotImplementedException(); } public void SaveProject() { throw new NotImplementedException(); } public Task SetConnectPriorityInvoke(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType) { throw new NotImplementedException(); } public Task SetStartNodeAsync(string nodeGuid) { throw new NotImplementedException(); } public Task StartAsyncInSelectNode(string startNodeGuid) { throw new NotImplementedException(); } public Task StartFlowAsync() { throw new NotImplementedException(); } public Task StartRemoteServerAsync(int port = 7525) { throw new NotImplementedException(); } public void StopRemoteServer() { throw new NotImplementedException(); } public Task TakeOutNodeToContainerAsync(string nodeGuid) { throw new NotImplementedException(); } public void TerminateFlipflopNode(string nodeGuid) { throw new NotImplementedException(); } public void TriggerInterrupt(string nodeGuid, string expression, InterruptTriggerEventArgs.InterruptTriggerType type) { throw new NotImplementedException(); } public bool TryGetDelegateDetails(string assemblyName, string methodName, out DelegateDetails del) { throw new NotImplementedException(); } public bool TryGetMethodDetailsInfo(string assemblyName, string methodName, out MethodDetailsInfo mdInfo) { throw new NotImplementedException(); } public bool TryUnloadLibrary(string assemblyFullName) { throw new NotImplementedException(); } public void WriteLine(InfoType type, string message, InfoClass @class = InfoClass.Trivial) { throw new NotImplementedException(); } #region IOC容器相关 ISereinIOC ISereinIOC.Reset() { sereinIOC.Reset(); lock (PersistennceInstance) { foreach (var kvp in PersistennceInstance) { IOC.RegisterPersistennceInstance(kvp.Key, kvp.Value); } } // 重置后重新登记 return this; } ISereinIOC ISereinIOC.Register(Type type, params object[] parameters) { sereinIOC.Register(type, parameters); return this; } ISereinIOC ISereinIOC.Register(params object[] parameters) { sereinIOC.Register(parameters); return this; } ISereinIOC ISereinIOC.Register(params object[] parameters) { sereinIOC.Register(parameters); return this; } //T ISereinIOC.GetOrRegisterInstantiate() //{ // return sereinIOC.GetOrRegisterInstantiate(); //} //object ISereinIOC.GetOrRegisterInstantiate(Type type) //{ // return sereinIOC.GetOrRegisterInstantiate(type); //} object ISereinIOC.Get(Type type) { return sereinIOC.Get(type); } T ISereinIOC.Get() { return (T)sereinIOC.Get(typeof(T)); } T ISereinIOC.Get(string key) { return sereinIOC.Get(key); } bool ISereinIOC.RegisterPersistennceInstance(string key, object instance) { if (PersistennceInstance.ContainsKey(key)) { return false; } PersistennceInstance.Add(key, instance); // 记录需要持久化的实例 return sereinIOC.RegisterPersistennceInstance(key, instance); } bool ISereinIOC.RegisterInstance(string key, object instance) { return sereinIOC.RegisterInstance(key, instance); } object ISereinIOC.Instantiate(Type type) { return sereinIOC.Instantiate(type); } T ISereinIOC.Instantiate() { return sereinIOC.Instantiate(); } ISereinIOC ISereinIOC.Build() { sereinIOC.Build(); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } ISereinIOC ISereinIOC.Run(Action action) { sereinIOC.Run(action); return this; } #endregion } }