コード例 #1
0
ファイル: Serializer.cs プロジェクト: philcleveland/akka.net
            /// <summary>
            ///     Writes the JSON representation of the object.
            /// </summary>
            /// <param name="writer">The <see cref="T:Newtonsoft.Json.JsonWriter" /> to write to.</param>
            /// <param name="value">The value.</param>
            /// <param name="serializer">The calling serializer.</param>
            public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
            {
                var @ref      = (ActorRef)value;
                var surrogate = new ActorRefSurrogate(Serialization.SerializedActorPath(@ref));

                serializer.Serialize(writer, surrogate);
            }
コード例 #2
0
        private byte[] ActorRefSerializer(IActorRef actorRef)
        {
            var str = Serialization.SerializedActorPath(actorRef);

            return(ObjectSerializer(str));
        }