本文整理汇总了C#中Sce.Atf.Dom.ChildEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ChildEventArgs类的具体用法?C# ChildEventArgs怎么用?C# ChildEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChildEventArgs类属于Sce.Atf.Dom命名空间,在下文中一共展示了ChildEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DomNode_ChildRemoved
private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
if (e.Parent == DomNode)
{
CheckScaleFlags();
}
}
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:7,代码来源:GameObjectGroup.cs
示例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);
}
开发者ID:Joxx0r,项目名称:ATF,代码行数:11,代码来源:Validator.cs
示例3: DomNode_ChildRemoved
private void DomNode_ChildRemoved(object sender, ChildEventArgs e)
{
if (e.Child.Type == Schema.transitionType.Type)
{
m_routingInvalid = true;
}
}
开发者ID:vincenthamm,项目名称:ATF,代码行数:7,代码来源:TransitionRouter.cs
示例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);
}
开发者ID:Joxx0r,项目名称:ATF,代码行数:11,代码来源:BoundsValidator.cs
示例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());
}
}
}
}
开发者ID:vincenthamm,项目名称:ATF,代码行数:25,代码来源:MasteringValidator.cs
示例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());
}
}
}
}
}
开发者ID:sbambach,项目名称:ATF,代码行数:34,代码来源:StatechartValidator.cs
示例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");
}
}
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:7,代码来源:PrefabInstance.cs
示例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;
}
开发者ID:sbambach,项目名称:ATF,代码行数:10,代码来源:DomTest.cs
示例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());
}
}
}
开发者ID:vincenthamm,项目名称:ATF,代码行数:16,代码来源:MasteringValidator.cs
示例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();
}
}
}
}
}
开发者ID:vincenthamm,项目名称:ATF,代码行数:39,代码来源:TemplatingContext.cs
示例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));
}
}
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:7,代码来源:DomExplorer.cs
示例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));
}
}
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:8,代码来源:DomExplorer.cs
示例13: DomNode_ChildInserted
void DomNode_ChildInserted(object sender, ChildEventArgs e)
{
ItemInserted.Raise(this, new ItemInsertedEventArgs<object>(e.Index, e.Child, e.Parent));
}
开发者ID:arsaccol,项目名称:LevelEditor,代码行数:4,代码来源:LayeringContext.cs
示例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));
}
开发者ID:BeRo1985,项目名称:LevelEditor,代码行数:5,代码来源:LayeringContext.cs
示例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));
}
}
开发者ID:sbambach,项目名称:ATF,代码行数:8,代码来源:EventSequenceContext.cs
示例16: CollectionChildInserted
private void CollectionChildInserted(object sender, ChildEventArgs e)
{
if (e.Child.Type != SledSchema.SledProjectFilesBreakpointType.Type)
return;
var bp = e.Child.As<SledProjectFilesBreakpointType>();
// Fire event
OnBreakpointAdded(new SledBreakpointServiceBreakpointEventArgs(bp));
}
开发者ID:arsaccol,项目名称:SLED,代码行数:10,代码来源:SledBreakpointService.cs
示例17: CollectionChildRemoving
private void CollectionChildRemoving(object sender, ChildEventArgs e)
{
if (e.Child.Type != SledSchema.SledProjectFilesBreakpointType.Type)
return;
var bp = e.Child.As<SledProjectFilesBreakpointType>();
// Fire event
OnBreakpointRemoving(new SledBreakpointServiceBreakpointEventArgs(bp));
if (m_bPreserveOpenDocumentBreakpoints)
return;
// Try and remove breakpoints from the
// corresponding open document (if any)
var sd = bp.File.SledDocument;
if (sd == null)
return;
// Preserve previous value
var bValue = m_bAddingOrRemoving;
// Make sure SledDocument breakpoint events won't fire
m_bAddingOrRemoving = true;
// Verify breakpoint on line in open document & remove if so
if (sd.IsBreakpointSet(bp.Line))
sd.Editor.Breakpoint(bp.Line, false);
// Reset to previous value
m_bAddingOrRemoving = bValue;
}
开发者ID:arsaccol,项目名称:SLED,代码行数:32,代码来源:SledBreakpointService.cs
示例18: test_ChildInserted
void test_ChildInserted(object sender, ChildEventArgs e)
{
ChildInsertedArgs = e;
}
开发者ID:cococo111111,项目名称:ATF,代码行数:4,代码来源:TestDomNode.cs
示例19: OnChildRemoved
/// <summary>
/// Performs custom actions after a child is removed from the DOM node subtree</summary>
/// <param name="sender">Sender (root DOM node)</param>
/// <param name="e">Child event args</param>
protected override void OnChildRemoved(object sender, ChildEventArgs e)
{
RemoveSubtree(e.Child);
if (!m_undoingOrRedoing && e.Child.Is<Wire>())
UpdateGroupPinConnectivity(e.Child.Cast<Wire>());
}
开发者ID:vincenthamm,项目名称:ATF,代码行数:10,代码来源:CircuitValidator.cs
示例20: TestChildRemoveEvents
public void TestChildRemoveEvents()
{
DomNodeType type = new DomNodeType("type");
ChildInfo info = new ChildInfo("child", type);
ChildInfo infoList = new ChildInfo("childList", type, true);
type.Define(info);
type.Define(infoList);
DomNode test = new DomNode(type);
test.ChildRemoving += new EventHandler<ChildEventArgs>(test_ChildRemoving);
test.ChildRemoved += new EventHandler<ChildEventArgs>(test_ChildRemoved);
// test child
DomNode child = new DomNode(type);
test.SetChild(info, child);
ChildRemovingArgs = null;
ChildRemovedArgs = null;
test.SetChild(info, null);
ChildEventArgs expected = new ChildEventArgs(test, info, child, 0);
Assert.True(Equals(ChildRemovingArgs, expected));
Assert.True(Equals(ChildRemovedArgs, expected));
// test inserting a child when there is one there already
test.SetChild(info, child);
DomNode newChild = new DomNode(type);
ChildRemovingArgs = null;
ChildRemovedArgs = null;
test.SetChild(info, newChild);
expected = new ChildEventArgs(test, info, child, 0);
Assert.True(Equals(ChildRemovingArgs, expected));
Assert.True(Equals(ChildRemovedArgs, expected));
// test child list
IList<DomNode> list = test.GetChildList(infoList);
DomNode child2 = new DomNode(type);
list.Add(child2);
DomNode child3 = new DomNode(type);
list.Add(child3);
ChildRemovingArgs = null;
ChildRemovedArgs = null;
list.Remove(child3);
expected = new ChildEventArgs(test, infoList, child3, 1);
Assert.True(Equals(ChildRemovingArgs, expected));
Assert.True(Equals(ChildRemovedArgs, expected));
ChildRemovingArgs = null;
ChildRemovedArgs = null;
list.Remove(child2);
expected = new ChildEventArgs(test, infoList, child2, 0);
Assert.True(Equals(ChildRemovingArgs, expected));
Assert.True(Equals(ChildRemovedArgs, expected));
}
开发者ID:cococo111111,项目名称:ATF,代码行数:50,代码来源:TestDomNode.cs
注:本文中的Sce.Atf.Dom.ChildEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论