namespace MonkeyDoc
{
+ public enum SortType {
+ Caption,
+ Element
+ }
+
//
// The HelpSource class keeps track of the archived data, and its
// tree
return "dummy:";
}
}
+
+ public virtual SortType SortType {
+ get {
+ return SortType.Caption;
+ }
+ }
/// <summary>
/// Returns a stream from the packaged help source archive
Node parent;
List<Node> nodes;
Dictionary<string, Node> childrenLookup;
+ bool elementSort;
/* Address has three types of value,
* _ 0 is for no on-disk representation
* _ >0 is a valid address that is loaded immediately
this.tree = tree;
this.caption = caption;
this.element = element;
+ this.elementSort = tree.HelpSource != null && tree.HelpSource.SortType == SortType.Element;
}
/// <summary>
{
this.address = address;
this.tree = tree;
+ this.elementSort = tree.HelpSource != null && tree.HelpSource.SortType == SortType.Element;
if (address > 0)
LoadNode ();
}
EnsureLoaded ();
other.EnsureLoaded ();
- var cap1 = caption;
- var cap2 = other.caption;
+ var cap1 = elementSort ? element : caption;
+ var cap2 = elementSort ? other.element : other.caption;
/* Some node (notably from ecmaspec) have number prepended to them
* which we need to sort better by padding them to the same number