How can I get the <see langword=> tag to use C# keywords rather than VB keywords? - sandcastle

I'm documenting C# code using XML and Sandcastle Help File Builder to generate HtmlHelp1 help files. I've set the SyntaxFilters property on the Sandcastle project to CSharp as I only want to generate code syntax relevant to C#.
I'm making use of the <see langword="[langword]" />, such as the the following:
<see langword="null" />
<see langword="true" />
<see langword="false" />
As I had set the SyntaxFilters property to CSharp I was expecting the above tags to be converted to equivalent C# keywords, as follows:
null
true
false
Instead they are being converted to the equivalent keyword for Visual Basic, as follows:
Nothing
True
False
Is there a way to these tags to replaced with the appropriate C# keywords rather than Visual Basic keywords or shall I not use the see tag at all?

Related

ObservableValidator in .NET MAUI Toolkit - doc for EventTriggerBehavior?

In the .NET MAUI Community Toolkit MVVM samples there is this XAML:
<Grid>
<muxc:InfoBar
x:Name="SuccessInfoBar"
Title="Success"
Message="The form was filled in correctly."
Severity="Success">
<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="FormSubmissionCompleted" SourceObject="{x:Bind ViewModel}">
<interactions:ChangePropertyAction
PropertyName="IsOpen"
TargetObject="{x:Bind SuccessInfoBar}"
Value="True" />
<interactions:ChangePropertyAction
PropertyName="IsOpen"
TargetObject="{x:Bind FailureInfoBar}"
Value="False" />
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</muxc:InfoBar>
Can you tell me where I find documentation on EventTriggerBehavior? Or for that matter, where I find interactivity and Interaction.Behaviors and ChangePropertyAction?
I don't see this documented, despite searching.
Also, while I have you, this same code says
SourceObject="{x:Bind ViewModel}
Is Bind the same things as Binding?
EventTriggerBehavior: Listens for a specific event on its source and executes an action when the event is fired, it has two configurable properties (EventName and SourceObject).
ChangePropertyAction: Action that will change a specified property to a specified value when invoked.
For more information about Behaviors, you can check the documentation: XamlBehaviors
Regarding Bind and Binding, the {x:Bind} markup extension official document explains:
The {x:Bind} markup extension—new for Windows 10—is an alternative to
{Binding}. {x:Bind} runs in less time and less memory than {Binding}
and supports better debugging.
The difference to note is that the default mode of {x:Bind} is OneTime, which is different from {Binding}, whose default mode is OneWay.
For a comprehensive comparison between {x:Bind} and {Binding}, you can read Data binding in depth.

DITA: reuse the same text multiple times with different variable setting for each instance

I'm working on a document where, among other things, I need to explain two units that are very similar. I want to reuse text in both descriptions, but I want to use the name of the units in the shared text, and to configure a form of substitution/variable so the name of the units appear in each description. Note that the description of both units appear in the final document.
We're using a structure like this:
top.ditamap, which includes:
units_a_and_b.ditamap, which includes:
unit_a.dita
unit_b.dita
and then this file with text snippets:
unit_a_b_shared.dita
unit_a.dita and unit_b.dita will conref text snippets from unit_a_b_shared.dita.
So basically I want unit_a_b_shared.dita to contain something like this:
"When you configure DOODAA to ..."
and then I want DOODAA to be replaced with unit_a inside the unit_a part of the document, and with unit_b inside the unit_b part.
I've tried to use keywords for this, but so far without success. I haven't found a way to make them take on different values in the different files, even when using keyscopes as explained here:
https://blog.oxygenxml.com/keyscopes/keyscopesBlog.html
The problem seems to be that with keyscopes I need the full path, which includes which unit it is, and hence cannot be used in the text snippet which is shared. Without keyscopes the first definition of the keyword applies everywhere.
Any suggestions on how to achieve this goal (using keywords or not)?
I wrote that key scopes article on the Oxygen XML Blog and I think that key scopes seem to be the answer for your case.
So the "unit_a_b_shared.dita" file would have inside a something like:
<p id="reusablePara">some text before <ph keyref="unit"/> some text after</p>
And then in the DITA Map you would refer to ""unit_a_b_shared.dita"" in different key scopes and re-define the key "unit" in those places to bind it to a different value.
The DITA Map would need to look like this:
<map>
<title>Main</title>
<topicref href="unit_a.dita" keyscope="unitA">
<keydef href="unit_a_b_shared.dita" keys="reusables"/>
<keydef keys="unit">
<topicmeta>
<keywords>
<keyword>KM</keyword>
</keywords>
</topicmeta>
</keydef>
</topicref>
<topicref href="unit_b.dita" keyscope="unitB">
<keydef href="unit_a_b_shared.dita" keys="reusables"/>
<keydef keys="unit">
<topicmeta>
<keywords>
<keyword>KG</keyword>
</keywords>
</topicmeta>
</keydef>
</topicref>
</map>
and inside "unit_a.dita" you would conkeyref to the reusable paragraph inside the "unit_a_b_shared.dita" file:
<p conkeyref="reusables/reusableParagraph"/>
Note that I'm using "conkeyref" not "conref". Once you get to use key scopes you should avoid direct links or direct content references, use only indirect linking using keys.

What is done here. What does this syntax means in sightly?

I am reading the docs about calling clientlibs in sightly.
I am not getting the below syntax
<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
data-sly-call="${clientlib.all # categories='clientlib1,clientlib2'}"/>
why we are using category here? How does it related to clientlibs?
Lets break this down:
<sly> - is a sightly tag that does nothing :) So when you don't want to use an HTML tag you can use <sly> as a placeholder.
data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html - this line references the clientlib.html file that has templates marked with data-sly-template attributes. These templates are reusable piece of markup. Look at them as functions in htl.
data-sly-call - used to call one of the templates from the above clientlib.html
clientLib.all - "all" is the name of the template being called from clientlib.html which is referred using clientLib keyword (-use.clientLib)
# categories='clientlib1,clientlib2 - categories are used to identify cq:clientLibraryFolder that are used for client side code in AEM. If you check http://localhost:4502/libs/granite/ui/content/dumplibs.html it will show you the location of libraries clientlib1 & clientlib2
So in a nutshell, this line calls 2 libraries (containing js & css) with categories clientlib1 & clientlib2 and loads them on to the page/component

VS Code Completion for custom HTML elements

Is there a way to add custom HTML elements with custom attributes to VS Code so that I will get some autocomplete / intellisense on it?
For example in my framework (here Aurelia) I have added a <my-component is-telling-lies="true" aria-type="hidden" default-target="north">Do you believe?</my-component> and would like to have the element show up when starting to type a new element and inside it the attribute when typing in the attribute space of the element.
Yes, there's a way.
You can extend VS Code's HTML support through a declarative custom data format. By setting html.customData to a list of JSON files following the custom data format, you can enhance VS Code's understanding of new HTML tags, attributes and attribute values. VS Code will then offer language support such as completion & hover information for the provided tags, attributes and attribute values.
See: https://code.visualstudio.com/docs/languages/html#_html-custom-data
You can read more about using custom data in the vscode-custom-data repository.

Alfresco: how to change start task name of custom workflow?

I want workflow details page to show a descriptive name for the start task instead of the form id in History table. The name attribute of userTasks works fine, but I can't get it working on my startEvent. As seen below:
<startEvent id="start" name="Início" activiti:initiator="initiatorUserName"
activiti:formKey="workflowdocumentrequest:start">
<userTask id="userTask1" name="Revisão da Requisição de Documento Físico"
activiti:assignee="${workflowdocumentrequest_destination.properties.userName}"
activiti:formKey="workflowdocumentrequest:review">
What do I have to do?
Well, if you're developing a custom advanced workflow in Alfresco using Activiti you should check out this Jeff Pots guide.
Other than that, in order to use a customised string for your start event you should be familiar with content modeling and i18n properties files.
So for your startEvent you should have a specific workflow model declaring the workflowdocumentrequest:start type, something similar to this:
<type name="workflowdocumentrequest:start">
<parent>bpm:startTask</parent>
...
</type>
For that workflow content model you should have a specific i18n file, in messages folder called workflowdocumentrequestWorkflow.properties.
There you should have something like this:
workflowdocumentrequestWorkflow_workflowmodel.type.workflowdocumentrequestWorkflow_start.title=Início
The workflowdocumentrequestWorkflow_workflowmodel part is your namespacePrefixShortname_yourWorkflowModelName (the one you have used at the beginning of your workflow content model xml file <model name="workflowdocumentrequestWorkflow:workflowmodel xmlns="http://www.alfresco.org/model/dictionary/1.0">.
The .type. is obviously your custom type for the start event task.
The workflowdocumentrequestWorkflow_start is your type's name in your xml. Activiti engine and i18n file hase to be written with _ instead of :.
Hope it helps.
Cheers