当前位置: 首页>>代码示例>>C#>>正文


C# IMediaItem类代码示例

本文整理汇总了C#中IMediaItem的典型用法代码示例。如果您正苦于以下问题:C# IMediaItem类的具体用法?C# IMediaItem怎么用?C# IMediaItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IMediaItem类属于命名空间,在下文中一共展示了IMediaItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChangeStatus

        public void ChangeStatus(IMediaItem inItem, MediaStatus inStatus)
        {
            var item = (TvEpisode)inItem;
            item.Status = inStatus;

            Cabinet.SetAsync(item).Wait();
        }
开发者ID:jdbrock,项目名称:slouch,代码行数:7,代码来源:TvMediaSource.cs

示例2: PostStatusAsync

        public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
        {
            if (mediaItems == null)
                throw new ArgumentNullException(nameof(mediaItems));

            if (mediaItems.Length == 0)
                throw new ArgumentException("Err:Media not specified.");

            foreach (var item in mediaItems)
            {
                if (item == null)
                    throw new ArgumentException("Err:Media not specified.");

                if (!item.Exists)
                    throw new ArgumentException("Err:Media not found.");
            }

            var uploadTasks = from m in mediaItems
                              select this.UploadMediaItem(m);

            var mediaIds = await Task.WhenAll(uploadTasks)
                .ConfigureAwait(false);

            await this.tw.PostStatus(text, inReplyToStatusId, mediaIds)
                .ConfigureAwait(false);
        }
开发者ID:upsilon,项目名称:OpenTween,代码行数:26,代码来源:TwitterPhoto.cs

示例3: AbstractTranscoder

 public AbstractTranscoder(IMediaItem item, uint quality, bool isDirect, uint offsetSeconds, uint lengthSeconds)
 {
     State = TranscodeState.None;
     Item = item;
     Quality = quality;
     IsDirect = isDirect;
     OffsetSeconds = offsetSeconds;
     LengthSeconds = lengthSeconds;
 }
开发者ID:einsteinx2,项目名称:WaveBox,代码行数:9,代码来源:AbstractTranscoder.cs

示例4: VideoTranscoder

 public VideoTranscoder(IMediaItem item, uint quality, bool isDirect, uint? width, uint? height, bool maintainAspect, uint offsetSeconds, uint lengthSeconds)
     : base(item, quality, isDirect, offsetSeconds, lengthSeconds)
 {
     Width = width;
     Height = height;
     MaintainAspect = maintainAspect;
     OffsetSeconds = offsetSeconds;
     LengthSeconds = lengthSeconds;
 }
开发者ID:einsteinx2,项目名称:WaveBox,代码行数:9,代码来源:VideoTranscoder.cs

示例5: BuildMediaItemsTimelineMediaItemViewModel

 private MediaItemViewModel BuildMediaItemsTimelineMediaItemViewModel(IMediaItem mediaItem, MediaItemsTimelineViewModel mediaItemsTimelineViewModel, TrackViewModel trackViewModel)
 {
     return new MediaItemViewModel
     {
         MediaItem = mediaItem,
         MediaItemsTimelineViewModel = mediaItemsTimelineViewModel,
         TrackViewModel = trackViewModel
     };
 }
开发者ID:AugustinasNomicas,项目名称:MultitrackPlayer,代码行数:9,代码来源:MultitrackPlayerController.cs

示例6: Compare

 public override int Compare(IMediaItem x, IMediaItem y)
 {
     if (x == null) {
     throw new ArgumentNullException("x");
       }
       if (y == null) {
     throw new ArgumentNullException("y");
       }
       return comp.Compare(x.Title, y.Title);
 }
开发者ID:rodionovstepan,项目名称:simpleDLNA,代码行数:10,代码来源:TitleComparer.cs

示例7: Compare

 public override int Compare(IMediaItem x, IMediaItem y)
 {
     var xm = x as IMetaInfo;
       var ym = y as IMetaInfo;
       if (xm != null && ym != null) {
     var rv = xm.InfoDate.CompareTo(ym.InfoDate);
     if (rv != 0) {
       return rv;
     }
       }
       return base.Compare(x, y);
 }
开发者ID:nmaier,项目名称:simpleDLNA,代码行数:12,代码来源:DateComparer.cs

示例8: KFile

        public KFile( Kernel kernel, KDevice device, IMediaItem item )
        {
            Kernel = kernel;
            Device = device;
            Item = item;

            FolderOffset = 0;

            IsOpen = true;
            CanWrite = !( ( item.Attributes & MediaItemAttributes.ReadOnly ) == MediaItemAttributes.ReadOnly );
            CanSeek = false;
            IsValid = true;
        }
开发者ID:BradFuller,项目名称:pspplayer,代码行数:13,代码来源:KFile.cs

示例9: Compare

 public override int Compare(IMediaItem x, IMediaItem y)
 {
   if (x == null && y == null) {
     return 0;
     throw new ArgumentNullException("x");
   }
   if (x == null) {
     return 1;
   }
   if (y == null) {
     return -1;
   }
   return comparer.Compare(x.ToComparableTitle(), y.ToComparableTitle());
 }
开发者ID:modulexcite,项目名称:simpleDLNA,代码行数:14,代码来源:TitleComparer.cs

示例10: Compare

 public override int Compare(IMediaItem x, IMediaItem y)
 {
     if (x == null) {
     throw new ArgumentNullException("x");
       }
       if (y == null) {
     throw new ArgumentNullException("y");
       }
       ITitleComparable tx = x as ITitleComparable, ty = y as ITitleComparable;
       return comp.Compare(
     tx != null ? tx.ToComparableTitle() : x.Title.StemCompareBase(),
     ty != null ? ty.ToComparableTitle() : y.Title.StemCompareBase()
     );
 }
开发者ID:Rawrpwnzl,项目名称:simpleDLNA,代码行数:14,代码来源:TitleComparer.cs

示例11: RegisterPath

    private void RegisterPath(IMediaItem item)
    {
      var path = item.Path;
      string id;
      if (!paths.ContainsKey(path)) {
        while (ids.ContainsKey(id = idGen.Next(1000, int.MaxValue).ToString("X8"))) {
        }
        paths[path] = id;
      }
      else {
        id = paths[path];
      }
      ids[id] = new WeakReference(item);

      item.Id = id;
    }
开发者ID:modulexcite,项目名称:simpleDLNA,代码行数:16,代码来源:Identifiers.cs

示例12: PostStatusAsync

        public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
        {
            if (mediaItems == null)
                throw new ArgumentNullException(nameof(mediaItems));

            if (mediaItems.Length == 0)
                throw new ArgumentException("Err:Media not specified.");

            foreach (var item in mediaItems)
            {
                if (item == null)
                    throw new ArgumentException("Err:Media not specified.");

                if (!item.Exists)
                    throw new ArgumentException("Err:Media not found.");
            }

            await Task.Run(() => this.tw.PostStatusWithMultipleMedia(text, inReplyToStatusId, mediaItems))
                .ConfigureAwait(false);
        }
开发者ID:nezuku,项目名称:OpenTween,代码行数:20,代码来源:TwitterPhoto.cs

示例13: TryParseItem

        public bool TryParseItem(XElement element, out IMediaItem item)
        {
            item = null;
            if (element.Name != "video")
            {
                return false;
            }

            VideoItem videoItem = new VideoItem();
            item = videoItem;
            XItemParserMediaItem.ReadItem(videoItem, element);

            var audioTracks = (from ats in element.Elements("audioTracks")
                               from at in ats.Elements("audioTrack")
                               select new AudioTrack { Title = (string)at.Attribute("title") }).ToArray();

            for (int i = 0; i < audioTracks.Length; i++)
            {
                audioTracks[i].Index = i;
            }
            videoItem.AudioTracks = audioTracks;
            videoItem.ItemType = "Video";
            return true;
        }
开发者ID:Titaye,项目名称:SLExtensions,代码行数:24,代码来源:XItemParserVideo.cs

示例14: UploadMedia

        public string UploadMedia(IMediaItem item, ref long? mediaId)
        {
            if (MyCommon._endingFlag) return "";

            if (Twitter.AccountState != MyCommon.ACCOUNT_STATE.Valid) return "";

            HttpStatusCode res;
            var content = "";
            try
            {
                res = twCon.UploadMedia(item, ref content);
            }
            catch (Exception ex)
            {
                return "Err:" + ex.Message;
            }

            var err = this.CheckStatusCode(res, content);
            if (err != null) return err;

            TwitterUploadMediaResult status;
            try
            {
                status = TwitterUploadMediaResult.ParseJson(content);
            }
            catch (SerializationException ex)
            {
                MyCommon.TraceOut(ex.Message + Environment.NewLine + content);
                return "Err:Json Parse Error(DataContractJsonSerializer)";
            }
            catch (Exception ex)
            {
                MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content);
                return "Err:Invalid Json!";
            }

            mediaId = status.MediaId;
            return "";
        }
开发者ID:lltcggie,项目名称:OpenTween,代码行数:39,代码来源:Twitter.cs

示例15: PostStatusWithMedia

        public string PostStatusWithMedia(string postStr, long? reply_to, IMediaItem item)
        {
            if (MyCommon._endingFlag) return "";

            if (Twitter.AccountState != MyCommon.ACCOUNT_STATE.Valid) return "";

            HttpStatusCode res;
            var content = "";
            try
            {
                res = twCon.UpdateStatusWithMedia(postStr, reply_to, item, ref content);
            }
            catch(Exception ex)
            {
                return "Err:" + ex.Message;
            }

            // 投稿に成功していても404が返ることがあるらしい: https://dev.twitter.com/discussions/1213
            if (res == HttpStatusCode.NotFound) return "";

            var err = this.CheckStatusCode(res, content);
            if (err != null) return err;

            TwitterStatus status;
            try
            {
                status = TwitterStatus.ParseJson(content);
            }
            catch(SerializationException ex)
            {
                MyCommon.TraceOut(ex.Message + Environment.NewLine + content);
                return "Err:Json Parse Error(DataContractJsonSerializer)";
            }
            catch(Exception ex)
            {
                MyCommon.TraceOut(ex, MethodBase.GetCurrentMethod().Name + " " + content);
                return "Err:Invalid Json!";
            }
            _followersCount = status.User.FollowersCount;
            _friendsCount = status.User.FriendsCount;
            _statusesCount = status.User.StatusesCount;
            _location = status.User.Location;
            _bio = status.User.Description;

            if (IsPostRestricted(status))
            {
                return "OK:Delaying?";
            }
            return "";
        }
开发者ID:lltcggie,项目名称:OpenTween,代码行数:50,代码来源:Twitter.cs


注:本文中的IMediaItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。