public PullRequestListViewModelDesigner()
        {
            var prs = new TrackingCollection <IPullRequestModel>(Observable.Empty <IPullRequestModel>());

            prs.Add(new PullRequestModel(399, "Let's try doing this differently",
                                         new AccountDesigner {
                Login = "******", IsUser = true
            },
                                         DateTimeOffset.Now - TimeSpan.FromDays(1))
            {
                Assignee = new AccountDesigner {
                    Login = "******", IsUser = true
                },
            });
            prs.Add(new PullRequestModel(389, "Build system upgrade",
                                         new AccountDesigner {
                Login = "******", IsUser = true
            },
                                         DateTimeOffset.Now - TimeSpan.FromMinutes(2))
            {
                CommentCount   = 4,
                HasNewComments = false,
                Assignee       = new AccountDesigner {
                    Login = "******", IsUser = true
                },
            });
            prs.Add(new PullRequestModel(409, "Fix publish button style and a really, really long name for this thing... OMG look how long this name is yusssss",
                                         new AccountDesigner {
                Login = "******", IsUser = true
            },
                                         DateTimeOffset.Now - TimeSpan.FromHours(5))
            {
                CommentCount   = 27,
                HasNewComments = true,
                Assignee       = new AccountDesigner {
                    Login = "******", IsUser = true
                },
            });
            PullRequests = prs;

            States = new List <PullRequestState> {
                new PullRequestState {
                    IsOpen = true, Name = "Open"
                },
                new PullRequestState {
                    IsOpen = false, Name = "Closed"
                },
                new PullRequestState {
                    Name = "All"
                }
            };
            SelectedState    = States[0];
            Assignees        = new ObservableCollection <IAccount>(prs.Select(x => x.Assignee));
            Authors          = new ObservableCollection <IAccount>(prs.Select(x => x.Author));
            SelectedAssignee = Assignees.ElementAt(1);
            SelectedAuthor   = Authors.ElementAt(1);

            IsLoaded = true;
        }
Beispiel #2
0
        /// <summary>
        /// Plays right away the animation with the specified name, instantly removing all other blended animations.
        /// </summary>
        /// <param name="name">The animation name.</param>
        public PlayingAnimation Play(string name)
        {
            playingAnimations.Clear();
            var playingAnimation = new PlayingAnimation(name, Animations[name])
            {
                CurrentTime = TimeSpan.Zero, Weight = 1.0f
            };

            playingAnimations.Add(playingAnimation);
            return(playingAnimation);
        }
		public void Should_not_raise_event_once_handler_detached() {
			var addedItems = new List<string>();
			var items = new TrackingCollection<string>();
			
			using(items.OnItemAdded(addedItems.Add)) {
				items.Add("foo");
			}
			items.Add("bar");

			addedItems.Count.ShouldEqual(1);
		}
Beispiel #4
0
        public void Should_not_raise_event_once_handler_detached()
        {
            var addedItems = new List <string>();
            var items      = new TrackingCollection <string>();

            using (items.OnItemAdded(addedItems.Add)) {
                items.Add("foo");
            }
            items.Add("bar");

            addedItems.Count.ShouldEqual(1);
        }
Beispiel #5
0
        public void Add_AddsItem()
        {
            var items = new TrackingCollection <string>();

            items.Add("foo");
            items.Single().ShouldEqual("foo");
        }
		public void When_Item_Added_Raises_ItemAdded() {
			string addedItem = null;
			var items = new TrackingCollection<string>();

			using(items.OnItemAdded(x => addedItem = x)) {
				items.Add("foo");
			}

			addedItem.ShouldEqual("foo");
		}
Beispiel #7
0
        public void When_Item_Added_Raises_ItemAdded()
        {
            string addedItem = null;
            var    items     = new TrackingCollection <string>();

            using (items.OnItemAdded(x => addedItem = x)) {
                items.Add("foo");
            }

            addedItem.ShouldEqual("foo");
        }
Beispiel #8
0
        /// <inheritdoc />
        public IRemovingComponentRuleBuilderOptions <TValidatedType, TProperty> RemoveRule <TProperty> (
            Expression <Func <TValidatedType, TProperty> > propertySelector)
        {
            ArgumentUtility.CheckNotNull("propertySelector", propertySelector);

            var componentPropertyRule = RemovingComponentPropertyRule.Create(propertySelector, GetType());

            _removedPropertyRules.Add(componentPropertyRule);

            return(new RemovingComponentRuleBuilder <TValidatedType, TProperty> (componentPropertyRule));
        }
Beispiel #9
0
        /// <inheritdoc />
        public IAddingComponentRuleBuilderOptions <TValidatedType, TProperty> AddRule <TProperty> (
            Expression <Func <TValidatedType, TProperty> > propertySelector)
        {
            ArgumentUtility.CheckNotNull("propertySelector", propertySelector);

            var componentPropertyRule = AddingComponentPropertyRule.Create(propertySelector, GetType());

            _addedPropertyRules.Add(componentPropertyRule);

            var metaValidationPropertyRule = AddingComponentPropertyMetaValidationRule.Create(propertySelector, GetType());

            _addedPropertyMetaValidationRules.Add(metaValidationPropertyRule);

            return(new AddingComponentRuleBuilder <TValidatedType, TProperty> (componentPropertyRule, metaValidationPropertyRule));
        }
Beispiel #10
0
        internal TrackingCollection GetTrackingsFor(string entryId, DataManager data)
        {
            Load(data);
            TrackingCollection filtered = new TrackingCollection();

            foreach (Tracking c in Trackings)
            {
                if (c.TargetEntryId.ToUpper() == entryId.ToUpper())
                {
                    filtered.Add(c);
                }
            }
            return filtered;
        }
Beispiel #11
0
 public static void AddTracking <T>(TrackingCollection <T> collection, T item, out TrackingCollection <T> collectionOut, out T itemOut)
 {
     collection.Add(item);
     collectionOut = collection;
     itemOut       = item;
 }
Beispiel #12
0
 public void AddColliderShape(IInlineColliderShapeDesc colliderShape)
 {
     PhysicsComponentColliderShapes.Add(colliderShape);
     ColliderShapes.Add(colliderShape);
 }
		public void Add_AddsItem() {
			var items = new TrackingCollection<string>();
			items.Add("foo");
			items.Single().ShouldEqual("foo");
		}
 public void AddingItemsToCollectionManuallyThrows()
 {
     var col = new TrackingCollection<Thing>(Observable.Empty<Thing>());
     Assert.Throws<InvalidOperationException>(() => col.Add(GetThing(1)));
     col.Dispose();
 }
Beispiel #15
0
        TrackingCollection IBlogDataService.GetTrackingsFor(string entryId)
        {
            TrackingCollection trackingsForEntry = new TrackingCollection();
            DateTime date = GetDateForEntry(entryId);
            if (date == DateTime.MinValue)
                return trackingsForEntry;

            DayExtra extra = data.GetDayExtra(date);
            foreach (Tracking trk in extra.Trackings)
            {
                if (trk.TargetEntryId.ToUpper() == entryId.ToUpper())
                {
                    trackingsForEntry.Add(trk);
                }
            }
            return trackingsForEntry;
        }
Beispiel #16
0
 /// <summary>
 /// Adds a rule to the current validator.
 /// </summary>
 /// <param name="rule"></param>
 public void AddRule(IValidationRule rule)
 {
     nestedValidators.Add(rule);
 }
Beispiel #17
0
 public static void AddEnity(TrackingCollection <Entity> collection, Entity item, out TrackingCollection <Entity> collectionOut, out Entity itemOut)
 {
     collection.Add(item);
     collectionOut = collection;
     itemOut       = item;
 }