Example #1
0
 protected override void OnBeforeSave()
 {
     base.OnBeforeSave();
     if (base.IsNew)
     {
         if (Guid.Empty.Equals(this.ParentGroupClassId))
         {
             throw new NotSupportedException("A new Task group entry needs to have its ParentGroupClassId set.");
         }
         byte[] nodeBefore = null;
         if (this.parentGroup != null)
         {
             ReadOnlyCollection <TaskGroupEntryInfo> childTaskFolders = this.parentGroup.GetChildTaskFolders();
             if (childTaskFolders.Count > 0)
             {
                 nodeBefore = childTaskFolders[childTaskFolders.Count - 1].Ordinal;
             }
         }
         else
         {
             bool flag;
             nodeBefore = FolderTreeData.GetOrdinalValueOfFirstMatchingNode(base.MailboxSession, TaskGroupEntry.FindLastTaskFolderOrdinalSortOrder, (IStorePropertyBag row) => TaskGroup.IsFolderTreeData(row) && TaskGroup.IsTaskSection(row) && TaskGroup.IsTaskFolderInGroup(row, this.ParentGroupClassId), TaskGroup.TaskInfoProperties, out flag);
         }
         base.SetNodeOrdinalInternal(nodeBefore, null);
     }
 }