IsProfileLocked() статический приватный Метод

static private IsProfileLocked ( string path ) : bool
path string
Результат bool
Пример #1
0
        private void PopulateProfileList()
        {
            XMLProfileSettings profile = new XMLProfileSettings();

            listBoxProfiles.BeginUpdate();
            //Make sure we start with an empty listbox since we may repopulate after editing profiles
            listBoxProfiles.Items.Clear();
            int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0);

            for (int i = 0; i < profileCount; i++)
            {
                var dataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty);
                // if (!VixenApplication.IsProfileLocked(dataFolder)) //Only add the profile if it is not locked.
                //{
                ProfileItem item = new ProfileItem();
                item.Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name",
                                               "New Profile");
                item.DataFolder = dataFolder;
                item.IsLocked   = VixenApplication.IsProfileLocked(dataFolder);
                listBoxProfiles.Items.Add(item);

                //}
            }

            listBoxProfiles.EndUpdate();
        }
Пример #2
0
        private void PopulateProfileList()
        {
            XMLProfileSettings profile  = new XMLProfileSettings();
            List <ProfileItem> profiles = new List <ProfileItem>();


            listBoxProfiles.BeginUpdate();
            //Make sure we start with an empty listbox since we may repopulate after editing profiles
            listBoxProfiles.Items.Clear();
            int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0);

            for (int i = 0; i < profileCount; i++)
            {
                var dataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty);
                // if (!VixenApplication.IsProfileLocked(dataFolder)) //Only add the profile if it is not locked.
                //{
                ProfileItem item = new ProfileItem
                {
                    Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name",
                                              "New Profile"),
                    DataFolder     = dataFolder,
                    IsLocked       = VixenApplication.IsProfileLocked(dataFolder),
                    DateLastLoaded = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DateLastLoaded", DateTime.MinValue),
                    ProfileNumber  = i
                };

                profiles.Add(item);
                //}
            }

            profiles.Sort((x, y) => y.DateLastLoaded.CompareTo(x.DateLastLoaded));
            listBoxProfiles.DataSource = profiles;

            listBoxProfiles.EndUpdate();
        }