|
|
|
@ -29,7 +29,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
@@ -29,7 +29,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
|
|
|
|
|
/// A service provider that provides the IProvideValueTarget and IXamlTypeResolver services.
|
|
|
|
|
/// No other services (e.g. from the document's service provider) are offered.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class XamlObjectServiceProvider : IServiceProvider, IProvideValueTarget, IXamlSchemaContextProvider, IAmbientProvider |
|
|
|
|
public class XamlObjectServiceProvider : IServiceProvider, IProvideValueTarget, IXamlSchemaContextProvider, IAmbientProvider |
|
|
|
|
{ |
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a new XamlObjectServiceProvider instance.
|
|
|
|
@ -61,12 +61,16 @@ namespace ICSharpCode.WpfDesign.XamlDom
@@ -61,12 +61,16 @@ namespace ICSharpCode.WpfDesign.XamlDom
|
|
|
|
|
if (serviceType == typeof(IXamlTypeResolver)) { |
|
|
|
|
return Resolver; |
|
|
|
|
} |
|
|
|
|
if (serviceType == typeof(IXamlSchemaContextProvider)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (serviceType == typeof(IAmbientProvider)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (serviceType == typeof(XamlTypeResolverProvider)) |
|
|
|
|
{ |
|
|
|
|
return Resolver; |
|
|
|
|
} |
|
|
|
|
if (serviceType == typeof(IXamlSchemaContextProvider)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (serviceType == typeof(IAmbientProvider)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -110,57 +114,57 @@ namespace ICSharpCode.WpfDesign.XamlDom
@@ -110,57 +114,57 @@ namespace ICSharpCode.WpfDesign.XamlDom
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IXamlSchemaContextProvider Members
|
|
|
|
|
|
|
|
|
|
private XamlSchemaContext iCsharpXamlSchemaContext; |
|
|
|
|
|
|
|
|
|
//Maybe we new our own XamlSchemaContext?
|
|
|
|
|
//private class ICsharpXamlSchemaContext : XamlSchemaContext
|
|
|
|
|
//{
|
|
|
|
|
// public override XamlType GetXamlType(Type type)
|
|
|
|
|
// {
|
|
|
|
|
// return base.GetXamlType(type);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
public XamlSchemaContext SchemaContext |
|
|
|
|
{ |
|
|
|
|
get |
|
|
|
|
{ |
|
|
|
|
return iCsharpXamlSchemaContext = iCsharpXamlSchemaContext ?? new XamlSchemaContext(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IAmbientProvider Members
|
|
|
|
|
|
|
|
|
|
public AmbientPropertyValue GetFirstAmbientValue(IEnumerable<XamlType> ceilingTypes, params XamlMember[] properties) |
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public object GetFirstAmbientValue(params XamlType[] types) |
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<AmbientPropertyValue> GetAllAmbientValues(IEnumerable<XamlType> ceilingTypes, params XamlMember[] properties) |
|
|
|
|
{ |
|
|
|
|
return new List<AmbientPropertyValue>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<object> GetAllAmbientValues(params XamlType[] types) |
|
|
|
|
{ |
|
|
|
|
return new List<object>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<AmbientPropertyValue> GetAllAmbientValues(IEnumerable<XamlType> ceilingTypes, bool searchLiveStackOnly, IEnumerable<XamlType> types, |
|
|
|
|
params XamlMember[] properties) |
|
|
|
|
{ |
|
|
|
|
return new List<AmbientPropertyValue>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
#region IXamlSchemaContextProvider Members
|
|
|
|
|
|
|
|
|
|
private XamlSchemaContext iCsharpXamlSchemaContext; |
|
|
|
|
|
|
|
|
|
//Maybe we new our own XamlSchemaContext?
|
|
|
|
|
//private class ICsharpXamlSchemaContext : XamlSchemaContext
|
|
|
|
|
//{
|
|
|
|
|
// public override XamlType GetXamlType(Type type)
|
|
|
|
|
// {
|
|
|
|
|
// return base.GetXamlType(type);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
public XamlSchemaContext SchemaContext |
|
|
|
|
{ |
|
|
|
|
get |
|
|
|
|
{ |
|
|
|
|
return iCsharpXamlSchemaContext = iCsharpXamlSchemaContext ?? new XamlSchemaContext(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IAmbientProvider Members
|
|
|
|
|
|
|
|
|
|
public AmbientPropertyValue GetFirstAmbientValue(IEnumerable<XamlType> ceilingTypes, params XamlMember[] properties) |
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public object GetFirstAmbientValue(params XamlType[] types) |
|
|
|
|
{ |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<AmbientPropertyValue> GetAllAmbientValues(IEnumerable<XamlType> ceilingTypes, params XamlMember[] properties) |
|
|
|
|
{ |
|
|
|
|
return new List<AmbientPropertyValue>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<object> GetAllAmbientValues(params XamlType[] types) |
|
|
|
|
{ |
|
|
|
|
return new List<object>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IEnumerable<AmbientPropertyValue> GetAllAmbientValues(IEnumerable<XamlType> ceilingTypes, bool searchLiveStackOnly, IEnumerable<XamlType> types, |
|
|
|
|
params XamlMember[] properties) |
|
|
|
|
{ |
|
|
|
|
return new List<AmbientPropertyValue>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|