本文整理汇总了C#中Sce.Atf.Dom.ChildEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ChildEventArgs类的具体用法?C# ChildEventArgs怎么用?C# ChildEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChildEventArgs类属于Sce.Atf.Dom命名空间,在下文中一共展示了ChildEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DomNode_ChildRemoved
private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
if (e.Parent == DomNode)
{
CheckScaleFlags();
}
}
示例2: OnChildInserted
/// <summary>
/// Performs custom actions after a child is inserted into the DOM subtree</summary>
/// <param name="sender">Sender (root DOM node)</param>
/// <param name="e">Child event args</param>
protected override void OnChildInserted(object sender, ChildEventArgs e)
{
// if it's a ref, make sure the referenced resource is in this package
UIRef uiRef = e.Child.As<UIRef>();
if (uiRef != null)
m_referenceInserts.Add(e);
}
示例3: DomNode_ChildRemoved
private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
if (e.Child.Type == Schema.transitionType.Type)
{
m_routingInvalid = true;
}
}
示例4: OnChildRemoved
/// <summary>
/// Raises the ChildRemoved event and performs custom processing</summary>
/// <param name="sender">Event sender</param>
/// <param name="e">ChildEventArgs containing event data</param>
protected override void OnChildRemoved(object sender, ChildEventArgs e)
{
if (Validating)
m_layoutInvalid = true;
base.OnChildRemoved(sender, e);
}
示例5: DomNodeOnChildRemoving
private void DomNodeOnChildRemoving(object sender, ChildEventArgs e)
{
if (Validating)
{
// removing a module from a sub-circuit?
Element element = e.Child.As<Element>();
SubCircuit subCircuit = e.Parent.As<SubCircuit>();
if (element != null &&
subCircuit != null)
{
ICircuitElementType type = element.Type;
// todo: this test isn't quite right, because not all circuit elements
// necessarily have both inputs and outputs. For example, if the Speaker
// element from the Circuit Editor sample app is the only element in a Master,
// and then it is deleted, that will trigger this exception.
if (type.Inputs.Count + type.Outputs.Count == 1)
{
// Ensures that sub-circuit inputs/outputs aren't added or removed, as this would
// invalidate wiring on instances of them.
throw new InvalidTransactionException(
"Can't remove connectors from sub-circuits".Localize());
}
}
}
}
示例6: DomNode_ChildInserting
private void DomNode_ChildInserting(object sender, ChildEventArgs e)
{
// check pseudo-state constraints
StateBase state = e.Child.As<StateBase>();
if (state != null && state.IsPseudoState)
{
Statechart statechart = e.Parent.As<Statechart>();
CheckUniqueness(statechart, state.Type);
}
else
{
// check state transition constraints
Transition transition = e.Child.As<Transition>();
if (transition != null)
{
if (transition.FromState.IsPseudoState)
{
if (transition.FromState.Type == StateType.Final)
{
throw new InvalidTransactionException(
"Can't have a transition from the final state".Localize());
}
}
if (transition.ToState.IsPseudoState)
{
if (transition.ToState.Type == StateType.Start)
{
throw new InvalidTransactionException(
"Can't have a transition to the start state".Localize());
}
}
}
}
}
示例7: DomNodeStructureChanged
private void DomNodeStructureChanged(object sender, ChildEventArgs e)
{
if (!m_updating && e.ChildInfo.Equivalent(Schema.prefabInstanceType.gameObjectChild))
{
throw new InvalidTransactionException("Structure of PrefabInstance cannot be changesd");
}
}
示例8: Equals
public static bool Equals(ChildEventArgs e1, ChildEventArgs e2)
{
if (e1 == null || e2 == null)
return (e1 == e2);
return
e1.Parent == e2.Parent &&
e1.ChildInfo == e2.ChildInfo &&
e1.Child == e2.Child &&
e1.Index == e2.Index;
}
示例9: DomNodeChildInserting
private void DomNodeChildInserting(object sender, ChildEventArgs e)
{
if (Validating)
{
// inserting an instance of a sub-circuit into itself?
SubCircuitInstance subCircuitInstance = e.Child.As<SubCircuitInstance>();
SubCircuit subCircuit = e.Parent.As<SubCircuit>();
if (subCircuitInstance != null &&
subCircuit != null &&
subCircuitInstance.SubCircuit == subCircuit)
{
throw new InvalidTransactionException(
"Can't use a sub-circuit inside itself".Localize());
}
}
}
示例10: DomNode_ChildRemoved
private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
// if a template is deleted, turn template references into copy-instances
if (!IsMovingItems && e.Child.Is<Template>())
{
// we can use the ReferenceValidator which is attached to this (root) node to get all the references.
// note reference validation will happen later at the end of the transaction to remove the dangling references
var refValidator = this.As<ReferenceValidator>();
DomNode target = e.Child.Cast<Template>().Target;
foreach (var reference in refValidator.GetReferences(target))
{
var targetCopies = DomNode.Copy(new[] { target }); // DOM deep copy
var copyInstance = targetCopies[0].Cast<Element>();
var templateInstance = reference.First.Cast<Element>();
copyInstance.Position = templateInstance.Position;
var circuitContainer = reference.First.Parent.Cast<ICircuitContainer>();
circuitContainer.Elements.Add(copyInstance);
// reroute original edges
foreach (var wire in circuitContainer.Wires)
{
if (wire.InputElement == templateInstance)
{
wire.InputElement = copyInstance;
wire.InputPin = copyInstance.Type.Inputs[wire.InputPin.Index];
wire.SetPinTarget();
}
if (wire.OutputElement == templateInstance)
{
wire.OutputElement = copyInstance;
wire.OutputPin = copyInstance.Type.Outputs[wire.OutputPin.Index];
wire.SetPinTarget();
}
}
}
}
}
示例11: root_ChildRemoved
private void root_ChildRemoved(object sender, ChildEventArgs e)
{
if (m_lastRemoveIndex >= 0)
{
ItemRemoved.Raise(this, new ItemRemovedEventArgs<object>(m_lastRemoveIndex, e.Child, e.Parent));
}
}
示例12: root_ChildInserted
private void root_ChildInserted(object sender, ChildEventArgs e)
{
int index = GetChildIndex(e.Child, e.Parent);
if (index >= 0)
{
ItemInserted.Raise(this, new ItemInsertedEventArgs<object>(index, e.Child, e.Parent));
}
}
示例13: DomNode_ChildInserted
void DomNode_ChildInserted(object sender, ChildEventArgs e)
{
ItemInserted.Raise(this, new ItemInsertedEventArgs<object>(e.Index, e.Child, e.Parent));
}
示例14: DomNode_ChildRemoved
void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
if (IsLayerItem(e.Child))
ItemRemoved.Raise(this, new ItemRemovedEventArgs<object>(e.Index, e.Child, e.Parent));
}
示例15: DomNode_ChildRemoved
private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
Event _event = e.Child.As<Event>();
if (_event != null)
{
ItemRemoved.Raise(this, new ItemRemovedEventArgs<object>(e.Index, _event));
}
}