Exemple #1
0
        private AnchorXmlSerializableObject <PersistedBandDefinition> GetBandPersistedMessage(Band band)
        {
            AnchorXmlSerializableObject <PersistedBandDefinition> anchorXmlSerializableObject = this.GetBandDefinitionXmlSerializable().FirstOrDefault((AnchorXmlSerializableObject <PersistedBandDefinition> persisted) => persisted.PersistedObject.Matches(band));

            if (anchorXmlSerializableObject == null)
            {
                throw new BandDefinitionNotFoundException(band.ToString());
            }
            return(anchorXmlSerializableObject);
        }
Exemple #2
0
        private void CheckNewBandDoesntConflict(PersistedBandDefinition incomingBand, IEnumerable <PersistedBandDefinition> existingBands)
        {
            Band incoming = incomingBand.ToBand();
            Band band2    = (from persistedBand in existingBands
                             select persistedBand.ToBand()).FirstOrDefault((Band band) => band.IsOverlap(incoming));

            if (band2 != null)
            {
                this.logger.LogError(null, "Band {0} conflicts with defined band {1}.", new object[]
                {
                    incoming,
                    band2
                });
                throw new OverlappingBandDefinitionException(incoming.ToString(), band2.ToString());
            }
        }