示例#1
0
        public MatrixAPI(string URL, IMatrixAPIBackend backend)
        {
            if (!Uri.IsWellFormedUriString(URL, UriKind.Absolute))
            {
                throw new MatrixException("URL is not valid");
            }

            IsAS            = true;
            mbackend        = backend;
            BaseURL         = URL;
            rng             = new Random(DateTime.Now.Millisecond);
            event_converter = new JSONEventConverter();
        }
示例#2
0
        public MatrixAPI(string URL, string application_token, string user_id)
        {
            if (!Uri.IsWellFormedUriString(URL, UriKind.Absolute))
            {
                throw new MatrixException("URL is not valid");
            }

            IsAS     = true;
            mbackend = new HttpBackend(URL, user_id);
            mbackend.SetAccessToken(application_token);
            this.user_id    = user_id;
            BaseURL         = URL;
            rng             = new Random(DateTime.Now.Millisecond);
            event_converter = new JSONEventConverter();
        }