Exemplo n.º 1
0
        protected void ChangeItemState(object param, CommunicationItemState state, bool isEditing)
        {
            if (param is CommunicationItemViewModel)
            {
                // if old state is  Appended we have no to change it
                if ((param as CommunicationItemViewModel).State == CommunicationItemState.Appended)
                {
                    //if old state is  Appended and new state Deleted then delete item
                    if (state == CommunicationItemState.Deleted)
                    {
                        Items.Remove((param as CommunicationItemViewModel));
                    }
                }
                else
                {
                    (param as CommunicationItemViewModel).State = state;
                }

                (param as CommunicationItemViewModel).IsEditing = isEditing;
                (param as CommunicationItemViewModel).RaiseCanExecuteChanged();

                if (state == CommunicationItemState.Deleted)
                {
                    RefreshItems();
                }
                if (isEditing)
                {
                    ItemsCollection.MoveCurrentTo(param as CommunicationItemViewModel);
                }

                OnPropertyChanged("OneItemInCommunicationIsInEditState");
            }
        }
Exemplo n.º 2
0
 public MockCommunicationItemsBuilder WithNotes(int count, CommunicationItemState state)
 {
     for (int i = 0; i < count; i++)
     {
         _mock.Add(MockCommunicationItemNoteBuilder.Build().WithState(state).GetMock());
     }
     return(this);
 }
 public MockCommunicationItemBuilder WithState(CommunicationItemState state)
 {
     _mock.State = state;
     return this;
 }
 public MockCommunicationItemsBuilder WithNotes(int count, CommunicationItemState state)
 {
     for (int i = 0; i < count; i++)
     {
         _mock.Add(MockCommunicationItemNoteBuilder.Build().WithState(state).GetMock());
     }
     return this;
 }
		public List<CommunicationItemViewModel> GetItemsByState(CommunicationItemState state)
		{
			return (Items != null) ? Items.Where((x) => x.State == state).ToList() : new List<CommunicationItemViewModel>();
		}
		protected void ChangeItemState(object param, CommunicationItemState state, bool isEditing)
		{
			if (param is CommunicationItemViewModel)
			{
				// if old state is  Appended we have no to change it
				if ((param as CommunicationItemViewModel).State == CommunicationItemState.Appended)
				{
					//if old state is  Appended and new state Deleted then delete item 
					if (state == CommunicationItemState.Deleted)
					{
						Items.Remove((param as CommunicationItemViewModel));
					 
					}
				}
				else
				{
					(param as CommunicationItemViewModel).State = state;
				}

				(param as CommunicationItemViewModel).IsEditing = isEditing;
				(param as CommunicationItemViewModel).RaiseCanExecuteChanged();
				
				if (state == CommunicationItemState.Deleted)
				{
					RefreshItems();
				}
				if (isEditing)
				{
					ItemsCollection.MoveCurrentTo(param as CommunicationItemViewModel);
				}

				OnPropertyChanged("OneItemInCommunicationIsInEditState");
			}
		}
Exemplo n.º 7
0
 public List <CommunicationItemViewModel> GetItemsByState(CommunicationItemState state)
 {
     return((Items != null) ? Items.Where((x) => x.State == state).ToList() : new List <CommunicationItemViewModel>());
 }
		public List<CommunicationAttachment> GetAttacmentsByState(CommunicationItemState state)
		{
			return Attachments != null ? Attachments.Where(x => x.State == state).ToList() : new List<CommunicationAttachment>();
		}
Exemplo n.º 9
0
 public MockCommunicationItemBuilder WithState(CommunicationItemState state)
 {
     _mock.State = state;
     return(this);
 }
Exemplo n.º 10
0
 public List <CommunicationAttachment> GetAttacmentsByState(CommunicationItemState state)
 {
     return(Attachments != null?Attachments.Where(x => x.State == state).ToList() : new List <CommunicationAttachment>());
 }