Esempio n. 1
0
        public void AddedHandler_HandleMessage_DeserializsAndCallsCollectionManager()
        {
            var connectionMock = new Mock<IDdpConnectionSender>();
            var collectionMock = new Mock<ICollectionManager>();
            var resultHandlerMock = new Mock<IResultHandler>();

            var testObject = new SimpleDdpObject {IsTrue = false};
            var added = new Added {Collection = "Tests", Fields = JObject.FromObject(testObject),Id = "1"};

            var handler = new AddedHandler();

            handler.HandleMessage(connectionMock.Object, collectionMock.Object, resultHandlerMock.Object,
                JsonConvert.SerializeObject(added));

            collectionMock.Verify(collection => collection.Added(It.IsAny<Added>()), Times.Once());
        }
Esempio n. 2
0
 private void addExecute()
 {
     parent.MiscCosts.Add(ToAdd);
     Added?.Invoke(ToAdd);
 }
Esempio n. 3
0
 void Track_Add() => Added?.Invoke(_track.ParentIndex.Value + 1);
Esempio n. 4
0
 protected void Device_Add(Type device) => Added?.Invoke(_device.ParentIndex.Value + 1, device);
Esempio n. 5
0
 private void OnAdded(ValueAddedEventArgs args)
 {
     Added?.Invoke(this, args, Context);
 }
 public void Add <T>(T entity) where T : class
 {
     Added.Add(entity);
 }
Esempio n. 7
0
 private void DoAddProp(IProp prop)
 {
     Added?.Invoke(this, new PropStoreEventArgs(new[] { prop }));
 }
 public void IncludeAddedChange(IDependencyModel model)
 {
     Added.Add(model);
 }
Esempio n. 9
0
 protected virtual void OnAdded(TKey key, TValue value)
 {
     Added?.Invoke(key, value);
 }
Esempio n. 10
0
 protected virtual void OnGameSystemAdded(GameSystem gameSystem)
 {
     Added?.Invoke(gameSystem);
 }
Esempio n. 11
0
        /// <summary>
        /// Run the diff operation. Until this is called, all lists will be empty
        /// </summary>
        /// <returns>true if anything is different between index, tree, and workdir</returns>
        public bool Diff()
        {
            DirectoryInfo root    = _index.Repository.WorkingDirectory;
            var           visitor = new AbstractIndexTreeVisitor
            {
                VisitEntry = delegate(TreeEntry treeEntry, GitIndex.Entry indexEntry, FileInfo file)
                {
                    if (treeEntry == null)
                    {
                        Added.Add(indexEntry.Name);
                        _anyChanges = true;
                    }
                    else if (indexEntry == null)
                    {
                        if (!(treeEntry is Tree))
                        {
                            Removed.Add(treeEntry.FullName);
                        }
                        _anyChanges = true;
                    }
                    else
                    {
                        if (!treeEntry.Id.Equals(indexEntry.ObjectId))
                        {
                            Changed.Add(indexEntry.Name);
                            _anyChanges = true;
                        }
                    }

                    if (indexEntry != null)
                    {
                        if (!file.Exists)
                        {
                            Missing.Add(indexEntry.Name);
                            _anyChanges = true;
                        }
                        else
                        {
                            if (indexEntry.IsModified(root, true))
                            {
                                Modified.Add(indexEntry.Name);
                                _anyChanges = true;
                            }
                        }
                    }

                    if (indexEntry != null)
                    {
                        if (indexEntry.Stage != 0)
                        {
                            MergeConflict.Add(indexEntry.Name);
                            _anyChanges = true;
                        }
                    }
                }
            };

            new IndexTreeWalker(_index, _tree, root, visitor).Walk();

            CheckUntrackedDirectory(root.FullName, string.Empty);

            return(_anyChanges);
        }
Esempio n. 12
0
 protected virtual void OnAdded(ClinicAddedEventArgs e)
 {
     Added?.Invoke(this, e);
 }
Esempio n. 13
0
 public void Add(Key k, Value v)
 {
     elements.Add(k, v);
     Added?.Invoke(k, v);
 }
Esempio n. 14
0
 public void Add(object content)
 {
     Added.Add(content.ToString());
 }
Esempio n. 15
0
 public void ExcludeAddedChange(IDependencyModel model)
 {
     Added.Remove(model);
 }
Esempio n. 16
0
        private void DoAdded(params TSectorEntity[] entities)
        {
            var args = new ManagerItemsChangedEventArgs <TSectorEntity>(entities);

            Added?.Invoke(this, args);
        }
 /// <summary>
 /// Raises the Added event with the specified arguments.
 /// </summary>
 /// <param name="expression">Expression found in the cache.</param>
 /// <param name="delegate">Compiled delegate of the expression.</param>
 protected virtual void OnAdded(LambdaExpression expression, Delegate @delegate) => Added?.Invoke(this, new CacheEventArgs(expression, @delegate));
Esempio n. 18
0
 protected virtual void OnAdded(T item)
 {
     Added?.Invoke(this, item);
 }
Esempio n. 19
0
        /// <summary>
        /// Add new collision
        /// </summary>
        /// <param name="polygon"></param>
        public void Add(Polygon polygon)
        {
            Polygons.Add(polygon);

            Added?.Invoke(this, new AddedArgs(polygon, typeof(Light)));
        }
Esempio n. 20
0
 void AddContextMenu_Action(string action) => Added?.Invoke(Assembly.GetExecutingAssembly().GetType($"Apollo.Devices.{action.Replace(" ", "")}"));
Esempio n. 21
0
 void Given(Added e) => Value   += e.Value;
 public void DispatchAddEvent()
 {
     Added?.Invoke(this);
 }
Esempio n. 23
0
 public override string ToString()
 {
     return(Added.ToString("d") + ": " + Title + GetChanges());
 }
Esempio n. 24
0
 /// <summary>
 /// Method to raise the added item event.
 /// </summary>
 /// <typeparam name="T">The <see cref="Type"/> of the <see cref="object"/></typeparam>
 /// <param name="entity">The new entity to paste into the event <see cref="EntityChangesEventArgs"/></param>
 protected void NotifyAdded <T>(T entity) where T : class
 {
     Added?.Invoke(this, new EntityChangesEventArgs(entity));
 }
Esempio n. 25
0
 public bool Expired()
 {
     return((Added.Add(Expiry)) < DateTime.Now);
 }
Esempio n. 26
0
 protected void InvokeAdded() => Added?.Invoke();
Esempio n. 27
0
 public override string ToString()
 {
     return($"Added: {Added.ToCommaSeperatedList()} - Removed: {Removed.ToCommaSeperatedList()}");
 }
Esempio n. 28
0
 public override string ToString()
 {
     return(string.Format("Added {0} items to and removed {1} items from '{2}'", Added.Count(), Removed.Count(), Property.Name));
 }
Esempio n. 29
0
 protected virtual void OnAdded(EventArgs ea) => Added?.Invoke(this, ea);
Esempio n. 30
0
 public TEntity Add <TEntity>(TEntity entity)
 {
     Added?.Invoke(entity);
     return(entity);
 }
Esempio n. 31
0
 internal new  void Add(IEvent Item)
 {
     base.Add(Item);
     Added.Add(Item);
 }