Exemple #1
0
 public void UnsubscribeEventHandler(IInternalControl aThisControl, string aEventName, EventHandler aHandler)
 {
     var handler = iEventHandlers[aEventName];
     handler -= aHandler;
     iEventHandlers[aEventName] = handler;
     if (handler == null)
     {
         aThisControl.BrowserTab.Send(new JsonObject { { "type", "xf-unsubscribe" }, { "control", aThisControl.Id }, { "event", aEventName } });
     }
 }
Exemple #2
0
 public void SubscribeEventHandler(IInternalControl aThisControl, string aEventName, EventHandler aHandler)
 {
     EventHandler handler;
     iEventHandlers.TryGetValue(aEventName, out handler);
     if (handler == null)
     {
         aThisControl.BrowserTab.Send(new JsonObject { { "type", "xf-subscribe" }, { "control", aThisControl.Id }, { "event", aEventName } });
     }
     handler += aHandler;
     iEventHandlers[aEventName] = handler;
 }
 public void Set(IInternalControl aThisControl, Slice aSlice, List<IControl> aChildren)
 {
     var slice = aSlice.MakeAbsolute(iChildren.Count);
     if (slice.Count > 0)
     {
         iChildren.RemoveRange(slice.Start, slice.Count);
     }
     var childIds = new JsonArray();
     if (aChildren != null && aChildren.Count > 0)
     {
         iChildren.InsertRange(slice.Start, aChildren);
         foreach (var child in aChildren)
         {
             childIds.Add(child.Id);
         }
     }
     aThisControl.BrowserTab.Send(
         new JsonObject {
             { "type", "xf-bind-slice" },
             { "start", slice.Start },
             { "end", slice.End },
             { "control", aThisControl.Id },
             { "children", childIds } });
 }
Exemple #4
0
 public void SetProperty(IInternalControl aThisControl, string aName, JsonValue aValue)
 {
     iProperties[aName] = aValue;
     aThisControl.BrowserTab.Send(new JsonObject { { "type", "xf-set-property" }, { "control", aThisControl.Id }, { "property", aName }, { "value", aValue } });
 }
 public void Set(IInternalControl aThisControl, int aIndex, IControl aChild)
 {
     Set(aThisControl, Slice.Single(aIndex), new List<IControl>{aChild});
 }
 public void SetSlot(IInternalControl aThisControl, string aSlot, IControl aChild)
 {
     iSlots[aSlot] = aChild;
     aThisControl.BrowserTab.Send(new JsonObject { { "type", "xf-bind-slot" }, { "control", aThisControl.Id }, {"slot", aSlot}, { "child", aChild.Id } });
 }