Beispiel #1
0
 private void ProcessRegistry(PersistenceState persistenceState)
 {
     foreach (var item in activeRegistry.GetItems(persistenceState))
     {
         if (IsPinned(item))
         {
             PinnedItems.Register(item);
         }
         else
         {
             PersistableItems.Register(item);
         }
     }
 }
Beispiel #2
0
        protected override async Task OnGetInternalAsync(SqlConnection connection)
        {
            UnestimatedItemCount = WorkItems.Where(wi => wi.EstimateHours == 0).Count();

            MyActivitySubscriptions = await new MyHandOffActivities()
            {
                OrgId = OrgId, UserId = UserId
            }.ExecuteAsync(connection);
            MyHandOffItems = await new OpenWorkItems(QueryTraces)
            {
                OrgId = OrgId, InMyActivities = true, ActivityUserId = UserId, IsPaused = true, AppId = CurrentOrgUser.CurrentAppId
            }.ExecuteAsync(connection);

            var itemIds     = MyHandOffItems.Select(wi => wi.Id).ToArray();
            var labelsInUse = await new LabelsInUse()
            {
                WorkItemIds = itemIds, OrgId = OrgId
            }.ExecuteAsync(connection);

            HandOffLabels = labelsInUse.ToLookup(row => row.WorkItemId);

            var comments = await new Comments()
            {
                OrgId = OrgId, ObjectIds = itemIds, ObjectType = ObjectType.WorkItem
            }.ExecuteAsync(connection);

            HandOffComments = comments.ToLookup(row => row.ObjectId);

            MySchedule = await new MyWorkSchedule()
            {
                OrgId = OrgId, UserId = UserId
            }.ExecuteAsync(connection);
            HiddenMilestones = await new HiddenMilestones()
            {
                OrgId = OrgId, UserId = UserId
            }.ExecuteAsync(connection);

            var pinnedItemQry = new OpenWorkItems()
            {
                OrgId = OrgId, MyPinnedItems = true, MyUserId = UserId
            };

            if (Options[Option.MyItemsFilterCurrentApp]?.BoolValue ?? true)
            {
                pinnedItemQry.AppId = CurrentOrgUser.EffectiveAppId;
            }
            UserIdFieldOption.Criteria.Invoke(pinnedItemQry, UserId);
            PinnedItems = await pinnedItemQry.ExecuteAsync(connection);

            var pinnedItemIds = PinnedItems.Select(wi => wi.Id).ToArray();
            var pinnedLabels  = await new LabelsInUse()
            {
                WorkItemIds = pinnedItemIds, OrgId = OrgId
            }.ExecuteAsync(connection);

            PinnedItemLabels = pinnedLabels.ToLookup(row => row.WorkItemId);

            var pinnedComments = await new Comments()
            {
                OrgId = OrgId, ObjectIds = pinnedItemIds, ObjectType = ObjectType.WorkItem
            }.ExecuteAsync(connection);

            PinnedComments = pinnedComments.ToLookup(row => row.ObjectId);
        }
 protected void Thumbs_Changed(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     PinnedItems.Dispatcher.Invoke(new Action(() => PinnedItems.UpdateLayout()));
 }