コード例 #1
0
        /// <summary>
        /// Removes a child from this composite.
        /// </summary>
        /// <param name="child">The child to remove.</param>
        /// <returns>True if the child was present to be removed, otherwise false.</returns>
        public bool Remove(ObservableComposite <T> child)
        {
            if (currentChildren.Remove(child))
            {
                child.Remove();
                return(true);
            }

            return(false);
        }
コード例 #2
0
            public (ObservableComposite <int>, BehaviorSubject <int>) Add(ObservableComposite <int> parent, int initialValue)
            {
                var subject = new BehaviorSubject <int>(initialValue);

                subjectId++;
                var child = new ObservableComposite <int>(subject, (k, v) =>
                {
                    subjectMonitor[$"Composite {subjectId}:{k}"] = v;
                });

                parent?.Add(child);
                return(child, subject);
            }
コード例 #3
0
 /// <summary>
 /// Adds a child to this composite.
 /// </summary>
 /// <param name="child">The child to add.</param>
 public void Add(ObservableComposite <T> child)
 {
     currentChildren.Add(child);
     children.OnNext(child);
 }