Exemplo n.º 1
0
        public void Execute()
        {
            var list = MainWindow.Current.Setting.UserProfileList;

            // プロファイル取得
            Profile pf = null;

            if (1 <= Value && list.Count >= Value)
            {
                var userProfileInfo = list[Value - 1];
                if (userProfileInfo.Profile == null)
                {
                    string xmlDir  = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName + "\\Profile";
                    string xmlPath = xmlDir + "\\" + userProfileInfo.RelativePath;
                    pf = UserProfileInfo.LoadProfileFromXmlFile(xmlPath);
                }
                else
                {
                    pf = userProfileInfo.Profile;
                }
            }

            // プロファイルのロード
            if (pf != null)
            {
                MainWindow.Current.LoadUserProfile(pf);
            }
        }
Exemplo n.º 2
0
        public void Execute()
        {
            var list = MainWindow.Current.Setting.UserProfileList;

            // プロファイル取得
            Profile pf = null;
            var     userProfileInfo = list.FirstOrDefault(l => l.RelativePath == StrValue + ".xml");

            if (userProfileInfo != null)
            {
                string xmlDir  = Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName + "\\Profile";
                string xmlPath = xmlDir + "\\" + userProfileInfo.RelativePath;
                pf = UserProfileInfo.LoadProfileFromXmlFile(xmlPath);
            }

            // プロファイルのロード
            if (pf != null)
            {
                MainWindow.Current.LoadUserProfile(pf);
            }
        }