Exemplo n.º 1
0
        public StreamRef StreamOf(StreamPath path)
        {
            if (path == StreamPath.Empty)
                throw new ArgumentException("Stream path is empty", nameof(path));

            return StreamRef.Deserialize(path);
        }
Exemplo n.º 2
0
        public static Ref Deserialize(string path, Type type)
        {
            if (type == typeof(ClientRef))
            {
                return(ClientRef.Deserialize(path));
            }

            if (type == typeof(ActorRef))
            {
                return(ActorRef.Deserialize(path));
            }

            if (type == typeof(StreamRef))
            {
                return(StreamRef.Deserialize(path));
            }

            var deserializer = deserializers.Find(type);

            if (deserializer != null)
            {
                return(deserializer(path));
            }

            throw new InvalidOperationException("Unknown ref type: " + type);
        }
Exemplo n.º 3
0
        public StreamRef StreamOf(StreamPath path)
        {
            if (path == StreamPath.Empty)
            {
                throw new ArgumentException("Stream path is empty", "path");
            }

            return(StreamRef.Deserialize(path));
        }