예제 #1
0
        private DependencyProperty(string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, ValidateValueCallback validateValueCallback)
        {
            _name                  = name;
            _propertyType          = propertyType;
            _ownerType             = ownerType;
            _defaultMetadata       = defaultMetadata;
            _validateValueCallback = validateValueCallback;
            Flags flags = default(Flags);

            lock (Synchronized) {
                flags = (Flags)GetUniqueGlobalIndex(ownerType, name);
                RegisteredPropertyList.Add(this);
            }
            if (propertyType.IsValueType)
            {
                flags |= Flags.IsValueType;
            }
            if (propertyType == typeof(object))
            {
                flags |= Flags.IsObjectType;
            }
            if (typeof(Freezable).IsAssignableFrom(propertyType))
            {
                flags |= Flags.IsFreezableType;
            }
            if (propertyType == typeof(string))
            {
                flags |= Flags.IsStringType;
            }
            _packedData = flags;
        }
예제 #2
0
 internal static void RegisterInternal(LinqPropertyBase linqProperty)
 {
     RegisteredPropertyList.Add(linqProperty);
     linqProperty.BuildDependentPropertyChain();
 }
예제 #3
0
        //
        //  All table datastructures read-lock-free/write-lock
        //  AddEventDependent writes the datastructures, locks set by callers
        //
        //  This method
        //  1. Adds an EventDependent to the EventDependents list. This is used
        //     to lookup events in styles during event routing.
        //
        internal static void AddEventDependent(
            int                                     childIndex,
            EventHandlersStore                      eventHandlersStore,
            ref ItemStructList<ChildEventDependent> eventDependents)
        {
            if (eventHandlersStore != null)
            {
                Debug.Assert(childIndex >= 0);

                ChildEventDependent dependent = new ChildEventDependent();
                dependent.ChildIndex = childIndex;
                dependent.EventHandlersStore = eventHandlersStore;

                eventDependents.Add(ref dependent);
            }
        }