GetProfilesForPath() public method

public GetProfilesForPath ( string path ) : List
path string
return List
コード例 #1
0
        private void listProfilesRaw()
        {
            var profileLocator = new ProfileLocator(Environment.CurrentDirectory);
            Console.WriteLine("active-global|" + profileLocator.GetActiveGlobalProfile()+"|"+profileLocator.GetGlobalProfilePath(profileLocator.GetActiveGlobalProfile()));
            Console.WriteLine("active-local|" + profileLocator.GetActiveLocalProfile()+"|"+profileLocator.GetLocalProfilePath(profileLocator.GetActiveLocalProfile()));
            var globalProfiles =
                profileLocator.GetProfilesForPath(
                    profileLocator.GetGlobalProfilesRoot());
            globalProfiles.Insert(0, "default");
            globalProfiles.ForEach(x => Console.WriteLine("global|"+x+"|"+profileLocator.GetGlobalProfilePath(x)));

            if (Directory.Exists(profileLocator.GetLocalProfilesRoot())) {
                var localProfiles =
                profileLocator.GetProfilesForPath(
                    profileLocator.GetLocalProfilesRoot());
                localProfiles.Insert(0, "default");
                localProfiles.ForEach(x => Console.WriteLine("local|"+x+"|"+profileLocator.GetLocalProfilePath(x)));
            }
        }
コード例 #2
0
        private void listProfiles()
        {
            var profileLocator = new ProfileLocator(Environment.CurrentDirectory);
            Console.WriteLine("Active global profile: " + profileLocator.GetActiveGlobalProfile());
            Console.WriteLine("Active local profile:  " + profileLocator.GetActiveLocalProfile());
            var globalProfiles =
                profileLocator.GetProfilesForPath(
                    profileLocator.GetGlobalProfilesRoot());
            globalProfiles.Insert(0, "default");
            Console.WriteLine();
            Console.WriteLine("Global profiles:");
            globalProfiles.ForEach(x => Console.WriteLine("\t" + x));

            if (Directory.Exists(profileLocator.GetLocalProfilesRoot())) {
                var localProfiles =
                profileLocator.GetProfilesForPath(
                    profileLocator.GetLocalProfilesRoot());
                localProfiles.Insert(0, "default");
                Console.WriteLine();
                Console.WriteLine("Local profiles:");
                localProfiles.ForEach(x => Console.WriteLine("\t" + x));
            }

            Console.WriteLine();
        }