Skip to content

Commit

Permalink
Add Update Frequency override in options dialog.
Browse files Browse the repository at this point in the history
Merge doc fixes.
  • Loading branch information
lovettchris committed Sep 19, 2024
1 parent d8e95f9 commit 677cecb
Show file tree
Hide file tree
Showing 29 changed files with 322 additions and 205 deletions.
Binary file modified docs/assets/images/options.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This is a GUI test, so do not move your mouse or type on your keyboard or let yo
completed. Total test run time is about 12 minutes.
The tests all pass on Windows 10, but currently some tests fail on Windows 11, there seems to be some breaking changes
in the Windows Automation layer that XML notepad tests are using. This is being investigated.
in the Windows Automation layer that XML Notepad tests are using. This is being investigated.
Note: [bug 10244](https://github.com/dotnet/winforms/issues/10244) is still open in in .net 4.8
System.Windows.Automation of menu items that blocks the tests, so checkout the branch `clovett/net472` to run the unit
Expand Down Expand Up @@ -142,4 +142,4 @@ See [XML Notepad Design ](design.md) for more detailed information about how thi
Feedback and suggestions are welcome, just use the [GitHub issues
list](https://github.com/microsoft/XmlNotepad/issues). Pull requests are also welcome, in fact, a number of good pull
requests have already been merged. Thanks to all who are helping to make XML notepad a great tool!
requests have already been merged. Thanks to all who are helping to make XML Notepad a great tool!
30 changes: 15 additions & 15 deletions docs/help/analytics.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

## Analytics

In order to understand which features are important XML Notepad records anonymous usage like:
To understand which features are important, XML Notepad records anonymous usage data, like:

1. how many times the app is used
2. how many times each feature is used (options, xslt, search, etc)
1. The number of times the app is used.
2. The number of times each feature is used (options, xslt, search, etc)

The data is collected using Google Analytics and shared only with members of the XML Notepad development team. The data
is used to prioritize future work to improve the features that are most popular.
The data is collected using Google Analytics and shared solely with members of the XML Notepad development team.
It's used to prioritize future enhancements.

As a teaser, here is a map of countries where XML Notepad was used in July 2022. That's super cool to see a healthy
community of users and this motivates the team to keep XML notepad in tip-top shape.
As a sneak peek, here is a map illustrating the countries where XML Notepad was used in July 2022. This vibrant user
community is a strong motivator for the team to continually refine XML Notepad.

![map](../assets/images/map.png)

Expand All @@ -30,19 +30,19 @@ The first time you install XML Notepad on your computer you will be prompted wit
![popup](../assets/images/analytics.png)


Thanks to those who have allowed analytics to be collected, it really helps to understand usage patterns and prioritize
what to improve. But, if you really need to click `No` then the choice will be written to the XML Notepad settings file
and it will not be prompted again. Analytics can be enabled or disabled any time using the `Allow analytics` option in
the [Options dialog](options.md).
We appreciate those who allow analytics to be collected; significantly aids in understanding usage patterns and
prioritizing improvements. However, if you prefer not to participate, click `No` then your preference will be written to
the XML Notepad settings file, and the prompt will not reappear. You can enable or disable analytics at any time using the
`Allow analytics` option in the [Options dialog](options.md).

If you want to disable analytics before installing XML Notepad (perhaps in an enterprise wide distribution) then you can
set this environment system wide on the end user's machine:
For enterprise-wide distributions or pre-installation customization, you can set the following environment variable
system-wide on the end user's machine:

```
set XML_NOTEPAD_DISABLE_ANALYTICS=1
```

You can also disable the Analytics UI option from appearing in the [Options dialog](options.md) by setting the
Additionally, you can disable the Analytics UI option from appearing in the [Options dialog](options.md) by setting the
`AnalyticsClientId` to disabled in the default [XmlNotepad.settings](settings.md) file as follows:
```xml
<Settings>
Expand All @@ -51,4 +51,4 @@ You can also disable the Analytics UI option from appearing in the [Options dial
</Settings>
```

This ensures the user cannot enable analytics after starting XML notepad.
This ensures that users cannot enable analytics after starting XML Notepad.
10 changes: 5 additions & 5 deletions docs/help/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Cut/Copy/Paste and [Drag/drop](dragdrop.md) are based on the same XML clipboard
out of XML Notepad and into any editor that supports a text clipboard format and its the same as doing a Cut & Paste
operation.

The clipboard format is the XML serialization of the selected node plus any namespace declarations needed to make that
fragment well formed.
The clipboard format is the XML serialization of the selected node, along with any necessary any namespace declarations
needed to ensure the fragment well formed.

When XML is pasted from the clipboard (or dropped) onto the [tree view](overview.md) the namespace declarations are
matched with what is in the target document already and normalized accordingly. This ensures your document doesn't
sprout lots of redundant namespace declarations as a side effect of these editing operations.
When XML is pasted from the clipboard (or dropped) onto the [tree view](overview.md), the namespace declarations are
matched those already present in the target document and normalized accordingly. This prevents your document from
accumulating redundant namespace declarations as a side effect of these editing operations.
29 changes: 15 additions & 14 deletions docs/help/customeditors.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@

## Custom Editors

If an XML schema is provided for validation then that schema can also define custom editors on specific
If an XML schema is provided for validation, it can also define custom editors on specific
`<xsd:simpleType>` tags.

A default custom editor is provided for the simpleTypes xsd:date xsd:dateTime and xsd:time. Any element or attribute of
this type will be edited using the WinForms DateTimePicker, configured for the current system locale, for example:
A default custom editor is provided for the simpleTypes `xsd:date`, `xsd:dateTime`, and `xsd:time`. Any element or
attribute of this type will be edited using the WinForms DateTimePicker, configured for the current system locale, for
example:


![datetime](../assets/images/datetime.jpg)

## Custom Builders

Custom Builders provide a button that appears at the top of the intellisense list, when the user clicks on that button
it invokes the builder to edit the value, which usually pops up a modal dialog.
Custom Builders provide a button that appears at the top of the intellisense list. When the user clicks on that button,
it invokes the builder to edit the value, typically triggering a modal dialog.

A custom builder for editing file names is provided and is automatically associated with the xsd:anyURI data type. You
can associate this builder manually using the `vs:builder="XmlNotepad.UriBuilder">` attribute. When you edit an element
of this type a button will appear titled "Browse..." at the top of the intellisense list and when you click on this
button the WinForms OpenFileDialog will appear.
of this type, a button titled "Browse..." will appear at the top of the intellisense list, and clicking it will open
the WinForms OpenFileDialog.

A custom builder for editing colors is provided. But since there is no standard color type defined in XSD, you must
specify the vs:builder attribute as shown in the following example:
A custom builder for editing colors is also provided. However, since there is no standard color type defined in XSD, you must
specify the `vs:builder` attribute as shown in the following example:

```xml
<xsd:simpleType name="color" vs:builder="XmlNotepad.ColorBuilder">
```
Where the "vs" prefix is bound to the following namespace:
Where the `vs` prefix is bound to the following namespace:
`xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense"`.

If you build your own custom editors you will also need to specify the `vs:assembly="FontBuilder, Version=1.0.0.0,
If you build your own custom editors, you will also need to specify the `vs:assembly="FontBuilder, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=007b972e7cff2ded, processorArchitecture=MSIL"` attribute to point to your assembly. XML
Notepad will then load your assembly so it can find the specified types.

![Colors](../assets/images/colors.jpg)

When you edit an element of this type a button will appear titled "Color Picker" at the top of the intellisense list and
when you click on this button the WinForms ColorDialog will appear. The resulting color will then be serialized back to
When you edit an element of this type a button titled "Color Picker" will appear at the top of the intellisense list and
and clicking on it will open the WinForms ColorDialog. The resulting color will then be serialized back to
the XML string using the `ColorConverter`.

You can implement your own builders by implementing `IXmlBuilder `and specifying your full class name in the
You can implement your own builders by implementing `IXmlBuilder` and specifying your full class name in the
`vs:builder` attribute.

See also [Schemas Dialog](schemas.md).
26 changes: 13 additions & 13 deletions docs/help/dragdrop.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

## Drag/Drop Support

You can drag and drop nodes from the tree view to move them around inside the document or across documents using
You can drag and drop nodes from the tree view to rearrange them within the document or more them across documents using
multiple instances of XML Notepad. (Note: You can easily create a new instance of XML Notepad by selecting the
Window/New Window menu item). You can also drag an XML file from Windows Explorer onto XML Notepad as a quick way to
open that file.
Window/New Window menu item). Additionally, you can drag an XML file from Windows Explorer onto XML Notepad as a quick
way to open that file.

When you Drag/Drop nodes across programs, it uses the same text format as [Cut/Copy/Paste](clipboard.md).
When you drag and drop nodes across programs, it uses the same text format as [Cut/Copy/Paste](clipboard.md).

When dragging the selected element a shadow node will appear in the tree that moves with the cursor showing you where
the node will be moved to. In the example below, the "Street" element is being dragged to a new location after the
As you drag the selected element, a shadow node will appear in the tree, moving with the cursor to indicate where
the node will be placed. In the example below, the "Street" element is being dragged to a new location after the
"First" element and before the "Middle" element:

![DragDrop](../assets/images/dragdrop.jpg)

When you hover the mouse over a collapsed node it is automatically expanded just in case you are trying to drop the node
inside that collapsed container and conversely, when you hover over an expanded node it is automatically collapsed so
that you can easily find nodes above or below that container.
When hovering the mouse over a collapsed node, automatically expands to facilitate dropping the node inside that
collapsed container. Conversely, when hovering over an expanded node, it automatically collapses, aiding in finding
nodes above or below that container.

Dragging is a move operation by default, even across XML Notepad instances, which means if you drag a node from one XML
Notepad instance to another it will be removed from the first instance. If you want to perform a copy operation, hold
down the CONTROL key.
By default, dragging is a move operation, even across XML Notepad instances, meaning if you drag a node from one XML
Notepad instance to another, it will be removed from the first instance. If you wish to perform a copy operation
instead, hold down the CONTROL key.

See [Keyboard](keyboard.md) for more information.
See [Keyboard](keyboard.md) for more information.
4 changes: 2 additions & 2 deletions docs/help/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
When you have an associated [XSD schema](schemas.md), the `xsd:documentation` associated with the current node is
displayed in a tooltip popup and in the Dynamic Help Tab.

For example, the `Employee.xsd` schema contains the following annotation on the defintion of the Employee Id attribute:
For example, the `Employee.xsd` schema contains the following annotation on the definition of the Employee Id attribute:

```xml
<xs:simpleType name="EmployeeID">
Expand All @@ -17,7 +17,7 @@ For example, the `Employee.xsd` schema contains the following annotation on the
</xs:simpleType>
```

Now if you open Employee.xml and select the Employee Id attribute you will see this annotation listed in the Dynamic
Now, if you open Employee.xml and select the Employee Id attribute you will see this annotation listed in the Dynamic
Help tab as follows:

![annotations](../assets/images/annotations.png)
Expand Down
44 changes: 23 additions & 21 deletions docs/help/fileassociation.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
## XML Notepad File Association

See the following video that shows how to associate XML Notepad with various .xml file types:
Watch the following video tutorial to learn how to associate XML Notepad with various .xml file types:

[Youtube Video](https://youtu.be/n-6sSUSlN34)
[YouTube Video](https://youtu.be/n-6sSUSlN34)

The general approach that works is to do the following:
Here's a step-by-step guide:

1. Open the XML Notepad that you installed already.
2. Select Help/Open Sample... and select "Hamlet.xml"
3. You will see a long file path in the address bar like this:
1. Open XML Notepad, which you have already installed.
2. Navigate to Help > Open Sample... and select "Hamlet.xml".
3. Note the long file path displayed in the address bar, such as:

> C:\Program Files\WindowsApps\43906ChrisLovett.XmlNotepad_2.9.0.5_neutral__hndwmj480pefj\Application\Samples\Hamlet.xml
```
C:\Program Files\WindowsApps\43906ChrisLovett.XmlNotepad_2.9.0.5_neutral__hndwmj480pefj\Application\Samples\Hamlet.xml
```

If you open this path in Windows Explorer you can locate XmlNotepad.exe here:

> C:\Program Files\WindowsApps\43906ChrisLovett.XmlNotepad_2.9.0.5_neutral__hndwmj480pefj\Application\XmlNotepad.exe
```
C:\Program Files\WindowsApps\43906ChrisLovett.XmlNotepad_2.9.0.5_neutral__hndwmj480pefj\Application\XmlNotepad.exe
```
Copy this path to the clipboard.

Now use the start menu to find the "Default apps" settings dialog.

Enter the file type at the top (e.g. type in ".xsd" or ".xslt"), then click the button labelled `+ Choose a default`.

Scroll to the bottom of this dialog and click `Choose an app on your PC`

And paste in the path you coped to the clipboard earlier. Click `Open` then click `Set Default`.
Now, follow these steps:
- Open the "Default apps" settings dialog using the start menu.
- Enter the file type at the top (e.g., type in ".xsd" or ".xslt").
- Click the button labeled `+ Choose a default`.
- Scroll to the bottom of this dialog and click `Choose an app on your PC`.
- Paste in the path you copied to the clipboard earlier.
- Click `Open`, then click `Set Default`.

As soon as you do this the icon on the file type you associated should change in Windows Explorer showing the XML
Notepad icon and when you double click the file it will automatically open XML Notepad.
As soon as you do this, the icon on the file type you associated should change in Windows Explorer showing the XML
Notepad icon, and when you double click the file, it will automatically open XML Notepad.

Note that when you have done one extension, all the other extensions are much easier because XML Notepad will now show
up in the list of possible apps to choose.

The path you have registered here is version specific so you may have to repeat this process when you install new
versions of XML Notepad.
Keep in mind that the path you have registered here is version specific, so you may have to repeat this process when you
install new versions of XML Notepad.
34 changes: 17 additions & 17 deletions docs/help/find.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@

## Find/Replace

The "Find..." item under the [Edit Menu](menus.md) (CTRL+F) brings up the following dialog:
Selecting the "Find..." item under the [Edit Menu](menus.md) (CTRL+F) opens the following dialog:

![Find](../assets/images/find.png)

The "Replace..." item under the [Edit Menu](menus.md) (CTRL+H) changes this dialog to show the extra replace fields:
Choosing "Replace..." item under the [Edit Menu](menus.md) (CTRL+H) modifies this dialog to display additional replace
fields:

![Find](../assets/images/replace.png)

By default this dialog will allow you to search "Everything" in the current XML document with a given find string. You
can limit the search in the following ways:
By default this dialog will allow you to search "Everything" in the current XML document with a specified find string.
You can refine the search using the following options:

**Match case**: This will only find nodes that contain the exact search string in the same case.
**Match case**: Only find nodes that contain the exact search string in the same case.

**Match whole word**: this will only find nodes that contain the search string as a complete word, i.e., not a
**Match whole word**: Only find nodes that contain the search string as a complete word, i.e., not a
substring.

**Use Regular Expressions**: this will treat the find string as a regular expression. See .NET regular expressions for
**Use Regular Expressions**: Treats the find string as a regular expression. See .NET regular expressions for
help with the regular expression language.

**Use XPath**: this option allows you to find nodes using an XPath expression. When you choose this option an extra
table appears where you can edit the namespace prefix mappings used in the XPath expression. See [XPath
**Use XPath**: Allows you to find nodes using an XPath expression. Choosing this option reveals an extra table
where you can edit the namespace prefix mappings used in the XPath expression. See [XPath
Syntax](https://docs.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/ms256471(v=vs.100)?redirectedfrom=MSDN)
for help with the XPath expression language.

![Find](../assets/images/findxpath.png)

**Search Filter**: this option allows you to limit the search to just "Names" which means only search node names, or
**Search Filter**: Limits the search to just "Names" which means only search node names, or
"Text" which means only search node values, or "Comments" which means only search comment nodes.

**Direction**: this allows you to search backwards from the current location in the document ("Up") or forwards
("Down").
**Direction**: Determines the search direction: "Up" (backwards from the current location) or "Down" (forwards).

**Find Next**: this button finds the next matching node in the specified direction after the currently selected node and
it highlights the matching substring within the node name or value.
**Find Next**: Finds the next matching node in the specified direction after the currently selected node and
highlights the matching substring within the node name or value.

**Replace**: this button finds the next matching node in the specified direction after the currently selected node and
if it finds something it replaces it with the replace text.
**Replace**: Finds the next matching node in the specified direction after the currently selected node and
replaces it with the specified replace text.

**Replace All**: this button replaces all matching text with the replace text.
**Replace All**: Replaces all matching text with the specified replace text.
Loading

0 comments on commit 677cecb

Please sign in to comment.