Example #1
0
        internal static NodeContext CreateFromNative(NativeRuntime.IFabricNodeContextResult2 nodeContextResult)
        {
            NodeContext nd = FromNative(nodeContextResult);

            GC.KeepAlive(nodeContextResult);
            return(nd);
        }
Example #2
0
        internal static unsafe NodeContext FromNative(NativeRuntime.IFabricNodeContextResult2 nodeContextResult)
        {
            var nodeContext = nodeContextResult.get_NodeContext();

            NativeTypes.FABRIC_NODE_CONTEXT *nativeNodeContext = (NativeTypes.FABRIC_NODE_CONTEXT *)nodeContext;
            NativeTypes.FABRIC_NODE_ID       nativenodeId      = (NativeTypes.FABRIC_NODE_ID)nativeNodeContext->NodeId;
            NodeId     nodeId          = new NodeId(nativenodeId.High, nativenodeId.Low);
            string     nodeName        = NativeTypes.FromNativeString(nativeNodeContext->NodeName);
            BigInteger nodeInstanceId  = new BigInteger(nativeNodeContext->NodeInstanceId);
            string     nodeType        = NativeTypes.FromNativeString(nativeNodeContext->NodeType);
            string     ipAddressOrFQDN = NativeTypes.FromNativeString(nativeNodeContext->IPAddressOrFQDN);

            return(new NodeContext(nodeContextResult)
            {
                NodeId = nodeId,
                NodeName = nodeName,
                NodeInstanceId = nodeInstanceId,
                NodeType = nodeType,
                IPAddressOrFQDN = ipAddressOrFQDN
            });
        }
Example #3
0
 private unsafe NodeContext GetNodeContextEndWrapper(NativeCommon.IFabricAsyncOperationContext context)
 {
     NativeRuntime.IFabricNodeContextResult2 nodeContextResult = NativeRuntime.FabricEndGetNodeContext(context);
     return(NodeContext.CreateFromNative(nodeContextResult));
 }
Example #4
0
 private unsafe NodeContext GetNodeContextHelper()
 {
     NativeRuntime.IFabricNodeContextResult2 nodeContextResult = NativeRuntime.FabricGetNodeContext();
     return(NodeContext.CreateFromNative(nodeContextResult));
 }
Example #5
0
        internal NodeContext(NativeRuntime.IFabricNodeContextResult2 nativeNodeContext)
        {
            Requires.Argument("nativeNodeContext", nativeNodeContext).NotNull();

            this.nativeNodeContext = nativeNodeContext;
        }