public void LoadFromResource(IDocumentResource documentResource, params object[] otherParams) { DocumentResource = documentResource; var syncDataResource = documentResource as SyncDataResource; if (syncDataResource != null) { DocumentName = Path.GetFileNameWithoutExtension(syncDataResource.FullName); DataSet = DatasetSerialize.DataSetDeserialize(syncDataResource.FullName); ShowDataSet(DataSet); } }
public void LoadFromResource(IDocumentResource documentResource, params object[] otherParams) { this.DocumentResource = documentResource; if (documentResource.ResourceMetaData.ResourceStorageMode == ResourceStorageMode.SingleFile) { ISingleFileDocumentResource singleFileDocumentResource = documentResource as ISingleFileDocumentResource; LoadFromFile(singleFileDocumentResource.FullName, otherParams); } else if (documentResource.ResourceMetaData.ResourceStorageMode == ResourceStorageMode.FromWebGet) { IWebDocumentResource webDocumentResource = documentResource as IWebDocumentResource; LoadFromWeb(webDocumentResource.Url, otherParams); } else if (documentResource.ResourceMetaData.ResourceStorageMode == ResourceStorageMode.StreamResource) { IStreamDocumentResource streamDocumentResource = documentResource as IStreamDocumentResource; LoadFromStream(streamDocumentResource.Stream, otherParams); } }
public void Open(IDocumentResource resource) { this.Document.LoadFromResource(resource); }