private RawDataSourceInfoBase MoveToSpecialDataContextPathExtension(IDataContextAncestorWalker walker, RawDataSourceInfoBase localDataSource) { if (walker.CurrentNode == null) { return((RawDataSourceInfoBase)null); } DataContextPropertyPathExtension propertyPathExtension1 = DataContextMetadata.GetDataContextPropertyPathExtension(walker.CurrentNode, walker.CurrentProperty); if (propertyPathExtension1 == null) { return((RawDataSourceInfoBase)null); } string propertyPathExtension2 = this.GetPropertyPathExtension(walker.CurrentNode, walker.CurrentProperty, propertyPathExtension1); if (propertyPathExtension2 == null) { return((RawDataSourceInfoBase)RawDataSourceInfo.Invalid); } if (this.visitedLocations.IsVisited(walker)) { return((RawDataSourceInfoBase)RawDataSourceInfo.Invalid); } DocumentNode dataSourceNode = walker.CurrentNode.Properties[(IPropertyId)propertyPathExtension1.Property]; RawDataSourceInfoBase dataSourceInfoBase; if (dataSourceNode == null) { dataSourceInfoBase = (RawDataSourceInfoBase)RawDataSourceInfo.NewEmpty; } else { dataSourceInfoBase = DataContextHelper.GetRawDataSourceInfo(dataSourceNode); if (dataSourceInfoBase.IsValid) { dataSourceInfoBase.AppendClrPath(propertyPathExtension2); } } RawDataSourceInfoBase localDataSource1 = dataSourceInfoBase.CombineWith(localDataSource); walker.MoveTo(walker.CurrentNode, propertyPathExtension1.Property, true); return(this.UnwindElementNameBindingInternal(walker, localDataSource1)); }
private RawDataSourceInfoBase MoveToDataContextProperty(IDataContextAncestorWalker walker, RawDataSourceInfoBase localDataSource) { if (walker.CurrentNode == null) { return((RawDataSourceInfoBase)null); } DataContextProperty dataContextProperty = DataContextMetadata.GetDataContextProperty(walker.CurrentNode, walker.CurrentProperty); if (dataContextProperty == null) { return((RawDataSourceInfoBase)null); } if (!dataContextProperty.IsValid) { return((RawDataSourceInfoBase)RawDataSourceInfo.Invalid); } if (this.visitedLocations.IsVisited(walker)) { return((RawDataSourceInfoBase)RawDataSourceInfo.Invalid); } DocumentNode dataContextNode = dataContextProperty.DataContextNode; if (dataContextNode == null) { return((RawDataSourceInfoBase)RawDataSourceInfo.Invalid); } this.OnDataSourceFound(walker.CurrentNode, walker.CurrentProperty); RawDataSourceInfoBase rawDataSourceInfo = DataContextHelper.GetRawDataSourceInfo(dataContextNode); if (rawDataSourceInfo.IsValid && dataContextProperty.IsCollectionItem) { rawDataSourceInfo.AppendIndexStep(); } RawDataSourceInfoBase localDataSource1 = rawDataSourceInfo.CombineWith(localDataSource); walker.MoveTo(dataContextProperty.SourceNode, dataContextProperty.Property, true); return(this.UnwindElementNameBindingInternal(walker, localDataSource1)); }
private RawDataSourceInfoBase MoveToElementNameBinding(IDataContextAncestorWalker walker, ElementDataSourceInfo elementBinding) { if (walker.CurrentNode == null || elementBinding == null || elementBinding.RootTargetProperty == null) { return((RawDataSourceInfoBase)null); } if (this.visitedLocations.IsVisited(walker)) { return((RawDataSourceInfoBase)RawDataSourceInfo.Invalid); } this.OnDataSourceFound(walker.CurrentNode, walker.CurrentProperty); if (!walker.MoveTo(elementBinding.RootElement, elementBinding.RootTargetProperty, true)) { return((RawDataSourceInfoBase)null); } DocumentNode dataSourceNode = elementBinding.RootElement.Properties[(IPropertyId)elementBinding.RootTargetProperty]; RawDataSourceInfoBase dataSourceInfoBase = dataSourceNode != null?DataContextHelper.GetRawDataSourceInfo(dataSourceNode) : (RawDataSourceInfoBase)RawDataSourceInfo.NewEmpty; if (dataSourceInfoBase.IsValid) { dataSourceInfoBase.AppendClrPath(elementBinding.NormalizedClrPath); } return(dataSourceInfoBase); }