Пример #1
0
            volatile bool shutdown = false; //!< volatile to support testing outside of lock ownership.  changes are still done inside lock

            #endregion Fields

            #region Constructors

            public LogMessageDistributionImpl()
            {
                distSourceID = new LoggerSourceInfo(LoggerID_InternalLogger, "LogMessageDistributionImpl");

                // define the default distribution group.  Its name is the name that the distribution uses if
                //	it is trying to emit a message.

                const int defaultDistGroupID = DistGroupID_Default;
                PerDistGroupIDInfo dgInfo = null;

                if (distGroupIDInfoList.Count == 0)
                {
                    dgInfo = new PerDistGroupIDInfo(distGroupIDInfoList.Count, DefaultDistributionGroupName);
                    distGroupIDInfoList.Add(dgInfo);
                    distGroupNameToIDMap.Add(dgInfo.DistGroupName, dgInfo.DistGroupID);
                }

                if (!InnerIsDistGroupIDValid(defaultDistGroupID))
                    Asserts.TakeBreakpointAfterFault("DistGroupID_Default is not valid after initializing Distribution Group table.");

                // create the loggerID used for messages that come from the distribution system

                int lmdLoggerID = InnerGetLoggerID("LogMessageDistributionImpl");
                if (InnerIsLoggerIDValid(lmdLoggerID))
                    distSourceID = perLoggerIDInfoList [lmdLoggerID].sourceID;
                else
                    Utils.Asserts.TakeBreakpointAfterFault("A valid DistSourceID could not be created");
            }
Пример #2
0
 /// <summary>Adds the given target group ID to this groups linked dist list if needed.  Returns true if the given ID was not already in the list and was added.  Returns false if the given ID was already in the list.</summary>
 public bool AddLinkTo(PerDistGroupIDInfo linkToDistGroupIDInfo)
 {
     if (!linkedDistGroupList.Contains(linkToDistGroupIDInfo))
     {
         linkedDistGroupList.Add(linkToDistGroupIDInfo);
         linkedDistGroupArray = linkedDistGroupList.ToArray();
         return true;
     }
     else
     {
         return false;
     }
 }