/// <summary> /// Returns a <see cref="Task" /> running <see cref="Datasource.Load(string)" /> /// </summary> /// <param name="uri"><see cref="string" /> Datasource uri </param> /// <returns><see cref="Task" /> running <see cref="Datasource.Load(string)" /> </returns> public static Task <Datasource> LoadAsync(string uri) { Task <Datasource> t1 = new Task <Datasource>(() => { return(Datasource.Load(uri)); }); t1.Start(); return(t1); }
/// <summary> /// Create a Datasource from a Uri - e.g. filename /// </summary> /// <param name="uri"><see cref="string" /> Datasource uri </param> /// <returns><see cref="Datasource" /></returns> public static Datasource Load(string uri) { Datasource ds = new Datasource(uri); string ret = Mdal.GetNames(uri); MDAL_Status status = Mdal.LastStatus(); if (ret == null && status != MDAL_Status.None) { throw new Exception(status.ToString() + uri); } ds.meshes = ret.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); return(ds); }