protected virtual SlotDefinition InnerAddSlot(SlotDefinition slot, bool riseEvent, bool replace) { if (CheckReadOnlyScheme()) return null; if (slot != null && slot.Name != null && slot.Name != "") { bool f = false; lock (InnerSlots) { if (!InnerSlots.ContainsKey(slot.Name)) { InnerSlots.Add(slot.Name, slot); f = true; } else if (replace) { InnerSlots[slot.Name] = slot; f = true; } } if (f) { // производим вызов события вне критической секции! if (slot.DeclaredClass == null) { // это потом как проверять? может в DeclaredClass писать сугубо Version? slot.DeclaredClass = (CopyExtensions) ? Name : FullName; slot.ParentNode = this; } if (slot.ParentNode == null) slot.ParentNode = this; // XXX но до этого не должно дойти! if (riseEvent) OnSlotListChanged(ListChangeType.Add, slot); } return slot; } return null; }
public SlotErrorEventArgs(Exception ex, SlotDefinition slot, object value) : base(slot, value) { Exception = ex; }
public virtual SlotDefinition AddSlot(SlotDefinition slot) { return InnerAddSlot(slot, true, true); }
public SlotChangeEventArgs(SlotDefinition slot, object value) { Value = value; Slot = slot; if (slot != null) SlotName = slot.Name; }