System.Runtime.Serialization.BaseFixupRecord.DoFixup C# (CSharp) Method

DoFixup() public method

public DoFixup ( ObjectManager manager, bool strict ) : bool
manager ObjectManager
strict bool
return bool
        public bool DoFixup(ObjectManager manager, bool strict)
        {
            if (ObjectToBeFixed.IsRegistered && ObjectRequired.IsInstanceReady) {
                FixupImpl(manager);
                return true;
            } else if (strict) {
                if (!ObjectToBeFixed.IsRegistered) throw new SerializationException("An object with ID " + ObjectToBeFixed.ObjectID + " was included in a fixup, but it has not been registered");
                else if (!ObjectRequired.IsRegistered) throw new SerializationException("An object with ID " + ObjectRequired.ObjectID + " was included in a fixup, but it has not been registered");
                else return false;
            } else
                return false;
        }

Usage Example

コード例 #1
0
ファイル: ObjectManager.cs プロジェクト: zgramana/mono
        public bool DoFixups(bool asContainer, ObjectManager manager, bool strict)
        {
            BaseFixupRecord prevFixup = null;
            BaseFixupRecord fixup     = asContainer ? FixupChainAsContainer : FixupChainAsRequired;
            bool            allFixed  = true;

            while (fixup != null)
            {
                if (fixup.DoFixup(manager, strict))
                {
                    UnchainFixup(fixup, prevFixup, asContainer);
                    if (asContainer)
                    {
                        fixup.ObjectRequired.RemoveFixup(fixup, false);
                    }
                    else
                    {
                        fixup.ObjectToBeFixed.RemoveFixup(fixup, true);
                    }
                }
                else
                {
                    prevFixup = fixup;
                    allFixed  = false;
                }

                fixup = asContainer ? fixup.NextSameContainer : fixup.NextSameRequired;
            }
            return(allFixed);
        }
All Usage Examples Of System.Runtime.Serialization.BaseFixupRecord::DoFixup