示例#1
0
        public StaticFile( string fullPath, DataProviderContext context, string storeId, string providerRoot)
        {
            string websitePath = PathUtil.GetWebsitePath(fullPath);
            string providerRelativePath = websitePath.Substring(providerRoot.Length - 1);

            Id = CalculateId(providerRelativePath);
            DownloadUrl = websitePath;
            FileName = Path.GetFileName(providerRelativePath);
            FolderPath = Path.GetDirectoryName(providerRelativePath).Replace("\\","/");
            StoreId = storeId;
            DataSourceId = context.CreateDataSourceId( new MediaDataId { Id = this.Id, MediaType = MediaElementType.File }, typeof(IMediaFile) );
            CreationTime = DateTime.MinValue;
            LastWriteTime = DateTime.MinValue;
            Length = 0;
        }
示例#2
0
        public StaticFolder(string fullPath, DataProviderContext context, string storeId, string providerRoot)
        {
            string websitePath = PathUtil.GetWebsitePath(fullPath);
            string providerRelativePath = websitePath.Substring(providerRoot.Length - 1);

            Id = CalculateId(providerRelativePath);
            StoreId = storeId;
            DataSourceId = context.CreateDataSourceId(new MediaDataId { Id = this.Id, MediaType = MediaElementType.Folder }, typeof(IMediaFileFolder));

            Description = "";
            Title = System.IO.Path.GetFileName(providerRelativePath);
            StoreId = storeId;
            Path = providerRelativePath;

            KeyPath = storeId + ":" + Id;
            CompositePath = storeId + ":" + providerRelativePath;
        }
示例#3
0
        public IData GetDataByDataId(IDataId dataId, DataProviderContext dataProivderContext)
        {
            SqlDataTypeStoreTable storage = GetCurrentTable();

            return storage.SqlDataProviderHelper.GetDataById(GetQueryable(), dataId, dataProivderContext);
        }
示例#4
0
        public IData AddNew(IData dataToAdd, DataProviderContext dataProivderContext, DataContext dataContext)
        {
            SqlDataTypeStoreTable storeTable = GetCurrentTable();

            return storeTable.SqlDataProviderHelper.AddData((ISqlDataContext)dataContext, dataToAdd, dataProivderContext);
        }