Пример #1
0
        /// <summary>
        /// Determines whether the given code unit type is present within the array of types.
        /// </summary>
        /// <param name="codeUnitTypes">The array of types.</param>
        /// <param name="itemType">The type to search for.</param>
        /// <returns>Returns true if the type is present within the array; otherwise false.</returns>
        private static bool CompareCodeUnitType(CodeUnitType[] codeUnitTypes, CodeUnitType itemType)
        {
            Param.Ignore(codeUnitTypes);
            Param.Ignore(itemType);

            if (codeUnitTypes == null || codeUnitTypes.Length == 0)
            {
                return(true);
            }

            for (int i = 0; i < codeUnitTypes.Length; ++i)
            {
                if (codeUnitTypes[i] == itemType)
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the CodeUnit class.
 /// </summary>
 /// <param name="document">The parent document.</param>
 /// <param name="codeUnitType">The type of the code unit.</param>
 internal CodeUnit(CsDocument document, CodeUnitType codeUnitType)
     : this(document, (int)codeUnitType)
 {
     Param.AssertNotNull(document, "document");
     Param.Ignore(codeUnitType);
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the CodeUnit class.
 /// </summary>
 /// <param name="proxy">Proxy object for the code unit.</param>
 /// <param name="codeUnitType">The type of the code unit.</param>
 internal CodeUnit(CodeUnitProxy proxy, CodeUnitType codeUnitType)
     : this(proxy, (int)codeUnitType)
 {
     Param.AssertNotNull(proxy, "proxy");
     Param.Ignore(codeUnitType);
 }