Exemple #1
0
        public virtual bool IsLegalFormat(string inCode)

        {
            bool   flag      = false;
            int    partIndex = inCode.IndexOf(";part(", StringComparison.Ordinal);
            string filler    = null;
            string particle  = null;

            if (partIndex != -1)

            {
                filler   = inCode.Substring(0, partIndex);
                particle = inCode.Substring(partIndex);
            }
            else

            {
                filler = inCode;
            }

            if (!ReferenceEquals(particle, null))

            {
                flag = (CheckLinkFiller(filler)) && (CheckParticle.IsLegal(particle));
            }
            else

            {
                flag = CheckLinkFiller(filler);
            }

            return(flag);
        }
Exemple #2
0
        public virtual bool IsLegalFormat(string inCode)

        {
            bool   flag          = false;
            int    partIndex     = inCode.IndexOf(";part(", StringComparison.Ordinal);
            int    passiveIndex  = inCode.IndexOf(";nopass", StringComparison.Ordinal);
            int    noPrtmvtIndex = inCode.IndexOf(";noprtmvt", StringComparison.Ordinal);
            string filler        = null;
            string particle      = null;
            bool   passive       = false;
            bool   noPrtmvt      = false;

            if (partIndex != -1)

            {
                filler = inCode.Substring(0, partIndex);

                if (passiveIndex != -1)

                {
                    particle = inCode.Substring(partIndex, passiveIndex - partIndex);
                }
                else if (noPrtmvtIndex != -1)

                {
                    particle = inCode.Substring(partIndex, noPrtmvtIndex - partIndex);
                }
                else

                {
                    particle = inCode.Substring(partIndex);
                }
            }
            else if (passiveIndex != -1)

            {
                filler = inCode.Substring(0, passiveIndex);
            }
            else if (noPrtmvtIndex != -1)

            {
                filler = inCode.Substring(0, noPrtmvtIndex);
            }
            else

            {
                filler = inCode;
            }

            if (!ReferenceEquals(particle, null))

            {
                flag = (CheckTranFiller(filler)) && (CheckParticle.IsLegal(particle));
            }
            else

            {
                flag = CheckTranFiller(filler);
            }

            return(flag);
        }