// Token: 0x060015E4 RID: 5604 RVA: 0x0006AECC File Offset: 0x000690CC
        private static XamlMember FindKnownMember(WpfXamlType wpfXamlType, string name, bool isAttachable)
        {
            XamlMember xamlMember = null;

            if (!isAttachable || wpfXamlType.IsBamlScenario)
            {
                if (wpfXamlType._members != null && wpfXamlType.Members.TryGetValue(name, out xamlMember))
                {
                    return(xamlMember);
                }
            }
            else if (wpfXamlType._attachableMembers != null && wpfXamlType.AttachableMembers.TryGetValue(name, out xamlMember))
            {
                return(xamlMember);
            }
            WpfKnownType wpfKnownType = wpfXamlType as WpfKnownType;

            if (wpfKnownType != null)
            {
                if (!isAttachable || wpfXamlType.IsBamlScenario)
                {
                    xamlMember = System.Windows.Markup.XamlReader.BamlSharedSchemaContext.CreateKnownMember(wpfXamlType.Name, name);
                }
                if (isAttachable || (xamlMember == null && wpfXamlType.IsBamlScenario))
                {
                    xamlMember = System.Windows.Markup.XamlReader.BamlSharedSchemaContext.CreateKnownAttachableMember(wpfXamlType.Name, name);
                }
                if (xamlMember != null)
                {
                    return(wpfKnownType.CacheAndReturnXamlMember(xamlMember));
                }
            }
            return(null);
        }
Exemplo n.º 2
0
        // First try looking at the cache
        // Then look to see if we have a known property on the type
        private static XamlMember FindKnownMember(WpfXamlType wpfXamlType, string name, bool isAttachable)
        {
            XamlMember xamlMember = null;

            // Look in the cache first
            if (!isAttachable || wpfXamlType.IsBamlScenario)
            {
                if (wpfXamlType._members != null && wpfXamlType.Members.TryGetValue(name, out xamlMember))
                {
                    return(xamlMember);
                }
            }
            else
            {
                if (wpfXamlType._attachableMembers != null && wpfXamlType.AttachableMembers.TryGetValue(name, out xamlMember))
                {
                    return(xamlMember);
                }
            }

            WpfKnownType knownType = wpfXamlType as WpfKnownType;

            // Only look for known properties on a known type
            if (knownType != null)
            {
                // if it is a Baml Senario BAML doesn't really care if it was attachable or not
                // so look for the property in AttachableMembers also if it wasn't found in Members.
                if (!isAttachable || wpfXamlType.IsBamlScenario)
                {
                    xamlMember = System.Windows.Markup.XamlReader.BamlSharedSchemaContext.CreateKnownMember(wpfXamlType.Name, name);
                }
                if (isAttachable || (xamlMember == null && wpfXamlType.IsBamlScenario))
                {
                    xamlMember = System.Windows.Markup.XamlReader.BamlSharedSchemaContext.CreateKnownAttachableMember(wpfXamlType.Name, name);
                }

                if (xamlMember != null)
                {
                    return(knownType.CacheAndReturnXamlMember(xamlMember));
                }
            }
            return(null);
        }
Exemplo n.º 3
0
        internal XamlType GetKnownXamlType(Type type)
        {
            XamlType xamlType;

            lock (_syncObject)
            {
                // First;  look for the type in our Main cache.
                if (!_masterTypeTable.TryGetValue(type, out xamlType))
                {
                    // Then check if it is one of the Known Types.
                    // KnowTypes created by name need to be checked for an exact match.
                    xamlType = CreateKnownBamlType(type.Name, true, true);
                    if (xamlType == null && _themeHelpers != null)
                    {
                        foreach (ThemeKnownTypeHelper helper in _themeHelpers)
                        {
                            xamlType = helper.GetKnownXamlType(type.Name);
                            if (xamlType != null && xamlType.UnderlyingType == type)
                            {
                                break;
                            }
                        }
                    }
                    if (xamlType != null && xamlType.UnderlyingType == type)
                    {
                        WpfKnownType bamlType = xamlType as WpfKnownType;
                        if (bamlType != null)
                        {
                            _knownBamlTypes[bamlType.BamlNumber] = bamlType;
                        }
                        _masterTypeTable.Add(type, xamlType);
                    }
                    else
                    {
                        // If we get a known type but the type doesn't match, set xamlType to null
                        xamlType = null;
                    }
                }
            }
            return(xamlType);
        }
Exemplo n.º 4
0
 private WpfKnownType Create_BamlType_TextBox(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       639, "TextBox",
                                       typeof(System.Windows.Controls.TextBox),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Controls.TextBox(); };
     bamlType.ContentPropertyName = "Text";
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.XmlLangPropertyName = "Language";
     bamlType.UidPropertyName = "Uid";
     bamlType.IsUsableDuringInit = true;
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 5
0
 private WpfKnownType Create_BamlType_TemplateKey(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       636, "TemplateKey",
                                       typeof(System.Windows.TemplateKey),
                                       isBamlType, useV3Rules);
     bamlType.TypeConverterType = typeof(System.Windows.Markup.TemplateKeyConverter);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 6
0
 private WpfKnownType Create_BamlType_TemplateBindingExpression(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       632, "TemplateBindingExpression",
                                       typeof(System.Windows.TemplateBindingExpression),
                                       isBamlType, useV3Rules);
     bamlType.TypeConverterType = typeof(System.Windows.TemplateBindingExpressionConverter);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 7
0
 private WpfKnownType Create_BamlType_TableRowGroup(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       630, "TableRowGroup",
                                       typeof(System.Windows.Documents.TableRowGroup),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Documents.TableRowGroup(); };
     bamlType.ContentPropertyName = "Rows";
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.XmlLangPropertyName = "Language";
     bamlType.IsUsableDuringInit = true;
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 8
0
 private WpfKnownType Create_BamlType_Style(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       620, "Style",
                                       typeof(System.Windows.Style),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Style(); };
     bamlType.ContentPropertyName = "Setters";
     bamlType.DictionaryKeyPropertyName = "TargetType";
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 9
0
 private WpfKnownType Create_BamlType_StringKeyFrameCollection(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       617, "StringKeyFrameCollection",
                                       typeof(System.Windows.Media.Animation.StringKeyFrameCollection),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.Animation.StringKeyFrameCollection(); };
     bamlType.CollectionKind = XamlCollectionKind.Collection;
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 10
0
 private WpfKnownType Create_BamlType_StringConverter(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       615, "StringConverter",
                                       typeof(System.ComponentModel.StringConverter),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.ComponentModel.StringConverter(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 11
0
 private WpfKnownType Create_BamlType_StaticResourceExtension(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       603, "StaticResourceExtension",
                                       typeof(System.Windows.StaticResourceExtension),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.StaticResourceExtension(); };
     bamlType.Constructors.Add(1, new Baml6ConstructorInfo(
                     new List<Type>() { typeof(System.Object) },
                     delegate(object[] arguments)
                     {
                         return new System.Windows.StaticResourceExtension(
                              (System.Object)arguments[0]);
                     }));
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 12
0
 private WpfKnownType Create_BamlType_StaticExtension(bool isBamlType, bool useV3Rules)
 {
     // We're using an internal StaticExtension for the actual instance so we can optimize the provide value
     // call for WPF.  At the same time, we want XamlType to always pretend to be a regular StaticExtension
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       602, "StaticExtension",
                                       typeof(System.Windows.Markup.StaticExtension),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new MS.Internal.Markup.StaticExtension(); };
     bamlType.HasSpecialValueConverter = true;
     bamlType.Constructors.Add(1, new Baml6ConstructorInfo(
                     new List<Type>() { typeof(System.String) },
                     delegate(object[] arguments)
                     {
                         return new MS.Internal.Markup.StaticExtension(
                              (System.String)arguments[0]);
                     }));
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 13
0
 private WpfKnownType Create_BamlType_SpotLight(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       600, "SpotLight",
                                       typeof(System.Windows.Media.Media3D.SpotLight),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.Media3D.SpotLight(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 14
0
 private WpfKnownType Create_BamlType_SplineVectorKeyFrame(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       599, "SplineVectorKeyFrame",
                                       typeof(System.Windows.Media.Animation.SplineVectorKeyFrame),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.Animation.SplineVectorKeyFrame(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 15
0
 private WpfKnownType Create_BamlType_SpellCheck(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       582, "SpellCheck",
                                       typeof(System.Windows.Controls.SpellCheck),
                                       isBamlType, useV3Rules);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 16
0
 private WpfKnownType Create_BamlType_TextCompositionManager(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       642, "TextCompositionManager",
                                       typeof(System.Windows.Input.TextCompositionManager),
                                       isBamlType, useV3Rules);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 17
0
 private WpfKnownType Create_BamlType_StickyNoteControl(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       606, "StickyNoteControl",
                                       typeof(System.Windows.Controls.StickyNoteControl),
                                       isBamlType, useV3Rules);
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.XmlLangPropertyName = "Language";
     bamlType.UidPropertyName = "Uid";
     bamlType.IsUsableDuringInit = true;
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 18
0
 private WpfKnownType Create_BamlType_StopStoryboard(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       607, "StopStoryboard",
                                       typeof(System.Windows.Media.Animation.StopStoryboard),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.Animation.StopStoryboard(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 19
0
 private WpfKnownType Create_BamlType_StringKeyFrame(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       616, "StringKeyFrame",
                                       typeof(System.Windows.Media.Animation.StringKeyFrame),
                                       isBamlType, useV3Rules);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 20
0
 private WpfKnownType Create_BamlType_Storyboard(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       608, "Storyboard",
                                       typeof(System.Windows.Media.Animation.Storyboard),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.Animation.Storyboard(); };
     bamlType.ContentPropertyName = "Children";
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 21
0
 private WpfKnownType Create_BamlType_StrokeCollectionConverter(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       619, "StrokeCollectionConverter",
                                       typeof(System.Windows.StrokeCollectionConverter),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.StrokeCollectionConverter(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 22
0
 private WpfKnownType Create_BamlType_StreamGeometry(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       609, "StreamGeometry",
                                       typeof(System.Windows.Media.StreamGeometry),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.StreamGeometry(); };
     bamlType.TypeConverterType = typeof(System.Windows.Media.GeometryConverter);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 23
0
 private WpfKnownType Create_BamlType_Stylus(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       621, "Stylus",
                                       typeof(System.Windows.Input.Stylus),
                                       isBamlType, useV3Rules);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 24
0
 private WpfKnownType Create_BamlType_StreamGeometryContext(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       610, "StreamGeometryContext",
                                       typeof(System.Windows.Media.StreamGeometryContext),
                                       isBamlType, useV3Rules);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 25
0
 private WpfKnownType Create_BamlType_TabletDevice(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       631, "TabletDevice",
                                       typeof(System.Windows.Input.TabletDevice),
                                       isBamlType, useV3Rules);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 26
0
 private WpfKnownType Create_BamlType_StreamResourceInfo(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       611, "StreamResourceInfo",
                                       typeof(System.Windows.Resources.StreamResourceInfo),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Resources.StreamResourceInfo(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 27
0
 private WpfKnownType Create_BamlType_TemplateBindingExtension(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       634, "TemplateBindingExtension",
                                       typeof(System.Windows.TemplateBindingExtension),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.TemplateBindingExtension(); };
     bamlType.TypeConverterType = typeof(System.Windows.TemplateBindingExtensionConverter);
     bamlType.Constructors.Add(1, new Baml6ConstructorInfo(
                     new List<Type>() { typeof(System.Windows.DependencyProperty) },
                     delegate(object[] arguments)
                     {
                         return new System.Windows.TemplateBindingExtension(
                              (System.Windows.DependencyProperty)arguments[0]);
                     }));
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 28
0
 private WpfKnownType Create_BamlType_String(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       612, "String",
                                       typeof(System.String),
                                       isBamlType, useV3Rules);
     bamlType.TypeConverterType = typeof(System.ComponentModel.StringConverter);
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 29
0
 private WpfKnownType Create_BamlType_TemplateKeyConverter(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       637, "TemplateKeyConverter",
                                       typeof(System.Windows.Markup.TemplateKeyConverter),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Markup.TemplateKeyConverter(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 30
0
 private WpfKnownType Create_BamlType_StringAnimationBase(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       613, "StringAnimationBase",
                                       typeof(System.Windows.Media.Animation.StringAnimationBase),
                                       isBamlType, useV3Rules);
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 31
0
 private WpfKnownType Create_BamlType_TextBoxBase(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       640, "TextBoxBase",
                                       typeof(System.Windows.Controls.Primitives.TextBoxBase),
                                       isBamlType, useV3Rules);
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.XmlLangPropertyName = "Language";
     bamlType.UidPropertyName = "Uid";
     bamlType.IsUsableDuringInit = true;
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 32
0
 private WpfKnownType Create_BamlType_StringAnimationUsingKeyFrames(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       614, "StringAnimationUsingKeyFrames",
                                       typeof(System.Windows.Media.Animation.StringAnimationUsingKeyFrames),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.Media.Animation.StringAnimationUsingKeyFrames(); };
     bamlType.ContentPropertyName = "KeyFrames";
     bamlType.RuntimeNamePropertyName = "Name";
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 33
0
 private WpfKnownType Create_BamlType_TextDecoration(bool isBamlType, bool useV3Rules)
 {
     var bamlType = new WpfKnownType(this, // SchemaContext
                                       643, "TextDecoration",
                                       typeof(System.Windows.TextDecoration),
                                       isBamlType, useV3Rules);
     bamlType.DefaultConstructor = delegate() { return new System.Windows.TextDecoration(); };
     bamlType.Freeze();
     return bamlType;
 }
Exemplo n.º 34
0
 public WpfKnownTypeInvoker(WpfKnownType type)
     : base(type)
 {
     _type = type;
 }