/// <summary>Tests the visualizer (see remarks at the head of this class).</summary>
 public static void TestVisualizer(IBplCollection source) {
    var dbg = new VisualizerDevelopmentHost(source, typeof(BplDebuggerVisualizer), typeof(BplDebuggeeObjectSource));
    dbg.ShowVisualizer();
 }
Exemple #2
0
 // serializes a container (collection)
 private void _serializeContainer(XElement element, BplProperty property, IBplCollection bplCollection) {
    var count = 0;
    var collection = new XElement(property.TagName);
    var targetClass = property.ReferencedClass;
    foreach (var bplObject in bplCollection.OfType<BplObject>()) {
       _serializeObject(collection, bplObject, targetClass);
       count++;
    }
    if (count > 0) {
       element.Add(collection);
    }
 }
Exemple #3
0
 // serializes an association (collection)
 private void _serializeAssociation(XElement element, BplProperty property, IBplCollection bplCollection) {
    var count = 0;
    var association = new XElement(property.TagName);
    var idTagName = XNamespaces.none + BplPrimitive.Get<BplIdentity>().TagName.LocalName;
    foreach (var bplObject in bplCollection.OfType<BplObject>()) {
       try {
          association.Add(new XElement(idTagName, Verifier.ToReference(bplObject, property)));
          count++;
       } catch (BplRuntimeException e) {
          AddException(e);
       }
    }
    if (count > 0) {
       element.Add(association);
    }
 }
Exemple #4
0
 // serializes an association (collection)
 private void _serializeAssociation(BplProperty property, IBplCollection bplCollection) {
    _output.Indent("[");
    var collection = bplCollection.OfType<BplObject>().ToArray();
    for (int i = 0, N = collection.Length; i < N; i++) {
       _output.BeginClause(null);
       _serializeAssociation(property, collection[i]);
       _output.EndClause(i == N - 1);
    }
    _output.Outdent("]");
 }