本文整理汇总了C#中IMediaService类的典型用法代码示例。如果您正苦于以下问题:C# IMediaService类的具体用法?C# IMediaService怎么用?C# IMediaService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMediaService类属于命名空间,在下文中一共展示了IMediaService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MediaServiceSaved
static void MediaServiceSaved(IMediaService sender, SaveEventArgs<IMedia> e)
{
foreach (var item in e.SavedEntities)
{
library.ClearLibraryCacheForMedia(item.Id);
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:LibraryCacheRefresher.cs
示例2: UploadController
/// <summary>
/// 构造函数
/// </summary>
public UploadController(ILogger logger, IConfigService configService, IMediaService mediaService)
{
_logger = logger;
_configService = configService;
_mediaService = mediaService;
saveRootPath = _configService.GetByKey<string>("UploadRootDir", "UploadFiles");
}
开发者ID:hhahh2011,项目名称:CH.Spartan,代码行数:10,代码来源:UploadController.cs
示例3: DirectoryCleanupTask
public DirectoryCleanupTask(IContentManager contentManager,
IMediaService mediaService)
{
_contentManager = contentManager;
_mediaService = mediaService;
Logger = NullLogger.Instance;
}
开发者ID:pavelvolek,项目名称:SYBA.ObalRoku,代码行数:7,代码来源:DirectoryCleanupTask.cs
示例4: GetOrCreateMediaItem
/// <summary>
/// Get or Create a media folder
/// </summary>
/// <param name="mediaName"></param>
/// <param name="mediaService"></param>
/// <param name="documentType"> </param>
/// <param name="parentNodeId"></param>
/// <returns></returns>
public static IMedia GetOrCreateMediaItem(IMediaService mediaService, string documentType, int parentNodeId, string mediaName, byte[] file = null)
{
var childItems = mediaService.GetChildren(parentNodeId);
IMedia childItem = null;
var enumerable = childItems as IMedia[] ?? childItems.ToArray();
if (enumerable.Any())
{
childItem = enumerable.FirstOrDefault(i => i.Name.ToLower().Equals(mediaName.ToLower()));
}
if (childItem == null)
{
childItem = mediaService.CreateMedia(mediaName, parentNodeId, documentType);
if (file != null)
{
childItem.SetValue("umbracoFile", mediaName, new MemoryStream(file));
}
mediaService.Save(childItem);
}
return childItem;
}
开发者ID:micklaw,项目名称:TeaLeafed,代码行数:35,代码来源:ImporterConverters.cs
示例5: MusicPlayerViewModel
public MusicPlayerViewModel(HistoryService historyService, IMediaService mediaService, VlcService mediaPlayerService)
: base(historyService, mediaService, mediaPlayerService)
{
_trackCollection = new TrackCollectionViewModel();
_mediaService.MediaEnded += MediaService_MediaEnded;
_historyService = historyService;
}
开发者ID:kusl,项目名称:vlcwinrt,代码行数:7,代码来源:MusicPlayerViewModel.cs
示例6: MediaService_Deleted
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void MediaService_Deleted(IMediaService sender, DeleteEventArgs<IMedia> e)
{
if (connection.State != ConnectionState.Open)
{
connection.Open();
}
foreach (var item in e.DeletedEntities)
{
string Resource = item.Name;
SqlTransaction tran = connection.BeginTransaction();
var command = new SqlCommand("dbo.[RequestCdnResourceInvalidation]", connection, tran);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@resource", SqlDbType.NVarChar, 256);
command.Parameters["@resource"].Value = Resource;
command.Parameters.Add("@ConversationHandle", SqlDbType.UniqueIdentifier);
command.Parameters["@ConversationHandle"].Direction = ParameterDirection.Output;
command.ExecuteNonQuery();
tran.Commit();
}
}
开发者ID:JamesGreenAU,项目名称:UmbracoServiceBroker,代码行数:30,代码来源:MediaQueue.cs
示例7: MediaService_Deleted
void MediaService_Deleted(IMediaService sender, DeleteEventArgs<IMedia> e)
{
foreach (IMedia entity in e.DeletedEntities.Where(entity => entity.ContentType.Alias == PPC_2010.Data.Constants.SermonAlias))
{
ServiceLocator.Instance.Locate<ISermonRepository>().RefreshSermon(entity.Id, true);
}
}
开发者ID:shferguson,项目名称:ppc2010,代码行数:7,代码来源:SermonEvents.cs
示例8: EventsController
public EventsController(IUserProfileService profileService, IEventService eventService, IFacebookService facebookService, IMediaService mediaService)
{
_profileService = profileService;
_eventService = eventService;
_facebookService = facebookService;
_mediaService = mediaService;
}
开发者ID:ryanerdmann,项目名称:angora,代码行数:7,代码来源:EventsController.cs
示例9: ToPublicModel
public static SponsorPublicModel ToPublicModel(this Sponsor sponsor, IUserService userService, IMediaService pictureService, ISponsorService sponsorService, IFormatterService formatterService, MediaSettings mediaSettings)
{
var user = userService.Get(sponsor.UserId);
if (user == null)
return null;
//get sponsor data
var sponsorData = sponsorService.GetSponsorData(sponsor.BattleId, sponsor.BattleType, sponsor.UserId);
var model = new SponsorPublicModel
{
SponsorshipStatus = sponsor.SponsorshipStatus,
SponsorshipStatusName = sponsor.SponsorshipStatus.ToString(),
CustomerId = sponsor.UserId,
SeName = user.GetPermalink().ToString(),
SponsorName = user.GetPropertyValueAs<string>(PropertyNames.DisplayName),
SponsorProfileImageUrl =
pictureService.GetPictureUrl(user.GetPropertyValueAs<int>(PropertyNames.DefaultPictureId)),
SponsorshipAmount = sponsor.SponsorshipAmount,
SponsorshipAmountFormatted = formatterService.FormatCurrency(sponsor.SponsorshipAmount, ApplicationContext.Current.ActiveCurrency),
SponsorData = sponsorData.ToModel(pictureService),
SponsorshipType = sponsor.SponsorshipType
};
return model;
}
开发者ID:mobsoftware,项目名称:mobsocial,代码行数:26,代码来源:SponsorExtensions.cs
示例10: ServiceContext
/// <summary>
/// public ctor - will generally just be used for unit testing
/// </summary>
/// <param name="contentService"></param>
/// <param name="mediaService"></param>
/// <param name="contentTypeService"></param>
/// <param name="dataTypeService"></param>
/// <param name="fileService"></param>
/// <param name="localizationService"></param>
/// <param name="packagingService"></param>
/// <param name="entityService"></param>
/// <param name="relationService"></param>
/// <param name="sectionService"></param>
/// <param name="treeService"></param>
/// <param name="tagService"></param>
public ServiceContext(
IContentService contentService,
IMediaService mediaService,
IContentTypeService contentTypeService,
IDataTypeService dataTypeService,
IFileService fileService,
ILocalizationService localizationService,
PackagingService packagingService,
IEntityService entityService,
IRelationService relationService,
ISectionService sectionService,
IApplicationTreeService treeService,
ITagService tagService)
{
_tagService = new Lazy<ITagService>(() => tagService);
_contentService = new Lazy<IContentService>(() => contentService);
_mediaService = new Lazy<IMediaService>(() => mediaService);
_contentTypeService = new Lazy<IContentTypeService>(() => contentTypeService);
_dataTypeService = new Lazy<IDataTypeService>(() => dataTypeService);
_fileService = new Lazy<IFileService>(() => fileService);
_localizationService = new Lazy<ILocalizationService>(() => localizationService);
_packagingService = new Lazy<PackagingService>(() => packagingService);
_entityService = new Lazy<IEntityService>(() => entityService);
_relationService = new Lazy<IRelationService>(() => relationService);
_sectionService = new Lazy<ISectionService>(() => sectionService);
_treeService = new Lazy<IApplicationTreeService>(() => treeService);
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:42,代码来源:ServiceContext.cs
示例11: AdminController
public AdminController(IOrchardServices services, IMediaService mediaService) {
Services = services;
_mediaService = mediaService;
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
}
开发者ID:anycall,项目名称:Orchard,代码行数:7,代码来源:AdminController.cs
示例12: MediaServiceSaving
static void MediaServiceSaving(IMediaService sender, Core.Events.SaveEventArgs<IMedia> e)
{
foreach (var m in e.SavedEntities)
{
AutoFillProperties(m);
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:FileUploadPropertyEditor.cs
示例13: ContentTypeService
public ContentTypeService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, IContentService contentService, IMediaService mediaService)
{
_uowProvider = provider;
_repositoryFactory = repositoryFactory;
_contentService = contentService;
_mediaService = mediaService;
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:ContentTypeService.cs
示例14: ThumbnailsService
public ThumbnailsService(ShellSettings settings, IWorkContextAccessor wca, ICacheManager cacheManager, IMediaService mediaService, ISignals signals, IStorageProvider storageProvider)
{
_wca = wca;
_cacheManager = cacheManager;
_mediaService = mediaService;
_signals = signals;
_storageProvider = storageProvider;
var appPath = "";
if (HostingEnvironment.IsHosted)
{
appPath = HostingEnvironment.ApplicationVirtualPath;
}
if (!appPath.EndsWith("/"))
appPath = appPath + '/';
if (!appPath.StartsWith("/"))
appPath = '/' + appPath;
_publicPath = appPath + "Media/" + settings.Name + "/";
var physPath = ThumbnailsCacheMediaPath.Replace('/', Path.DirectorySeparatorChar);
var parent = Path.GetDirectoryName(physPath);
var folder = Path.GetFileName(physPath);
if (_mediaService.GetMediaFolders(parent).All(f => f.Name != folder))
{
_mediaService.CreateFolder(parent, folder);
}
}
开发者ID:pnmcosta,项目名称:orchardcontribthumbnails,代码行数:27,代码来源:ThumbnailsService.cs
示例15: WikiPageController
public WikiPageController(IOrchardServices orchardServices,
IRepository<WikiPageAttachmentRecord> repoWikiAttachment,
ITagService tagService,
IAuthorizationService authorizationService,
INotifier notifier,
ISiteService siteService,
ISearchService searchService,
IShapeFactory shapeFactory,
IWikiPageService wikiPageService,
IMediaService mediaService
){
_orchardServices = orchardServices;
_repoWikiAttachment = repoWikiAttachment;
_tagService = tagService;
_authorizationService = authorizationService;
_notifier = notifier;
_searchService = searchService;
_siteService = siteService;
_wikiPageService = wikiPageService;
_mediaService = mediaService;
Logger = NullLogger.Instance;
Shape = shapeFactory;
}
开发者ID:kevinthant,项目名称:wiki,代码行数:25,代码来源:WikiPageController.cs
示例16: PackageIconUploader
public PackageIconUploader(IMediaService mediaService, IPackageIconValidator packageIconValidator, IPackageMediaDirectoryHelper packageMediaDirectoryHelper) {
_mediaService = mediaService;
_packageMediaDirectoryHelper = packageMediaDirectoryHelper;
_packageIconValidator = packageIconValidator;
T = NullLocalizer.Instance;
}
开发者ID:NickAndersonX,项目名称:xodb,代码行数:7,代码来源:PackageIconUploader.cs
示例17: MediaServiceDeleting
static void MediaServiceDeleting(IMediaService sender, DeleteEventArgs<IMedia> e)
{
foreach (var item in e.DeletedEntities)
{
library.ClearLibraryCacheForMedia(item.Id);
}
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:LibraryCacheRefresher.cs
示例18: ToModel
public static UserResponseModel ToModel(this User user, IMediaService mediaService, MediaSettings mediaSettings)
{
var model = new UserResponseModel()
{
Id = user.Id,
FirstName = user.FirstName,
LastName = user.LastName,
Name = user.Name,
DateCreatedUtc = user.DateCreated,
DateCreatedLocal = DateTimeHelper.GetDateInUserTimeZone(user.DateCreated, DateTimeKind.Utc, user),
UserName = user.UserName,
CoverImageUrl = mediaService.GetPictureUrl(user.GetPropertyValueAs<int>(PropertyNames.DefaultCoverId), PictureSizeNames.MediumCover),
ProfileImageUrl = mediaService.GetPictureUrl(user.GetPropertyValueAs<int>(PropertyNames.DefaultPictureId), PictureSizeNames.MediumProfileImage),
Active = user.Active
};
if (!string.IsNullOrEmpty(model.CoverImageUrl) && !string.IsNullOrEmpty(model.ProfileImageUrl))
return model;
if (string.IsNullOrEmpty(model.CoverImageUrl))
model.CoverImageUrl = mediaSettings.DefaultUserProfileCoverUrl;
if (string.IsNullOrEmpty(model.ProfileImageUrl))
model.ProfileImageUrl = mediaSettings.DefaultUserProfileImageUrl;
return model;
}
开发者ID:mobsoftware,项目名称:mobsocial,代码行数:26,代码来源:UserExtensions.cs
示例19: RootPage
public RootPage(VlcService vlcService, IMediaService mediaService)
{
InitializeComponent();
_vlcService = vlcService;
(mediaService as MediaService).SetMediaElement(FoudationMediaElement);
Loaded += SwapPanelLoaded;
}
开发者ID:kusl,项目名称:vlcwinrt,代码行数:7,代码来源:RootPage.xaml.cs
示例20: MediaPostValidateAttribute
public MediaPostValidateAttribute(IMediaService mediaService, WebSecurity security)
{
if (mediaService == null) throw new ArgumentNullException("mediaService");
if (security == null) throw new ArgumentNullException("security");
_mediaService = mediaService;
_security = security;
}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:7,代码来源:MediaPostValidateAttribute.cs
注:本文中的IMediaService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论