pub struct AstTransformationContext {
pub namespace_aliases: RefCell<HashMap<String, String>>,
/* private fields */
}Fields§
§namespace_aliases: RefCell<HashMap<String, String>>Implementations§
Source§impl AstTransformationContext
impl AstTransformationContext
Sourcepub fn report_diagnostic_at(
&self,
diagnostic_code: &str,
severity: XamlDiagnosticSeverity,
title: &str,
offender: Option<&dyn IXamlLineInfo>,
min_severity: XamlDiagnosticSeverity,
) -> XamlResult<()>
pub fn report_diagnostic_at( &self, diagnostic_code: &str, severity: XamlDiagnosticSeverity, title: &str, offender: Option<&dyn IXamlLineInfo>, min_severity: XamlDiagnosticSeverity, ) -> XamlResult<()>
ReportDiagnostic(diagnosticCode, severity, title, offender, minSeverity).
Sourcepub fn report_transform_error_node(
&self,
title: &str,
offender: Rc<dyn IXamlAstNode>,
) -> XamlResult<Rc<dyn IXamlAstNode>>
pub fn report_transform_error_node( &self, title: &str, offender: Rc<dyn IXamlAstNode>, ) -> XamlResult<Rc<dyn IXamlAstNode>>
ReportTransformError(title, offender): reports the error and returns the offender.
Sourcepub fn report_transform_error<TReturn>(
&self,
title: &str,
offender: Option<&dyn IXamlLineInfo>,
ret: TReturn,
) -> XamlResult<TReturn>
pub fn report_transform_error<TReturn>( &self, title: &str, offender: Option<&dyn IXamlLineInfo>, ret: TReturn, ) -> XamlResult<TReturn>
ReportTransformError<TReturn>(title, offender, ret).
Sourcepub fn report_error<TReturn>(
&self,
exception: XamlError,
ret: TReturn,
) -> XamlResult<TReturn>
pub fn report_error<TReturn>( &self, exception: XamlError, ret: TReturn, ) -> XamlResult<TReturn>
ReportError<TReturn>(exception, ret).
Source§impl AstTransformationContext
impl AstTransformationContext
pub fn new( configuration: Rc<TransformerConfiguration>, xaml_document: Option<&XamlDocument>, ) -> Self
pub fn document(&self) -> Option<&str>
Sourcepub fn current_document(&self) -> Option<String>
pub fn current_document(&self) -> Option<String>
The value of the (virtual upstream) Document property: the override installed with
AstTransformationContext::set_document_override if there is one, the document the
context was created for otherwise. Diagnostics and errors are attributed to it.
Sourcepub fn set_document_override(&self, document: Option<Option<String>>)
pub fn set_document_override(&self, document: Option<Option<String>>)
Stands in for a derived context overriding the Document property: Some(value) makes
AstTransformationContext::current_document return value, None removes the override.
pub fn configuration(&self) -> &Rc<TransformerConfiguration>
pub fn root_object(&self) -> XamlResult<Rc<dyn IXamlAstValueNode>>
pub fn set_root_object(&self, value: Rc<dyn IXamlAstValueNode>)
Sourcepub fn try_get_namespace_alias(&self, alias: &str) -> Option<String>
pub fn try_get_namespace_alias(&self, alias: &str) -> Option<String>
NamespaceAliases.TryGetValue.
Sourcepub fn report_diagnostic(
&self,
diagnostic: XamlDiagnostic,
throw_on_fatal: bool,
) -> XamlResult<XamlDiagnosticSeverity>
pub fn report_diagnostic( &self, diagnostic: XamlDiagnostic, throw_on_fatal: bool, ) -> XamlResult<XamlDiagnosticSeverity>
Reports a diagnostic to the configured handler and returns the resulting severity.
With throw_on_fatal, a fatal diagnostic is turned into an error.
pub fn visit( &self, root: &Rc<dyn IXamlAstNode>, transformer: &dyn IXamlAstTransformer, ) -> XamlResult<Rc<dyn IXamlAstNode>>
pub fn visit_children( &self, root: &dyn IXamlAstNode, transformer: &dyn IXamlAstTransformer, ) -> XamlResult<()>
Sourcepub fn on_unhandled_transform_error(&self, exception: &XamlError) -> bool
pub fn on_unhandled_transform_error(&self, exception: &XamlError) -> bool
Returns true when the error was reported as non-fatal and the transformation may go on.
Methods from Deref<Target = XamlContextBase>§
pub fn get_item<T: 'static>(&self) -> XamlResult<Rc<T>>
pub fn get_or_create_item<T: Default + 'static>(&self) -> Rc<T>
pub fn try_get_item<T: 'static>(&self) -> Option<Rc<T>>
pub fn set_item<T: 'static>(&self, item: Rc<T>)
Sourcepub fn parent_nodes(&self) -> Vec<Rc<dyn IXamlAstNode>>
pub fn parent_nodes(&self) -> Vec<Rc<dyn IXamlAstNode>>
The parents of the current node, innermost first.
Sourcepub fn first_parent_node(&self) -> Option<Rc<dyn IXamlAstNode>>
pub fn first_parent_node(&self) -> Option<Rc<dyn IXamlAstNode>>
The innermost parent: ParentNodes().FirstOrDefault().
Sourcepub fn has_parent_nodes(&self) -> bool
pub fn has_parent_nodes(&self) -> bool
ParentNodes().Any().
pub fn push_parent(&self, node: Rc<dyn IXamlAstNode>)
pub fn pop_parent(&self) -> Option<Rc<dyn IXamlAstNode>>
Trait Implementations§
Source§impl Deref for AstTransformationContext
Gives access to the XamlContextBase members (the C# base class).
impl Deref for AstTransformationContext
Gives access to the XamlContextBase members (the C# base class).