Ejemplo n.º 1
0
        protected CategoryMembershipProperty TagSignal(Signal signal, ECategoryMembership membership, bool sticky)
        {
            CategoryMembershipProperty property = new CategoryMembershipProperty(this, membership, sticky);

            signal.Properties.AddProperty(property);
            return(property);
        }
        public override bool Equals(Property other)
        {
            CategoryMembershipProperty cmp = other as CategoryMembershipProperty;

            if (cmp == null)
            {
                return(false);
            }
            return(_propertyId.Equals(cmp._propertyId) && _isSticky == cmp._isSticky &&
                   _category.Equals(cmp._category) && _categoryMembership.Equals(cmp._categoryMembership));
        }
Ejemplo n.º 3
0
        protected bool TryGetCachedMembership(Signal signal, out ECategoryMembership membership)
        {
            Property p;

            if (signal.Properties.TryLookupProperty(AssociatedPropertyIdentifier, out p))
            {
                CategoryMembershipProperty property = p as CategoryMembershipProperty;
                if (property != null)
                {
                    membership = property.CategoryMembership;
                    return(true);
                }
            }
            membership = ECategoryMembership.Unknown;
            return(false);
        }