static private void OnNewObject_callback(IntPtr instance, IntPtr o, IntPtr session) { DistClient client = ReferenceDictionary <DistClient> .GetObject(instance); try { client?.OnNewObject?.Invoke(client, GetObject(o), GetSession(session)); } catch (Exception ex) { Message.SendException("DistClient", ex); } }
static private void OnTick_callback(IntPtr instance) { DistClient client = ReferenceDictionary <DistClient> .GetObject(instance); try { client?.OnTick?.Invoke(client); } catch (Exception ex) { Message.SendException($"DistClient", ex); } }
static private void OnAction_callback(IntPtr instance, NodeActionEvent action, IntPtr native_context_ref, IntPtr native_trigger_ref, IntPtr native_traverser_ref, IntPtr userdata) { NodeAction na = ReferenceDictionary <NodeAction> .GetObject(instance); if (na != null) { if (action != NodeActionEvent.REMOVE) { na.OnAction?.Invoke(na, action, CreateObject(native_context_ref) as Context, CreateObject(native_trigger_ref) as NodeActionProvider, CreateObject(native_traverser_ref) as TraverseAction, userdata); } else { na.OnAction?.Invoke(na, action, CreateObject(native_context_ref) as Context, null, CreateObject(native_traverser_ref) as TraverseAction, native_trigger_ref); } } }
static private void OnRemoveSession_callback(IntPtr instance, IntPtr session) { DistClient client = ReferenceDictionary <DistClient> .GetObject(instance); if (client != null) { try { client.OnRemoveSession?.Invoke(client, GetSession(session)); } catch (Exception ex) { Message.SendException("DistClient", ex); } ReferenceDictionary <DistSession> .RemoveObject(session); } }
public DistObject GetObject(string objectName, string typeName = "gzDistObject") { return(ReferenceDictionary <DistObject> .GetObject(DistManager_getObject(GetNativeReference(), objectName, typeName))); }