Exemplo n.º 1
0
 private void UnchainFixup(BaseFixupRecord fixup, BaseFixupRecord prevFixup, bool asContainer)
 {
     if (prevFixup == null)
     {
         if (asContainer)
         {
             FixupChainAsContainer = fixup.NextSameContainer;
         }
         else
         {
             FixupChainAsRequired = fixup.NextSameRequired;
         }
     }
     else
     {
         if (asContainer)
         {
             prevFixup.NextSameContainer = fixup.NextSameContainer;
         }
         else
         {
             prevFixup.NextSameRequired = fixup.NextSameRequired;
         }
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public bool DoFixups(bool asContainer, ObjectManager manager, bool strict)
        {
            BaseFixupRecord prevFixup       = null;
            BaseFixupRecord baseFixupRecord = (!asContainer) ? this.FixupChainAsRequired : this.FixupChainAsContainer;
            bool            result          = true;

            while (baseFixupRecord != null)
            {
                if (baseFixupRecord.DoFixup(manager, strict))
                {
                    this.UnchainFixup(baseFixupRecord, prevFixup, asContainer);
                    if (asContainer)
                    {
                        baseFixupRecord.ObjectRequired.RemoveFixup(baseFixupRecord, false);
                    }
                    else
                    {
                        baseFixupRecord.ObjectToBeFixed.RemoveFixup(baseFixupRecord, true);
                    }
                }
                else
                {
                    prevFixup = baseFixupRecord;
                    result    = false;
                }
                baseFixupRecord = ((!asContainer) ? baseFixupRecord.NextSameRequired : baseFixupRecord.NextSameContainer);
            }
            return(result);
        }
Exemplo n.º 4
0
 public void ChainFixup(BaseFixupRecord fixup, bool asContainer)
 {
     if (asContainer)
     {
         fixup.NextSameContainer = FixupChainAsContainer;
         FixupChainAsContainer   = fixup;
     }
     else
     {
         fixup.NextSameRequired = FixupChainAsRequired;
         FixupChainAsRequired   = fixup;
     }
 }
Exemplo n.º 5
0
        public void RemoveFixup(BaseFixupRecord fixupToRemove, bool asContainer)
        {
            BaseFixupRecord prevFixup = null;

            for (BaseFixupRecord baseFixupRecord = (!asContainer) ? this.FixupChainAsRequired : this.FixupChainAsContainer; baseFixupRecord != null; baseFixupRecord = ((!asContainer) ? baseFixupRecord.NextSameRequired : baseFixupRecord.NextSameContainer))
            {
                if (baseFixupRecord == fixupToRemove)
                {
                    this.UnchainFixup(baseFixupRecord, prevFixup, asContainer);
                    return;
                }
                prevFixup = baseFixupRecord;
            }
        }
Exemplo n.º 6
0
        public void RemoveFixup(BaseFixupRecord fixupToRemove, bool asContainer)
        {
            BaseFixupRecord prevFixup = null;
            BaseFixupRecord fixup     = asContainer ? FixupChainAsContainer : FixupChainAsRequired;

            while (fixup != null)
            {
                if (fixup == fixupToRemove)
                {
                    UnchainFixup(fixup, prevFixup, asContainer);
                    return;
                }
                prevFixup = fixup;
                fixup     = asContainer ? fixup.NextSameContainer : fixup.NextSameRequired;
            }
        }
		public void ChainFixup (BaseFixupRecord fixup, bool asContainer)
		{
			if (asContainer) 
			{
				fixup.NextSameContainer = FixupChainAsContainer;
				FixupChainAsContainer = fixup;
			}
			else 
			{
				fixup.NextSameRequired = FixupChainAsRequired;
				FixupChainAsRequired = fixup;
			}
		}
		private void UnchainFixup (BaseFixupRecord fixup, BaseFixupRecord prevFixup, bool asContainer)
		{
			if (prevFixup == null) {
				if (asContainer) FixupChainAsContainer = fixup.NextSameContainer;
				else FixupChainAsRequired = fixup.NextSameRequired;
			}
			else {
				if (asContainer) prevFixup.NextSameContainer = fixup.NextSameContainer;
				else prevFixup.NextSameRequired = fixup.NextSameRequired;
			}
		}
		public void RemoveFixup (BaseFixupRecord fixupToRemove, bool asContainer)
		{
			BaseFixupRecord prevFixup = null;
			BaseFixupRecord fixup = asContainer ? FixupChainAsContainer : FixupChainAsRequired;
			while (fixup != null)
			{
				if (fixup == fixupToRemove) 
				{
					UnchainFixup (fixup, prevFixup, asContainer);
					return;
				}
				prevFixup = fixup;
				fixup = asContainer ? fixup.NextSameContainer : fixup.NextSameRequired;
			}
		}
Exemplo n.º 10
0
		private void AddFixup (BaseFixupRecord record)
		{
			record.ObjectToBeFixed.ChainFixup (record, true);
			record.ObjectRequired.ChainFixup (record, false);
		}
Exemplo n.º 11
0
 private void AddFixup(BaseFixupRecord record)
 {
     record.ObjectToBeFixed.ChainFixup(record, true);
     record.ObjectRequired.ChainFixup(record, false);
 }