Class ControllerManager
Manages all controllers on server-side. Controllers are server objects which has view on the client. See ContorllerPacking.md for details.
Inheritance
System.Object
ControllerManager
Implements
System.IDisposable
Assembly: Eco.Core.dll
Syntax
public sealed class ControllerManager : Singleton<ControllerManager>, IThreadedPlugin, IShutdownablePlugin, IDisplayablePlugin, IGUIPlugin, IHasDisplayTabs, IDisplayTab, IInitializablePlugin, IServerPlugin, IDisposable
Constructors
ControllerManager()
Declaration
public ControllerManager()
Fields
ClientGotLotsPendingViews
Declaration
public static ThreadSafeAction<IMvcNetClient> ClientGotLotsPendingViews
Field Value
ControllerPropertyNotification
Declaration
public static ThreadSafeAction<IController, string, IMvcNetClient> ControllerPropertyNotification
Field Value
TypeToMarkedUpName
Declaration
public static Func<Type, LocString> TypeToMarkedUpName
Field Value
Type |
Description |
System.Func<System.Type, LocString> |
|
Declaration
public static Func<Type, IEnumerable<string>> TypeToTags
Field Value
Type |
Description |
System.Func<System.Type, System.Collections.Generic.IEnumerable<System.String>> |
|
ViewNameToID
Declaration
public ConcurrentDictionary<string, int> ViewNameToID
Field Value
Type |
Description |
System.Collections.Concurrent.ConcurrentDictionary<System.String, System.Int32> |
|
ViewNameToMarshaler
Declaration
public ConcurrentDictionary<string, IControllerMarshaler> ViewNameToMarshaler
Field Value
Type |
Description |
System.Collections.Concurrent.ConcurrentDictionary<System.String, IControllerMarshaler> |
|
ViewTypeData
Declaration
public ViewTypeData ViewTypeData
Field Value
Properties
Marshalers
Declaration
public IEnumerable<IControllerMarshaler> Marshalers { get; }
Property Value
MarshalersBasestTypes
Find basest types which implements both IPropertyChanged and INotifyPropertyChanged
Declaration
public IEnumerable<Type> MarshalersBasestTypes { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
MarshalersControllerTypes
Declaration
public IEnumerable<Type> MarshalersControllerTypes { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<System.Type> |
|
ViewData
Declaration
public static BSONValue ViewData { get; }
Property Value
Methods
ClearSingleton()
Declaration
public override void ClearSingleton()
ControllerIsRegisteredOrSubscribed(IController)
Declaration
public static bool ControllerIsRegisteredOrSubscribed(IController controller)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Dispose()
Declaration
DoWork()
Declaration
Returns
Type |
Description |
System.TimeSpan |
|
FromBson(BSONObject)
Declaration
public static object FromBson(BSONObject bson)
Parameters
Returns
Type |
Description |
System.Object |
|
GetCategory()
Declaration
public string GetCategory()
Returns
Type |
Description |
System.String |
|
GetController(Int32)
Declaration
public static IController GetController(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
GetControllerType(Type)
Declaration
public static Type GetControllerType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Type |
|
GetControllerTypeId(Type)
Returns controller type id (TypeID) for type
.
Declaration
public static int GetControllerTypeId(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Int32 |
|
GetDisplayText()
Declaration
public string GetDisplayText()
Returns
Type |
Description |
System.String |
|
GetPropertySyncFlags(Type, String)
Declaration
public SyncFlags GetPropertySyncFlags(Type controllerType, string propertyName)
Parameters
Type |
Name |
Description |
System.Type |
controllerType |
|
System.String |
propertyName |
|
Returns
GetStatus()
Declaration
public string GetStatus()
Returns
Type |
Description |
System.String |
|
GetViewClassInfo(Int32)
Declaration
public ViewClassInfo GetViewClassInfo(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
GetViewClassInfo(String)
Declaration
public ViewClassInfo GetViewClassInfo(string viewTypeName)
Parameters
Type |
Name |
Description |
System.String |
viewTypeName |
|
Returns
GetViewClassInfo(Type)
Declaration
public ViewClassInfo GetViewClassInfo(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
HandleBoundView(INetClient, Int32)
Declaration
public static void HandleBoundView(INetClient client, int controllerId)
Parameters
Type |
Name |
Description |
INetClient |
client |
|
System.Int32 |
controllerId |
|
HandleReleaseViews(INetClient, ReadOnlySpan<Int32>)
Declaration
public static void HandleReleaseViews(INetClient client, ReadOnlySpan<int> controllerIds)
Parameters
Type |
Name |
Description |
INetClient |
client |
|
System.ReadOnlySpan<System.Int32> |
controllerIds |
|
HandleViewRPC(INetClient, IController, String, BSONObject)
Declaration
public static object HandleViewRPC(INetClient client, IController controller, string methodIdOrName, BSONObject bson)
Parameters
Returns
Type |
Description |
System.Object |
|
HandleViewRPC(INetClient, Int32, String, BSONObject)
Declaration
public static object HandleViewRPC(INetClient client, int universalID, string methodIdOrName, BSONObject bson)
Parameters
Type |
Name |
Description |
INetClient |
client |
|
System.Int32 |
universalID |
|
System.String |
methodIdOrName |
|
BSONObject |
bson |
|
Returns
Type |
Description |
System.Object |
|
HasViewType(Type)
Checks if corresponding View type exists for the controller.
Declaration
public static bool HasViewType(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
Type |
Description |
System.Boolean |
|
Initialize(TimedTask)
Declaration
public void Initialize(TimedTask timer)
Parameters
NotifyPropertyForClient(IController, String, IMvcNetClient)
Used when needed to notify property to specific client. I.e. when he requested property with attribute MustRequest.
Declaration
public static void NotifyPropertyForClient(IController controller, string propertyName, IMvcNetClient client)
Parameters
PackageBigController(IController, INetClient, PackageFlags)
Declaration
public static BSONValue PackageBigController(IController obj, INetClient client, PackageFlags flags)
Parameters
Returns
PackageChanges(IController, String, PoolableListWrapper<ClientNotification>, IMvcNetClient[])
Package all changes into bson. It generates BSON->Clients since same BSON can be notifies to multiply clients.
Declaration
public void PackageChanges(IController controller, string propertyName, PoolableListWrapper<ClientNotification> notifications, IMvcNetClient[] clients = null)
Parameters
PackageController(IController, INetClient, PackageFlags)
You can use it when you don't carry about recollection of related views
Declaration
public static BSONValue PackageController(IController controller, INetClient boundClient, PackageFlags flags)
Parameters
Returns
PackageController(IController, in BsonSerializationContext, PackageFlags)
Declaration
public static BSONValue PackageController(IController controller, in BsonSerializationContext context, PackageFlags flags)
Parameters
Returns
Run()
Declaration
ShutdownAsync()
Declaration
public Task ShutdownAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SubscribeController(IController, ISubscriptions<ThreadSafeSubscriptions>, String, Action)
Subscribes to controller and registers subscription in subscriptions
.
Declaration
public static void SubscribeController(IController controller, ISubscriptions<ThreadSafeSubscriptions> subscriptions, string propName, Action changedCallback)
Parameters
SubscribeController(IController, String, Action, Boolean)
Subscribe on property propName
changes for the controller
.
Declaration
public static void SubscribeController(IController controller, string propName, Action changedCallback, bool unique = false)
Parameters
Type |
Name |
Description |
IController |
controller |
|
System.String |
propName |
|
System.Action |
changedCallback |
|
System.Boolean |
unique |
|
SubscribeControllerAndCall(IController, ISubscriptions<ThreadSafeSubscriptions>, String, Action)
Subscribes to controller, registers subscription in subscriptions
and calls changedCallback
.
Declaration
public static void SubscribeControllerAndCall(IController controller, ISubscriptions<ThreadSafeSubscriptions> subscriptions, string propName, Action changedCallback)
Parameters
SubscribeControllerUnique(IController, ISubscriptions<ThreadSafeSubscriptions>, String, Action)
Subscribes to controller (unique) and registers subscription in subscriptions
.
Declaration
public static void SubscribeControllerUnique(IController controller, ISubscriptions<ThreadSafeSubscriptions> subscriptions, string propName, Action changedCallback)
Parameters
SubscribeControllerUniqueAndCall(IController, ISubscriptions<ThreadSafeSubscriptions>, String, Action)
Subscribes to controller, registers subscription in subscriptions
and calls changedCallback
.
Declaration
public static void SubscribeControllerUniqueAndCall(IController controller, ISubscriptions<ThreadSafeSubscriptions> subscriptions, string propName, Action changedCallback)
Parameters
SubscribeWithoutTracking(IController, String, Action)
Creates a subscription but doesnt track it within a Subscriptions object. Should only be used when something is subscribing to its own properties,
meaning both 'watched' and 'watcher' are a single object and die at the same time.
Declaration
public static ISubscription SubscribeWithoutTracking(IController controller, string propname, Action callback)
Parameters
Type |
Name |
Description |
IController |
controller |
|
System.String |
propname |
|
System.Action |
callback |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
TryGetViewClassInfo(Type, out ViewClassInfo)
Declaration
public bool TryGetViewClassInfo(Type type, out ViewClassInfo viewClassInfo)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
ViewClassInfo |
viewClassInfo |
|
Returns
Type |
Description |
System.Boolean |
|
UnsubscribeController(IController, String, Action)
Declaration
public static bool UnsubscribeController(IController controller, string propname, Action changedCallback)
Parameters
Type |
Name |
Description |
IController |
controller |
|
System.String |
propname |
|
System.Action |
changedCallback |
|
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IDisposable
Extension Methods