コード例 #1
0
        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);
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 public void Open(IDocumentResource resource)
 {
     this.Document.LoadFromResource(resource);
 }