FlatRedBall.Glue.ElementRuntime.RefreshContainedElements C# (CSharp) Method

RefreshContainedElements() private method

private RefreshContainedElements ( ) : void
return void
        private void RefreshContainedElements()
        {
            foreach (ElementRuntime er in ContainedElements)
            {
                er.RefreshContainedElements();
            }

            foreach (ElementRuntime er in ElementsInList)
            {
                er.RefreshContainedElements();
            }

            if (mAssociatedIElement != null)
            {
                // When variables change, the GLUX is reloaded.  Since it's reloated
                // the AssociatedIElement is no longer valid - even though the two may
                // be similar, they're two different references, and could have different
                // values.  So we refresh that here.
                mAssociatedIElement = ObjectFinder.Self.GetIElement(mAssociatedIElement.Name);

                if (mAssociatedIElement != null)
                {
                    foreach (ElementRuntime er in ContainedElements)
                    {
                        if (er.mAssociatedNamedObjectSave != null)
                        {
                            er.mAssociatedNamedObjectSave = mAssociatedIElement.GetNamedObjectRecursively(er.mAssociatedNamedObjectSave.InstanceName);
                        }
                    }

                    foreach (ElementRuntime er in ElementsInList)
                    {
                        if (er.mAssociatedNamedObjectSave != null)
                        {
                            er.mAssociatedNamedObjectSave = mAssociatedIElement.GetNamedObjectRecursively(er.mAssociatedNamedObjectSave.InstanceName);
                        }

                    }
                }
            }




        }