當前位置: 首頁>>代碼示例>>C#>>正文


C# Dom.ChildEventArgs類代碼示例

本文整理匯總了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();
     }           
 }
開發者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


注:本文中的Sce.Atf.Dom.ChildEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。