コード例 #1
0
        public override void Execute()
        {
            if (!StateCommuter.Current.IsGetObject)
            {
                StateCommuter.CreateInstanceOfCurrentXamlTypeIfNotCreatedBefore();
                StateCommuter.PutNameToCurrentInstanceIfAny();

                var instance = StateCommuter.Current.Instance;

                if (instance is IMarkupExtension)
                {
                    ProcessCurrentInstanceValueWithMarkupExtension();
                }
                else if (!StateCommuter.WasAssociatedRightAfterCreation)
                {
                    StateCommuter.AssociateCurrentInstanceToParent();
                }

                StateCommuter.RegisterInstanceNameToNamescope();
                lifyCycleListener.OnAfterProperties(instance);
                lifyCycleListener.OnEnd(instance);
            }

            setResult(StateCommuter);

            StateCommuter.DecreaseLevel();
        }
コード例 #2
0
        public override void Execute()
        {
            if (!StateCommuter.Current.IsGetObject)
            {
                StateCommuter.CreateInstanceOfCurrentXamlTypeIfNotCreatedBefore();

                if (StateCommuter.Current.Instance is IMarkupExtension)
                {
                    object        val           = StateCommuter.GetValueProvidedByMarkupExtension((IMarkupExtension)StateCommuter.Current.Instance);
                    StateCommuter tempQualifier = StateCommuter;
                    tempQualifier.Current.Instance = val;

                    var collection = val as ICollection;
                    if (collection != null)
                    {
                        tempQualifier.Current.Collection = collection;
                    }
                    StateCommuter.AssociateCurrentInstanceToParent();
                }
                else if (!StateCommuter.Current.WasInstanceAssignedRightAfterBeingCreated)
                {
                    StateCommuter.AssociateCurrentInstanceToParent();
                }
            }

            Assembler.Result = StateCommuter.Current.Instance;

            StateCommuter.DecreaseLevel();
        }
コード例 #3
0
 private void CreateInstanceOfCurrentTypeAndAssociateIfPossible()
 {
     StateCommuter.CreateInstanceOfCurrentXamlTypeIfNotCreatedBefore();
     if (!StateCommuter.WasAssociatedRightAfterCreation)
     {
         StateCommuter.AssociateCurrentInstanceToParentForCreation();
     }
 }
コード例 #4
0
        private void AccommodateLevelsForIncomingChildren()
        {
            StateCommuter.CreateInstanceOfCurrentXamlTypeIfNotCreatedBefore();
            var instance = StateCommuter.Current.Instance;

            var collection = instance as ICollection;

            if (collection != null)
            {
                StateCommuter.Current.Collection = collection;
            }
        }
コード例 #5
0
 private void ForceInstanceCreationOfCurrentType()
 {
     StateCommuter.CreateInstanceOfCurrentXamlTypeIfNotCreatedBefore();
 }