private static string ConvertFromAppDomain(string name, ResourceScope to, Type type)
 {
     if (to < ResourceScope.AppDomain || to >= ResourceScope.Private)
     {
         throw new ArgumentException("to");
     }
     return(VersioningHelper.SafeName(name, false, false));
 }
        private static string ConvertFromProcess(string name, ResourceScope to, Type type)
        {
            if (to < ResourceScope.Process || to >= ResourceScope.Private)
            {
                throw new ArgumentException("to");
            }
            bool appdomain = (to & ResourceScope.AppDomain) == ResourceScope.AppDomain;

            return(VersioningHelper.SafeName(name, false, appdomain));
        }
        private static string ConvertFromMachine(string name, ResourceScope to, Type type)
        {
            switch (to)
            {
            case ResourceScope.Machine:
                return(VersioningHelper.SafeName(name, false, false));

            case ResourceScope.Process:
                return(VersioningHelper.SafeName(name, true, false));

            case ResourceScope.AppDomain:
                return(VersioningHelper.SafeName(name, true, true));
            }
            throw new ArgumentException("to");
        }