Inheritance: SerializableBase
Exemplo n.º 1
0
        /// <summary>
        /// Indicates whether contains IDSET.
        /// </summary>
        /// <param name="idset">A REPLID_IDSET.</param>
        /// <returns>If contains IDSET, return true, else false.</returns>
        public override bool Contains(IDSET idset)
        {
            REPLID_IDSET ridset = idset as REPLID_IDSET;

            if (this.idsetList == null || this.idsetList.Count == 0)
            {
                if (ridset != null)
                {
                    return(false);
                }

                return(true);
            }
            else
            {
                if (ridset != null)
                {
                    foreach (REPLID_IDSETElement ele1 in ridset.idsetList)
                    {
                        foreach (REPLID_IDSETElement ele2 in this.idsetList)
                        {
                            foreach (GLOBCNTRange rng1 in ele1.GLOBSET.GLOBCNTRangeList)
                            {
                                bool hasRange = false;
                                foreach (GLOBCNTRange rng2 in ele2.GLOBSET.GLOBCNTRangeList)
                                {
                                    if (rng2.Contains(rng1))
                                    {
                                        hasRange = true;
                                        break;
                                    }
                                }

                                if (!hasRange)
                                {
                                    return(false);
                                }
                            }
                        }
                    }
                }
            }

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Indicates whether contains IDSET.
        /// </summary>
        /// <param name="idset">A REPLID_IDSET.</param>
        /// <returns>If contains IDSET, return true, else false.</returns>
        public override bool Contains(IDSET idset)
        {
            REPLID_IDSET ridset = idset as REPLID_IDSET;
            if (this.idsetList == null || this.idsetList.Count == 0)
            {
                if (ridset != null)
                {
                    return false;
                }

                return true;
            }
            else
            {
                if (ridset != null)
                {
                    foreach (REPLID_IDSETElement ele1 in ridset.idsetList)
                    {
                        foreach (REPLID_IDSETElement ele2 in this.idsetList)
                        {
                            foreach (GLOBCNTRange rng1 in ele1.GLOBSET.GLOBCNTRangeList)
                            {
                                bool hasRange = false;
                                foreach (GLOBCNTRange rng2 in ele2.GLOBSET.GLOBCNTRangeList)
                                {
                                    if (rng2.Contains(rng1))
                                    {
                                        hasRange = true;
                                        break;
                                    }
                                }

                                if (!hasRange)
                                {
                                    return false;
                                }
                            }
                        }
                    }
                }
            }

            return true;
        }