Exemplo n.º 1
0
        public void Get_valid_item_from_archive()
        {
            byte[] buffer = null;

            _archive.OpenAsync(_assembly);
            _archive.GetItem(new Uri(_archive.Uri, "index.html"), (res) =>
            {
                buffer = res.Data;
            });

            Assert.NotNull(buffer);
        }
Exemplo n.º 2
0
 public void Open_archive_with_a_custom_uri_from_string()
 {
     using (var archive = new SciterArchive("custom://app/"))
     {
         archive.OpenAsync(_assembly);
         var buffer = archive.GetItem("index.html");
         Assert.NotNull(buffer);
     }
 }
Exemplo n.º 3
0
 public void Open_archive_with_a_custom_uri_and_incorrect_item_scheme_returns_null()
 {
     using (var archive = new SciterArchive("custom://app/"))
     {
         archive.OpenAsync(_assembly);
         var buffer = archive.GetItem("notme://app/index.html");
         Assert.IsNull(buffer);
     }
 }
Exemplo n.º 4
0
        protected override LoadResult OnLoadData(object sender, LoadDataArgs args)
        {
            // load resource from SciterArchive
            _archive?.GetItem(args.Uri, (result) =>
            {
                if (result.IsSuccessful)
                {
                    _api.SciterDataReady(_window.Handle, result.Path, result.Data, (uint)result.Size);
                }
            });

            return(base.OnLoadData(sender: sender, args: args));
        }
Exemplo n.º 5
0
        protected override LoadResult OnLoadData(object sender, LoadDataArgs args)
        {
            //_logger?.LogDebug(args.Uri.ToString());

            // load resource from SciterArchive
            _archive?.GetItem(args.Uri, (res) =>
            {
                if (res.IsSuccessful)
                {
                    _api.SciterDataReady(Window.Handle, res.Path, res.Data, (uint)res.Size);
                }
            });

            // call base to ensure LibConsole is loaded
            return(base.OnLoadData(sender: sender, args: args));
        }