I'm trying to create a property in an OSGi properties file, where the property is a simple string, such as
fileName=${header.RecordType}.csv
However, this doesn't seem to work, and I assume that is because the ${...} is being processed as a property reference by the configuration manager, and since it doesn't exist as a property, is being blanked.
I've tried escaping the simple string reference as $${ and \${ but neither work.
Is it possible to somehow escape the ${ so that the property passed to the program is exactly as shown above?
Thanks for looking!
Use fileName=$simple{xxxx} as alternative syntax, which is also documented here:
https://camel.apache.org/manual/latest/simple-language.html
Related
If I have an attribute self.internal/freezer in a class, and I raise an error via (raise (AttributeError f"Sorry! '{attr}' doesn't exist as an attribute!")), how can I get the attribute name to render as internal/freezer instead of hyx_internalXsolidusXfreezer? For example, I already tried (hy.eval attr) with the f-string, but it still came out mangled.
Thanks to #Kodiologist in the comments linking the mangling section in hylang's syntax documentation; unamgling can be achieved via the aptly named hy.unmangle function, documented here as well.
I am using apache cxf 2.6.10, and while processing a call I always get DepthExceededException. The documentation says I can override these values, but how can I do that? I tried defining those property in the bean it does not work. I tried setting them in cxf:bus it does not works.
Any idea?
I solved this by increasing value of static field innerElementCountThreshold. I set it in my code like this:
StaxUtils.setInnerElementCountThreshold(200000);
Ok I found this wonderful idea on code project.
link
The idea is great add all your data templates to collection in your list box. Tell each one what to look for (a type) and what data template to use when it runs into that type. The problem is that the included source code is different from the on page code and I can't seen to get any combination of it to work. Even adding the missing quotation marks and changing the type to a local class instead of the non-accessible string and int32 classes.
So the question is. What am I doing wrong?
Bryan
Should be totally redundant when you have DataTemplate.DataType.
(Example)
I have a DataGrid and it has a text column in it, configured this way:
<dg:DataGridTextColumn Header="{x:Static ResViewModel:SC.Resources.HelloWorld}" />
Here ResViewModel is the xmlns:namespace, SC is the project namespace, Resources is the resource file name and HelloWorld is a string property.
But I try to parse this xaml, I get an error like
Key cannot be null. Parameter name: key...
Can you help me to understand why is this error occuring? Also what is the best way to access resource file without using the LocBAML tool?
I see some issues:
"SC is the project namespace" - that should go into the xmlns definition.
You can't access files with this syntax, unless you have a dependency object with the same name.
There's a good approach to retrieving strings that is described here. It's focusing on Localisation, but it will work for a single language as well. This approach has it's downsides, but it's the lesser evil than other routes.
in a XAML file (a WPF UserControl), is there a way to reference an inner class "B" defined in another class "A" ?
public class A
{
public class B
{
}
}
Something like :
<local:A.B ... />
This syntax does not work because "B" is interpreted as a property named "B" in class "A".
I've tried more exotic syntaxes like "::" or "+" but none seems to work.
I'm currently using Silverlight 4 with VS2010.
Thanks in advance for your help.
This question is pretty old, and I don't know if it would have worked with the version of WPF back in 2010, but now you can make it work by using the "real" (internal) name of the nested type:
<local:A+B />
If you've ever looked a disassembled code, that's how nested types look like:
ParentTypeName+Nested
I was searching and searching, because if this is possible, I would like to know. Unfortunately, I found this on msdn:
Your custom class must not be a nested
class. Nested classes and the "dot"
in their general CLR usage syntax interfere with other WPF and/or XAML
features such as attached properties.
So, it appears you can't reference a nested class with the dot operator. As for alternative ways of getting to that inner class through XAML, I haven't had any luck in my searches yet. :o( But this is a rather interesting issue, so I will continue searching. Maybe I'll find some luck! :o)
. refers to a property; not sure why XAML couldn't also search for a nested class, but it doesn't.
A nested class can be represented when inside a string (e.g. a property value), using A+B instead of A.B:
<Label SomeProperty1="{x:Static local:A+B.SomeProperty2}" />
As an element name (as shown in question), + is not allowed, as the result would no longer be valid XML; + is not a valid name character:
XAML is XML.
XML Spec - NameChar.
So the element name cannot directly describe a nested class.
BUT see UPDATE below - an alternative syntax that solves this.
UPDATE
Per #Artfunkel's comment on one answer, this should be a solution [I have not tested]:
<x:Type TypeName="local:A+B"/>
From: https://learn.microsoft.com/en-us/dotnet/framework/xaml-services/x-type-markup-extension
TBD how to specify property name with that syntax. Use x:TypeArguments?