Exemple #1
0
 protected MessageMetadataBase(ICommentOptions options, IMirrativSiteOptions siteOptions)
 {
     _options                     = options;
     _siteOptions                 = siteOptions;
     options.PropertyChanged     += Options_PropertyChanged;
     siteOptions.PropertyChanged += SiteOptions_PropertyChanged;
 }
Exemple #2
0
        public MirrativCommentViewModel(ICommentOptions options, IMirrativSiteOptions siteOptions, Message message, bool isFirstComment, ICommentProvider commentProvider, IUser user)
            : base(options, user, commentProvider, isFirstComment)
        {
            MessageType  = message.Type;
            _siteOptions = siteOptions;
            Id           = message.Id;
            UserId       = message.UserId;
            PostTime     = Tools.UnixTime2DateTime(message.CreatedAt).ToString("HH:mm:ss");

            var name = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(message.Username)
            };

            user.Name = name;
            var comment = message.Comment;

            if (siteOptions.NeedAutoSubNickname && message.Type == MessageType.Comment)
            {
                var nick = ExtractNickname(comment);
                if (!string.IsNullOrEmpty(nick))
                {
                    user.Nickname = nick;
                }
            }
            NameItemsInternal = name;
            MessageItems      = new List <IMessagePart> {
                MessagePartFactory.CreateMessageText(comment)
            };

            Init();
        }
Exemple #3
0
        public ItemMessageMetadata(IMirrativItem item, ICommentOptions options, IMirrativSiteOptions siteOptions, IUser user, ICommentProvider cp)
            : base(options, siteOptions)
        {
            _item           = item;
            User            = user;
            CommentProvider = cp;

            user.PropertyChanged += User_PropertyChanged;
        }
Exemple #4
0
 public DummyImpl(IDataServer server, string input, ILogger logger, IMirrativSiteOptions siteOptions, MessageProvider2 p1, MetadataProvider2 p2)
 {
     _server      = server;
     _input       = input;
     _logger      = logger;
     _siteOptions = siteOptions;
     _p1          = p1;
     _p2          = p2;
 }
Exemple #5
0
 public MetadataProvider(IDataServer server, IMirrativSiteOptions siteOptions, string liveId)
 {
     _server      = server;
     _siteOptions = siteOptions;
     _liveId      = liveId;
 }
Exemple #6
0
        public CommentMessageMetadata(IMirrativComment comment, ICommentOptions options, IMirrativSiteOptions siteOptions, IUser user, ICommentProvider cp, bool isFirstComment)
            : base(options, siteOptions)
        {
            User            = user;
            CommentProvider = cp;
            _isFirstComment = isFirstComment;

            user.PropertyChanged += User_PropertyChanged;
        }
Exemple #7
0
 public JoinMessageMetadata(IMirrativJoinRoom join, ICommentOptions options, IMirrativSiteOptions siteOptions, IUser user, ICommentProvider cp)
     : base(options, siteOptions)
 {
     User            = user;
     CommentProvider = cp;
 }
Exemple #8
0
 protected internal DisconnectedMessageMetadata(IMirrativDisconnected disconnected, ICommentOptions options, IMirrativSiteOptions siteOptions)
     : base(options, siteOptions)
 {
 }
 public MetadataProvider2(IDataServer server, IMirrativSiteOptions siteOptions)
 {
     _server      = server;
     _siteOptions = siteOptions;
 }