public static bool FragmentTypesAssignable(Fragment givenFragmentType, Fragment targetFragmentType)
        {
            ArgumentUtility.CheckNotNull ("givenFragmentType", givenFragmentType);
              ArgumentUtility.CheckNotNull ("targetFragmentType", targetFragmentType);

              return targetFragmentType == givenFragmentType
             || targetFragmentType == Fragment.CreateEmpty()
             || givenFragmentType == Fragment.CreateLiteral();
        }
        private static Fragment FragmentIntersection(Fragment fragmentA, Fragment fragmentB)
        {
            bool fragmentAIsSuperior = fragmentA != fragmentB && fragmentA == Fragment.CreateLiteral();
              bool fragmentBIsSuperior = fragmentA != fragmentB && fragmentB == Fragment.CreateLiteral();

              if (fragmentA == fragmentB)
            return fragmentA;
              else if (fragmentAIsSuperior)
            return fragmentB;
              else if (fragmentBIsSuperior)
            return fragmentA;
              else
            return Fragment.CreateEmpty();
        }
Esempio n. 3
0
 protected bool Equals(Fragment other)
 {
     return _fragmentType == other._fragmentType && string.Equals (_fragmentName, other._fragmentName);
 }
Esempio n. 4
0
        public void MakeSafe(string symbolName, Fragment fragmentType)
        {
            ArgumentUtility.CheckNotNull ("symbolName", symbolName);
              ArgumentUtility.CheckNotNull ("fragmentType", fragmentType);

              _safenessMap[symbolName] = fragmentType;
        }
Esempio n. 5
0
        public bool IsAssignableTo(string symbolName, Fragment fragmentType)
        {
            ArgumentUtility.CheckNotNull("symbolName", symbolName);
              ArgumentUtility.CheckNotNull ("fragmentType", fragmentType);

              return FragmentUtility.FragmentTypesAssignable (GetFragmentType(symbolName), fragmentType);
        }
Esempio n. 6
0
 protected bool Equals(Fragment other)
 {
     return(_fragmentType == other._fragmentType && string.Equals(_fragmentName, other._fragmentName));
 }
Esempio n. 7
0
        private Fragment[] GetParameterFragmentTypes(Method calleeMethod)
        {
            List <string> parameterTypes = IntrospectionUtility.GetParameterTypes(calleeMethod);
            string        assemblyName   = calleeMethod.ContainingAssembly().Name;

            FragmentSignature signature = _blacklistManager.GetFragmentTypes(assemblyName, calleeMethod.DeclaringType.FullName, calleeMethod.Name.Name, parameterTypes);

            Fragment[] parameterFragmentTypes;
            if (signature == null)
            {
                parameterFragmentTypes = FragmentUtility.GetAnnotatedParameterFragmentTypes(calleeMethod);
            }
            else
            {
                parameterFragmentTypes = signature.ParameterFragmentTypes.Select(name => name != null ? Fragment.CreateNamed(name) : Fragment.CreateEmpty()).ToArray();
            }
            return(parameterFragmentTypes);
        }
Esempio n. 8
0
 public void MakeUnsafe(string symbolName)
 {
     ArgumentUtility.CheckNotNull("symbolName", symbolName);
     _safenessMap[symbolName] = Fragment.CreateEmpty();
 }