// Token: 0x06007725 RID: 30501 RVA: 0x00220BB3 File Offset: 0x0021EDB3
 internal XmlBindingWorker(ClrBindingWorker worker, bool collectionMode) : base(worker.ParentBindingExpression)
 {
     this._hostWorker     = worker;
     this._xpath          = base.ParentBinding.XPath;
     this._collectionMode = collectionMode;
     this._xpathType      = XmlBindingWorker.GetXPathType(this._xpath);
 }
Exemple #2
0
        // Token: 0x06007488 RID: 29832 RVA: 0x00215838 File Offset: 0x00213A38
        internal void ReportBadXPath(TraceEventType traceType)
        {
            XmlBindingWorker xmlWorker = this.XmlWorker;

            if (xmlWorker != null)
            {
                xmlWorker.ReportBadXPath(traceType);
            }
        }
        PropertyPath PrepareXmlBinding(PropertyPath path) 
        {
            if (path == null)
            {
                DependencyProperty targetDP = TargetProperty; 
                Type targetType = targetDP.PropertyType;
                string pathString; 
 
                if (targetType == typeof(Object))
                { 
                    if (targetDP == System.Windows.Data.BindingExpression.NoTargetProperty ||
                        targetDP == System.Windows.Controls.Primitives.Selector.SelectedValueProperty)
                    {
                        // these properties want the "value" - i.e. the text of 
                        // the first (and usually only) XmlNode
                        pathString = "/InnerText"; 
                    } 
                    else if (targetDP == FrameworkElement.DataContextProperty ||
                              targetDP == CollectionViewSource.SourceProperty) 
                    {
                        // these properties want the entire collection
                        pathString = String.Empty;
                    } 
                    else
                    { 
                        // most object-valued properties want the (current) XmlNode itself 
                        pathString = "/";
                    } 
                }
                else if (targetType.IsAssignableFrom(typeof(XmlDataCollection)))
                {
                    // these properties want the entire collection 
                    pathString = String.Empty;
                } 
                else 
                {
                    // most other properties want the "value" 
                    pathString = "/InnerText";
                }

                path = new PropertyPath(pathString); 
            }
 
            // don't bother to create XmlWorker if we don't even have a valid path 
            if (path.SVI.Length > 0)
            { 
                // tell Xml Worker if desired result is collection, in order to get optimization
                _xmlWorker = new XmlBindingWorker(this, path.SVI[0].drillIn == DrillIn.Never);
            }
            return path; 
        }