コード例 #1
0
 public RAMLDocGeneratorV08(IApiDescriptionGroupCollectionProvider apiDescription, IParameterConverter parameterConverter, IMethodConverter methodConverter, IComments comments)
 {
     this.apiDescription     = apiDescription;
     this.parameterConverter = parameterConverter;
     this.methodConverter    = methodConverter;
     this.comments           = comments;
 }
コード例 #2
0
        public virtual void TranslateComments(IComments comments)
        {
            List <IComment> nonDocCom           = new List <IComment>();
            List <IDocumentationComment> docCom = new List <IDocumentationComment>();

            foreach (IComment ic in comments)
            {
                if (ic is IDocumentationComment)
                {
                    docCom.Add((IDocumentationComment)ic);
                }
                else
                {
                    nonDocCom.Add(ic);
                }
            }

            nonDocCom.AddRange(docCom.ToArray());
            docCom.Clear();
            docCom = null;

            foreach (IComment icom in docCom)
            {
                TranslateComment(icom);
            }
        }
コード例 #3
0
 /// <summary>
 /// Get comment
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='commentHandle'>
 /// Comment handle
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CommentView> GetCommentAsync(this IComments operations, string commentHandle, string authorization, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetCommentWithHttpMessagesAsync(commentHandle, authorization, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #4
0
        public Comments_Clean(IComments comments)
        {
            _Comments = comments ?? new Comments();

            _Comments.Comment = _Comments.Comment ?? string.Empty;
            ((IComments)this).CopyFrom(comments);
        }
コード例 #5
0
 internal void Init(IComments view, bool IsPostBack)
 {
     _view = view;
     //if (_webContext.CurrentUser != null)
     //    _view.ShowViewComment(true);
     //else
     //    _view.ShowViewComment(false);
 }
 public static void CopyFrom(this IComments to, IComments from)
 {
     to.Comment  = from.Comment;
     to.CUnique  = from.CUnique;
     to.FileNo   = from.FileNo;
     to.LineNo   = from.LineNo;
     to.RecordNo = from.RecordNo;
 }
コード例 #7
0
 public NewsController()
 {
     artSer      = new NewsService();
     arrticles   = new ArticleService();
     artgamesSer = new ServiceGames();
     commSer     = new comenttService();
     users       = new UserService();
 }
コード例 #8
0
 public WorksController(IGenres serv, IWorks serv1, IUsers serv2, IComments serv3, IRatings serv4)
 {
     commentServ = serv3;
     userServ    = serv2;
     workServ    = serv1;
     genreServ   = serv;
     ratingServ  = serv4;
 }
コード例 #9
0
 public GameController()
 {
     artSer    = new ServiceGames();
     commSer   = new comenttService();
     users     = new UserService();
     arrticles = new ArticleService();
     newws     = new NewsService();
     rate      = new ratingService();
 }
コード例 #10
0
        public ParameterConverterV10(IComments comments) : base()
        {
            var date = "datetime";

            typeMap[typeof(DateTime).FullName]  = date;
            typeMap[typeof(DateTime?).FullName] = date;
            typeMap.Add(typeof(object).FullName, "object");
            this.comments = comments;
        }
コード例 #11
0
ファイル: ID3v2ViewModel.cs プロジェクト: superowner/IdSharp
        private void OnSaveFile()
        {
            _id3v2.Artist            = Artist;
            _id3v2.Title             = Title;
            _id3v2.Album             = Album;
            _id3v2.Genre             = Genre;
            _id3v2.Year              = Year;
            _id3v2.TrackNumber       = Track;
            _id3v2.Header.TagVersion = ID3v2Version.Value;

            List <IAttachedPicture> deleteList = new List <IAttachedPicture>(_id3v2.PictureList);

            foreach (var picture in PictureCollection)
            {
                if (picture.AttachedPicture != null)
                {
                    picture.AttachedPicture.Description = picture.Description;
                    picture.AttachedPicture.PictureType = picture.PictureType;
                    deleteList.Remove(picture.AttachedPicture);
                }
                else
                {
                    IAttachedPicture apic = _id3v2.PictureList.AddNew();
                    apic.Description = picture.Description;
                    apic.PictureType = picture.PictureType;
                    apic.PictureData = picture.PictureBytes;
                }
            }

            foreach (var deletePicture in deleteList)
            {
                _id3v2.PictureList.Remove(deletePicture);
            }

            IComments comments = _id3v2.CommentsList.FirstOrDefault();

            if (!string.IsNullOrWhiteSpace(Comment))
            {
                if (comments == null)
                {
                    comments = _id3v2.CommentsList.AddNew();
                }
                comments.Value = Comment;
            }
            else
            {
                if (comments != null)
                {
                    _id3v2.CommentsList.Remove(comments);
                }
            }

            // TODO: Multiple comments

            _id3v2.Save(_fullFileName);
        }
コード例 #12
0
 public static int InventoryUnique_File135(IComments record)
 {
     if (record.FileNo == 135)
     {
         return(record.RecordNo);
     }
     else
     {
         return(0);
     }
 }
コード例 #13
0
ファイル: CommentPresenter.cs プロジェクト: ngocpq/MHX2
 public void Init(IComments view, bool IsPostBack)
 {
     _view = view;
     bool IsLogin = _userSession.LoggedIn;
     if (!IsLogin)
     {
         //TODO:Hien thong bao chua dang nhap khong the gui comment
     }
     if (_webContext.CurrentUser != null)
         _view.ShowCommentBox(true);
     else
         _view.ShowCommentBox(false);
 }
コード例 #14
0
        private async void LikeSetter(IComments commentItem)
        {
            if (!commentItem.Like)
            {
                var likeCount = await HttpRequest.LikeComment(commentItem.ID, LinkNews, LikeType.Like);

                commentItem.LikeCount = likeCount;
                commentItem.Like      = true;
            }
            else
            {
                var likeCount = await HttpRequest.LikeComment(commentItem.ID, LinkNews, LikeType.UnLike);

                commentItem.LikeCount = likeCount;
                commentItem.Like      = false;
            }
        }
コード例 #15
0
        public void Init(IComments view, bool IsPostBack)
        {
            _view = view;
            bool IsLogin = _userSession.LoggedIn;

            if (!IsLogin)
            {
                //TODO:Hien thong bao chua dang nhap khong the gui comment
            }
            if (_webContext.CurrentUser != null)
            {
                _view.ShowCommentBox(true);
            }
            else
            {
                _view.ShowCommentBox(false);
            }
        }
コード例 #16
0
 public ImageController(IDatabaseRepository <UserImages> userimages,
                        IJsonCache <UserImages> cacheimage,
                        IDatabaseRepository <Vote> databasevote,
                        IDatabaseRepository <Comments> databasecomment,
                        IDatabaseRepository <Category> categoryrepository,
                        IJsonCache <Category> categorycache,
                        IVote updatevote,
                        IUserImages user,
                        IComments comments)
 {
     this.userimages         = userimages;
     this.cacheimage         = cacheimage;
     this.databasevote       = databasevote;
     this.updatevote         = updatevote;
     this.comments           = comments;
     this.databasecomment    = databasecomment;
     this.categoryrepository = categoryrepository;
     this.categorycache      = categorycache;
     this.user = user;
 }
コード例 #17
0
        public CommentsModule(IBarCodes barCodes, IComments comments,
                              IUsers users, IEventLog eventLog, IGravatarService gravatarService) : base("/Comment")
        {
            this.RequiresAuthentication();

            this.barCodes        = barCodes;
            this.comments        = comments;
            this.users           = users;
            this.eventLog        = eventLog;
            this.gravatarService = gravatarService;

            Get["/{id}"] = x =>
            {
                if (!this.barCodes.Exists(x.id))
                {
                    return(Response.AsJson(Enumerable.Empty <Comment>()));
                }

                IEnumerable <Comment> commentsForBarCode = this.comments.GetCommentsForBarCode(x.id);
                Comment[]             ret =
                    this.gravatarService.AddAvatarToComments(commentsForBarCode).ToArray();
                return(Response.AsJson(ret));
            };

            Post["/{id}"] = x =>
            {
                if (!this.barCodes.Exists(x.id))
                {
                    return(Response.AsJson(Enumerable.Empty <Comment>()));
                }

                Comment comment = this.Bind <Comment>();
                comment.Author = this.users.GetIdByUsername(this.Context.CurrentUser.UserName);

                this.comments.Add(comment);
                Comment[] commentsForBarCode = this.comments.GetCommentsForBarCode(x.id).ToArray();
                this.Log(x.id, comment.Author, "COMMENT", comment.Text);
                return(Response.AsJson(commentsForBarCode));
            };
        }
コード例 #18
0
        public static bool LoadFromReader_Ext(this IComments comments, OdbcDataReader reader)
        {
            bool loadSucceeded;

            try
            {
                // example for how to trap nulls by extending the types. See OdbcDataReaderExtensions
                //altSuply./*EndDate*/ = (DateTime)(reader["EndDate"]).CDbNull(new DateTime(1000, 1, 1));
                comments.CUnique  = (Int32)reader["CUnique"];
                comments.Comment  = (string)reader["Comment"];
                comments.FileNo   = (Int16)reader["FileNo"];
                comments.LineNo   = (Int16)reader["LineNo"];
                comments.RecordNo = (Int32)reader["RecordNo"];

                loadSucceeded = true;
            }
            catch
            {
                loadSucceeded = false;
            }
            return(loadSucceeded);
        }
コード例 #19
0
        public CommentsModule(IBarCodes barCodes, IComments comments, 
            IUsers users, IEventLog eventLog, IGravatarService gravatarService)
            : base("/Comment")
        {
            this.RequiresAuthentication();

            this.barCodes = barCodes;
            this.comments = comments;
            this.users = users;
            this.eventLog = eventLog;
            this.gravatarService = gravatarService;

            Get["/{id}"] = x =>
                               {
                                   if (!this.barCodes.Exists(x.id))
                                       return Response.AsJson(Enumerable.Empty<Comment>());

                                   IEnumerable<Comment> commentsForBarCode = this.comments.GetCommentsForBarCode(x.id);
                                   Comment[] ret =
                                       this.gravatarService.AddAvatarToComments(commentsForBarCode).ToArray();
                                   return Response.AsJson(ret);
                               };

            Post["/{id}"] = x =>
                                {
                                    if (!this.barCodes.Exists(x.id))
                                        return Response.AsJson(Enumerable.Empty<Comment>());

                                    Comment comment = this.Bind<Comment>();
                                    comment.Author = this.users.GetIdByUsername(this.Context.CurrentUser.UserName);

                                    this.comments.Add(comment);
                                    Comment[] commentsForBarCode = this.comments.GetCommentsForBarCode(x.id).ToArray();
                                    this.Log(x.id, comment.Author, "COMMENT", comment.Text);
                                    return Response.AsJson(commentsForBarCode);
                                };
        }
コード例 #20
0
 public MethodConverterV10(IParameterConverter parameterConverter, IComments comments) : base(parameterConverter, comments)
 {
 }
コード例 #21
0
 public CommentsController(ApplicationDbContext context, IMapper mapper)
 {
     _commentsDomain = new CommentsRepository(context, mapper);
 }
コード例 #22
0
 public CommentsBLL() : base(typeName)
 {
     iComments = (IComments)idal;
 }
コード例 #23
0
 /// <summary>
 /// Get comment
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='commentHandle'>
 /// Comment handle
 /// </param>
 /// <param name='authorization'>
 /// Format is: "Scheme CredentialsList". Possible values are:
 ///
 /// - Anon AK=AppKey
 ///
 /// - SocialPlus TK=SessionToken
 ///
 /// - Facebook AK=AppKey|TK=AccessToken
 ///
 /// - Google AK=AppKey|TK=AccessToken
 ///
 /// - Twitter AK=AppKey|RT=RequestToken|TK=AccessToken
 ///
 /// - Microsoft AK=AppKey|TK=AccessToken
 ///
 /// - AADS2S AK=AppKey|[UH=UserHandle]|TK=AADToken
 /// </param>
 public static CommentView GetComment(this IComments operations, string commentHandle, string authorization)
 {
     return(Task.Factory.StartNew(s => ((IComments)s).GetCommentAsync(commentHandle, authorization), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
コード例 #24
0
 public MethodConverterV08(IParameterConverter parameterConverter, IComments comments)
 {
     this.parameterConverter = parameterConverter;
     this.comments           = comments;
 }
コード例 #25
0
 public CommentController()
 {
     commSer = new comenttService();
 }
コード例 #26
0
 public static bool LoadFromReader(this IComments comments, OdbcDataReader reader)
 {
     return(comments.LoadFromReader_Ext(reader));
 }
コード例 #27
0
 public CommentsController(IComments comments, ILogger <CommentsController> logger)
 {
     this.comments = comments;
     this.logger   = logger;
 }
コード例 #28
0
 public Comments()
 {
     dal = DataAccess.CreateComments();
 }
コード例 #29
0
 public ComntsViewComponent(IComments comnt, ApplicationDbContext db)
 {
     this.comnt = comnt;
     this.db    = db;
 }
コード例 #30
0
 public RAMLDocGeneratorV10(IApiDescriptionGroupCollectionProvider apiDescription, IParameterConverter parameterConverter, IMethodConverter methodConverter, IComments comments)
     : base(apiDescription, parameterConverter, methodConverter, comments)
 {
 }
コード例 #31
0
 public CommentsController(IComments context)
 {
     _context = context;
 }
コード例 #32
0
 public CommentaryController(IComments comments)
 {
     this.comments = comments;
 }
コード例 #33
0
 private async void LikeSetter(IComments commentItem)
 {
     if (!commentItem.Like)
     {
         var likeCount = await HttpRequest.LikeComment(commentItem.ID, LinkNews, LikeType.Like);
         commentItem.LikeCount = likeCount;
         commentItem.Like = true;
     }
     else
     {
         var likeCount = await HttpRequest.LikeComment(commentItem.ID, LinkNews, LikeType.UnLike);
         commentItem.LikeCount = likeCount;
         commentItem.Like = false;
     }
 }