Ejemplo n.º 1
0
        public void OnAddToDocument(NativeDocumentAdapter doc)
        {
            var node    = DomNode;
            var docTest = (node != null) ? node.GetRoot().As <NativeDocumentAdapter>() : null;

            System.Diagnostics.Debug.Assert(doc == docTest);
            CreateNativeObject();
        }
Ejemplo n.º 2
0
        private void OnRemoveFromDocument_NonHier(NativeDocumentAdapter doc)
        {
            if (DomNode == null || m_instanceId == 0)
            {
                return;
            }

            ulong documentId = (doc != null) ? doc.NativeDocumentId : 0;

            System.Diagnostics.Debug.Assert(documentId == m_documentId);

            GameEngine.DestroyObject(m_documentId, m_instanceId, TypeId);
            GameEngine.DeregisterGob(m_documentId, m_instanceId, this);
            ReleaseNativeHandle();
        }
Ejemplo n.º 3
0
        public void OnRemoveFromDocument(NativeDocumentAdapter doc)
        {
            OnRemoveFromDocument_NonHier(doc);

            // note -- use "Subtree" & not "Children" because this
            //  will allow us to also touch NativeObjectAdapters
            //  that are children of non-native objects
            //  eg:
            //      <<native object>>
            //          <<non-native object>
            //              <<native object>>
            foreach (DomNode child in DomNode.Subtree)
            {
                NativeObjectAdapter childObject = child.As <NativeObjectAdapter>();
                if (childObject != null)
                {
                    childObject.OnRemoveFromDocument_NonHier(doc);
                }
            }
        }