System.Windows.DependencyProperty.LookupInternal C# (CSharp) Method

LookupInternal() private static method

private static LookupInternal ( Kind declaring_kind, string name, Type property_type, bool create, DependencyProperty &property ) : bool
declaring_kind Kind
name string
property_type Type
create bool
property DependencyProperty
return bool
        private static bool LookupInternal(Kind declaring_kind, string name, Type property_type, bool create, out DependencyProperty property)
        {
            IntPtr handle;

            if (name == null)
                throw new ArgumentNullException ("name");

            if (create && property_type == null)
                throw new ArgumentNullException ("property_type");

            if (declaring_kind == Kind.INVALID)
                throw new ArgumentOutOfRangeException ("declaring_kind");

            if (property_type != null)
                Deployment.Current.Types.Find (property_type);

            handle = NativeMethods.dependency_property_get_dependency_property_full (declaring_kind, name, true);

            if (handle == IntPtr.Zero) {
                property = null;
                return false;
            }
            if (properties.TryGetValue (handle, out property))
                return true;

            if (create) {
                property = new CoreDependencyProperty (handle, name, property_type, Deployment.Current.Types.KindToType (declaring_kind));
            }

            return property != null;
        }