protected override void OnEntityChanged()
 {
     base.OnEntityChanged();
     allowEntityChange = false;
     if (!disableAttachedFilesReload)
     {
         FilesInfo = new ObservableCollection <AttachedFileInfo>();
         if (Entity != null && Entity.AttachedFiles != null)
         {
             foreach (var file in Entity.AttachedFiles)
             {
                 FilesInfo.Add(FilesHelper.GetAttachedFileInfo(file.Name, "", file.Id));
             }
         }
     }
     this.RaisePropertyChanged(vm => vm.ReminderTime);
     this.RaisePropertyChanged(vm => vm.Status);
     this.RaisePropertyChanged(vm => vm.Completion);
     EntityContextLookUpEmployees = this.UnitOfWork.Employees.AsEnumerable();
     if (Entity != null)
     {
         allowParameterChanged = false;
         AssignedEmployees     = Entity.AssignedEmployees;
         RtfTextDescription    = Entity.RtfTextDescription;
         Action rtfAction = () => {
             actualRtfTextDescription = RtfTextDescription;
             allowParameterChanged    = true;
         };
         Dispatcher.CurrentDispatcher.BeginInvoke(rtfAction);
         Logger.Log(string.Format("OutlookInspiredApp: Edit Task: {0}",
                                  string.IsNullOrEmpty(Entity.Subject) ? "<New>" : Entity.Subject));
     }
     allowEntityChange = true;
 }
        void AttachedFilesCore(string[] names)
        {
            bool     fileLengthExceed = false;
            FileInfo info;

            foreach (string name in names)
            {
                info = new FileInfo(name);
                if (info.Length > FilesHelper.MaxAttachedFileSize * 1050578)
                {
                    fileLengthExceed = true;
                }
                else
                {
                    FilesInfo.Add(FilesHelper.GetAttachedFileInfo(info.Name, info.DirectoryName));
                }
            }
            if (fileLengthExceed)
            {
                MessageBoxService.ShowMessage(string.Format("The size of one of the files exceeds {0} MB.", FilesHelper.MaxAttachedFileSize), "Error attaching files");
            }
            SetCollectionChange();
            Update();
        }