Beispiel #1
0
        /// <summary>
        /// Find the element given name
        /// </summary>
        object INameScope.FindName(string name)
        {
            // _templatedParent is null if template.LoadContent() was responsible
            if (_templatedParent != null)
            {
                FrameworkObject fo = new FrameworkObject(_templatedParent);

                Debug.Assert(fo.IsFE);
                if (fo.IsFE)
                {
                    return(StyleHelper.FindNameInTemplateContent(fo.FE, name, fo.FE.TemplateInternal));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                if (_nameMap == null || name == null || name == String.Empty)
                {
                    return(null);
                }

                return(_nameMap[name]);
            }
        }
        // Token: 0x060062D2 RID: 25298 RVA: 0x001BB87C File Offset: 0x001B9A7C
        internal static object GetFdrHost(FlowDocumentReader fdr)
        {
            Invariant.Assert(fdr != null, "Null FDR");
            Decorator decorator = null;

            if (fdr.TemplateInternal != null)
            {
                decorator = (StyleHelper.FindNameInTemplateContent(fdr, "PART_ContentHost", fdr.TemplateInternal) as Decorator);
            }
            if (decorator == null)
            {
                return(null);
            }
            return(decorator.Child);
        }
Beispiel #3
0
 // Token: 0x06000C1F RID: 3103 RVA: 0x0002D454 File Offset: 0x0002B654
 object INameScope.FindName(string name)
 {
     if (this._templatedParent != null)
     {
         FrameworkObject frameworkObject = new FrameworkObject(this._templatedParent);
         if (frameworkObject.IsFE)
         {
             return(StyleHelper.FindNameInTemplateContent(frameworkObject.FE, name, frameworkObject.FE.TemplateInternal));
         }
         return(null);
     }
     else
     {
         if (this._nameMap == null || name == null || name == string.Empty)
         {
             return(null);
         }
         return(this._nameMap[name]);
     }
 }