Esempio n. 1
0
        public MockCommunicationItemBuilder(CommunicationItemViewModel communocationItem)
        {
            _mock = communocationItem;
            var index = rnd.Next(titles.Length);

            _mock.Title = titles[index];
            _mock.Body  = bodyes[index];

            index            = rnd.Next(users.Length);
            _mock.AuthorName = users[index];
            _mock.AuthorId   = users[index];

            index              = rnd.Next(dates.Length);
            _mock.Created      = dates[index];
            _mock.LastModified = dates[index];

            for (int i = 0; i < 5; i++)
            {
                index = rnd.Next(attachments.Length * 2);
                if (index < attachments.Length)
                {
                    _mock.Attachments.Add(new CommunicationAttachment()
                    {
                        FileUrl = attachments[index], State = CommunicationItemState.NotModified, Url = index.ToString()
                    });
                }
            }
        }
 /// <summary>
 /// Определяет доступные комманды для полученного в параметре Item
 /// </summary>
 /// <param name="item">CommunicationItem для которого надо определить доступные комманды</param>
 /// <example>
 /// item.ItemCommands.Add(new CommunicationItemComands() { Icon = "Url", ToolTip = "Comment", Command = new DelegateCommand<object>(x => Func(x)) });
 /// </example>
 protected override void DefItemCommands(CommunicationItemViewModel item)
 {
     AviableEdit(item);
     AviablePost(item);
     if (item.State == CommunicationItemState.Appended)
     {
         AviableDelete(item);
     }
     AviableKnowledgeBase(item, "testBase");
 }
Esempio n. 3
0
        private bool RaiseNoteEditInteractionRequest(CommunicationItemViewModel itemVM, string title)
        {
            bool result = false;

            var confirmation = new ConditionalConfirmation(() => !string.IsNullOrEmpty(itemVM.Body));

            confirmation.Title   = title;
            confirmation.Content = itemVM;

            CommonConfirmRequest.Raise(confirmation, (x) =>
            {
                result = x.Confirmed;
            });

            return(result);
        }
Esempio n. 4
0
 /// <summary>
 /// Define available operations for given communication item
 /// Can add predefine such as AviableSelect, AviableEdit, AviableDelete.
 /// Can add any command (see example)
 /// </summary>
 /// <param name="item">CommunicationItem для которого надо определить доступные комманды</param>
 /// <example>
 /// item.ItemCommands.Add(new CommunicationItemComands() { Icon = "Url", ToolTip = "Comment", Command = new DelegateCommand<object>(x => Func(x)) });
 /// </example>
 protected override void DefItemCommands(CommunicationItemViewModel item)
 {
     AviableSelect(item);
     AviableEdit(item);
     AviableDelete(item);
 }
Esempio n. 5
0
 public MockCommunicationItemInboundCallBuilder(CommunicationItemViewModel communocationItem)
     : base(communocationItem)
 {
 }
Esempio n. 6
0
 public MockCommunicationItemNoteBuilder(CommunicationItemViewModel communocationItem)
     : base(communocationItem)
 {
 }