Table of Contents

Object Management Menu Button

The menu button represent the target object. The target object generally is IMakeXmlSource.

The target object has the following functions:

If the target object is not IMakeXmlSource, then the XML Editor Panel Mode should not appear. The other functions are still buildable.

Don't use GenMode.Default on XFactory functions. Use GenMode.Rebase. Since GenMode.Default pass the inner exception silently.

Layout

  • Object Management Menu Button
    • Load Button
    • Load Resource Button
    • Save As Button
    • (splitter)
    • Copy Button (with hotkey support if the Object Management Menu Button is focused)
    • Paste Button (with hotkey support if the Object Management Menu Button is focused)
    • (splitter)
    • GUI Ratio Button
    • XML Ratio Button
Tip
  • Since the Object Management Menu Button has special meaning, use icon instead of text label.
  • Do not use icon on the other child buttons. The icons gains nothing but hard to keep style to the full application.
  • If the model is selected, show a different style (may be color) on the menu button.
  • The model should contain a ResourceDirectory property.
  • Do not show Load Resource Button if Resource directory not explicitly gave.

Copy & Paste

  • Object Copy/Paste (i.e. Select/Set or Duplicated-Set)
    • Copy (i.e. Select) Set the model to UserEnv.SelectedItem.
    • Paste Set UserEnv.SelectedItem to the model. Set by reference is default. Apply Duplicated-Set if explicitly required.

While a object is copied (selected) here, it can also be paste (drag) to:

Show message when paste action success or failed. See Handle Message and Exception.

If the data type is not matched, show the un-matched message.

Editor Panel Mode Ratio Button

The Editor Panel switched by the Editor Panel Mode Ratio Button.

The BaseDirectory and RelFile properties should exist. Use the RelFile property if the object's host has the corresponding property like XXXFile.

The Apply action should be well-set. Include SetFileDelegate from XFactory.Gen<T>(XElement, string, SetFileDelegate, GenMode, params object[]) function. The last argument should also be delivered by the host. So there must exist an property to pass the argument.

XML Editor Panel Layout

  • XML Editor Panel
    • Cancel Button
    • Apply Button
    • XML TextArea

Shows error message if the xml-parsing or object creation failed on XML Editor Panel Apply Button applied.

Single-User WPF Application Source Code Path

  • Common/ObjectManagementMenuButton

see this page for git repository.