예제 #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;
         }
     }
 }
예제 #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);
        }
예제 #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);
        }
예제 #4
0
 public void ChainFixup(BaseFixupRecord fixup, bool asContainer)
 {
     if (asContainer)
     {
         fixup.NextSameContainer = FixupChainAsContainer;
         FixupChainAsContainer   = fixup;
     }
     else
     {
         fixup.NextSameRequired = FixupChainAsRequired;
         FixupChainAsRequired   = fixup;
     }
 }
예제 #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;
            }
        }
예제 #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;
			}
		}
		private void AddFixup (BaseFixupRecord record)
		{
			record.ObjectToBeFixed.ChainFixup (record, true);
			record.ObjectRequired.ChainFixup (record, false);
		}
예제 #11
0
 private void AddFixup(BaseFixupRecord record)
 {
     record.ObjectToBeFixed.ChainFixup(record, true);
     record.ObjectRequired.ChainFixup(record, false);
 }