public Profiles GetProfileList()
        {
            Profiles profiles = new Profiles();
            using(AmazonSimpleDBClient client = new AmazonSimpleDBClient(_publicKey, _secretKey))
            {
                SelectRequest request = new SelectRequest { SelectExpression = "SELECT * FROM Profiles" };

                SelectResponse response = client.Select(request);

                var list = from item in response.SelectResult.Item
                           select new Profile()
                                      {
                                          Id = Guid.Parse(item.Attribute.GetValueByName("Id")), 
                                          Description = item.Attribute.GetValueByName("Description"),
                                          Location = item.Attribute.GetValueByName("Location"),
                                          Name = item.Attribute.GetValueByName("Name")
                                      };
                foreach (Profile profile in list)
                {
                    profiles.Add(profile);
                }
            }

            return profiles;
        }
Esempio n. 2
0
        /// <summary>
        /// Represents the current set of launch settings. Creation from an existing set of profiles.
        /// </summary>
        public LaunchSettings(IEnumerable <ILaunchProfile> profiles, IDictionary <string, object>?globalSettings, string?activeProfile = null)
        {
            Profiles = ImmutableList <ILaunchProfile> .Empty;
            foreach (ILaunchProfile profile in profiles)
            {
                Profiles = Profiles.Add(new LaunchProfile(profile));
            }

            GlobalSettings     = globalSettings == null ? ImmutableStringDictionary <object> .EmptyOrdinal : globalSettings.ToImmutableDictionary();
            _activeProfileName = activeProfile;
        }
Esempio n. 3
0
        /// <summary>
        /// Erstellt ein leeres Profil
        /// </summary>
        public bool createProfile()
        {
            foreach (Profile p in Profiles)
            {
                if (p.ProfilePath != null && Convert.ToInt32(p.ProfilePath.Substring(p.ProfilePath.Length - 5, 1)) > iFileNameCounter)
                {
                    iFileNameCounter = Convert.ToInt32(p.ProfilePath.Substring(p.ProfilePath.Length - 5, 1));
                }
            }

            foreach (Profile p in Profiles)
            {
                p.ProfileIsCreated = false;
            }

            frmNewProfile newProfileForm = new frmNewProfile(this);

            newProfileForm.ShowDialog();

            //Wenn das neue Profil nicht angelegt werden soll, dann das zuletzt gewählte aufmachen
            if (newProfileForm.DialogResult != DialogResult.OK)
            {
                if (CurrentProfile != null)
                {
                    ProfileTabControl.SelectedTab = CurrentProfile;
                    return(false);
                }

                foreach (Profile p in Profiles)
                {
                    if (p.IsActiveProfile)
                    {
                        ProfileTabControl.SelectedTab = p;
                    }
                }
                return(false);
            }

            Profile newProfile = new Profile(newProfileForm.ProfileName, this);

            newProfile.ProfileFans       = generateFans();
            newProfile.ProfileCurrentFan = newProfile.ProfileFans[0];
            newProfile.ProfileLabel.Text = getCurrentSpeedText(newProfile.ProfileCurrentFan.SpeedPercentage);
            newProfile.ProfileIsCreated  = true;
            iFileNameCounter++;
            newProfile.ProfilePath = "FanProfiles\\" + DateTime.Now.Date.ToShortDateString() + "_" + iFileNameCounter.ToString() + ".xml";

            Profiles.Add(newProfile);
            bActiveProfileExists = false;

            checkForActiveProfile();

            return(true);
        }
        private void RefreshProfilesList()
        {
            Profiles.Clear();
            foreach (var item in Settings.Profiles.Select(x => x.Key).ToList())
            {
                Profiles.Add(item);
            }
            NotifyPropertyChanged(nameof(Profiles));

            RemoveButton.IsEnabled = Profiles.Count > 1 && !Engine.IsRunning;
        }
        public LaunchSettings(LaunchSettingsData settingsData, string activeProfile = null)
        {
            Profiles = ImmutableList <ILaunchProfile> .Empty;
            foreach (var profile in settingsData.Profiles)
            {
                Profiles = Profiles.Add(new LaunchProfile(profile));
            }

            GlobalSettings     = settingsData.OtherSettings == null? ImmutableDictionary <string, object> .Empty : settingsData.OtherSettings.ToImmutableDictionary();
            _activeProfileName = activeProfile;
        }
Esempio n. 6
0
 public OrgItemTypeTermin(string s, Pullenti.Morph.MorphLang lang = null, Pullenti.Ner.Org.OrgProfile p1 = Pullenti.Ner.Org.OrgProfile.Undefined, Pullenti.Ner.Org.OrgProfile p2 = Pullenti.Ner.Org.OrgProfile.Undefined) : base(s, lang, false)
 {
     if (p1 != Pullenti.Ner.Org.OrgProfile.Undefined)
     {
         Profiles.Add(p1);
     }
     if (p2 != Pullenti.Ner.Org.OrgProfile.Undefined)
     {
         Profiles.Add(p2);
     }
 }
Esempio n. 7
0
 private void InitProfiles()
 {
     foreach (var model in ChatModel.Profiles)
     {
         var view = new ProfileLineViewModel(_manager)
         {
             ProfileModel = model
         };
         Profiles.Add(view);
     }
 }
        public async void AddNewProfile(string name, bool copySettingsFromCurrent)
        {
            var newProfile = WorkingProfile.CreateProfile(name);

            Profiles.Add(newProfile);
            WorkingProfile.SaveProfiles(Profiles);
            await CopySettingsFromCurrentProfileTo(newProfile);

            SelectedProfile = newProfile;
            RaisePropertyChanged(() => HasProfiles);
        }
Esempio n. 9
0
        private void OnSaveProfile()
        {
            if (Session.Character.Map == null)
            {
                return;
            }

            var profile = new Profile
            {
                MapId        = Session.Character.Map.Id,
                BuffSkills   = Bot.UsedBuffSkills.Select(x => x.Id).ToList(),
                DamageSkills = Bot.UsedDamageSkills.Select(x => x.Id).ToList(),
                HealItems    = Bot.UsedHealItems.Select(x => new HealItem
                {
                    ItemId       = x.Item.Id,
                    HpPercentage = x.HpPercentage,
                    MpPercentage = x.MpPercentage,
                    UseForHp     = x.UseForHp,
                    UseForMp     = x.UseForMp
                }).ToList(),
                Monsters             = Bot.WhitelistedMonsters.Select(x => x.ModelId).ToList(),
                Path                 = Bot.Path.ToList(),
                PickUpGolds          = Bot.PickUpGolds,
                UseAmuletOfReturn    = Bot.UseAmuletOfReturn,
                PickUpSoundFlowers   = Bot.PickUpSoundFlowers,
                UseAncelloanBlessing = Bot.UseAncelloanBlessing,
                UseAttackPotion      = Bot.UseAttackPotion,
                UseDefencePotion     = Bot.UseDefencePotion,
                UseEnergyPotion      = Bot.UseEnergyPotion,
                UseExperiencePotion  = Bot.UseExperiencePotion,
                UseFairyBoost        = Bot.UseFairyBoost,
                UseMateBlessing      = Bot.UseMateBlessing,
                UsePetFood           = Bot.UsePetFood,
                UseSoulstoneBlessing = Bot.UseSoulstoneBlessing
            };

            string name = $"{Session.Character.Name} ({Session.Character.Map.Name})";

            if (SelectedProfile != null)
            {
                if (name != SelectedProfile)
                {
                    int id = 0;
                    while (Profiles.Contains(name))
                    {
                        name += $" - {++id}";
                    }

                    Profiles.Add(name);
                }
            }

            profileManager.SaveProfile(name, profile);
        }
Esempio n. 10
0
 /// <summary>
 /// Starts the profile with the given name.
 /// </summary>
 /// <param name="name">The name of the profile.</param>
 public static void Start(string name)
 {
     lock ( _instance )
     {
         if (!Profiles.ContainsKey(name))
         {
             Profiles.Add(name, new Profile());
         }
         Profiles[name].Start();
     }
 }
Esempio n. 11
0
        private void UpdateFiles()
        {
            List <string> profiles = Database.Profiles;

            Profiles.Clear();
            foreach (string profile in profiles)
            {
                Profiles.Add(new File(profile));
            }
            RaisePropertyChanged("Profiles");
        }
Esempio n. 12
0
        private void AddClientProfileItem()
        {
            var clientProfileItem = new ProfileSelectorItemViewModel()
            {
                ProfileName        = $"{_userInfo.FirstName} {_userInfo.LastName}",
                ProfileTypeCaption = "Client",
                ProfileType        = UserTypes.Client,
                ProfileTypeImage   = ImageSource.FromFile("account_circle_gray.png"),
            };

            Profiles.Add(clientProfileItem);
        }
Esempio n. 13
0
        public void CancelEdit()
        {
            if (!_isEditing)
            {
                return;
            }
            Donated         = _mDonated;
            CheckUpdates    = _mCheckUpdates;
            CurrentLanguage = _mCurrentLanguage;
            Delimiters      = _mDelimiters;
            Tasks.Clear();
            foreach (Task task in _mTtasks)
            {
                Tasks.Add(task);
                task.CancelEdit();
            }

            Profiles.Clear();
            foreach (Profile profile in _mProfiles)
            {
                Profiles.Add(profile);
                profile.CancelEdit();
            }

            MoveList.Clear();
            foreach (PositionTransform positionTransform in _mMoveList)
            {
                MoveList.Add(positionTransform);
                positionTransform.CancelEdit();
            }

            CopyList.Clear();
            foreach (PositionTransform positionTransform in _mCopyList)
            {
                CopyList.Add(positionTransform);
                positionTransform.CancelEdit();
            }

            Languages.Clear();
            foreach (Language language in _mLanguages)
            {
                Languages.Add(language);
                language.CancelEdit();
            }

            _mProfiles.Clear();
            _mMoveList.Clear();
            _mCopyList.Clear();
            _mLanguages.Clear();
            _mTtasks.Clear();

            _isEditing = false;
        }
        private void Save()
        {
            if (!_settings.Profiles.ContainsKey(InstanceName))
            {
                _settings.Profiles[InstanceName] = new CustomGCCToolchainProfile();
                Profiles.Add(InstanceName);
            }

            _settings.Profiles[InstanceName].BasePath = BasePath;

            _settings.Save();
        }
Esempio n. 15
0
 /// <summary>
 /// Adds profile into list.
 /// </summary>
 /// <param name="profile">Profile.</param>
 public void AddProfile(Profile profile)
 {
     if (string.IsNullOrWhiteSpace(profile.ProfileName))
     {
         throw new ArgumentNullException(nameof(profile.ProfileName));
     }
     if (Profiles.ToArray().Any(pair => pair.Key == profile.ProfileName))
     {
         throw new ArgumentException("Profile '" + profile.ProfileName + "' already exists.");
     }
     Profiles.Add(new KeyValuePair <string, Profile>(profile.ProfileName, profile));
 }
 public void AddProfile(string profileName)
 {
     if (!Profiles.Contains(profileName))
     {
         if (Profiles.Count == 0)
         {
             Settings.Default.CurrentProfile = profileName;
         }
         Profiles.Add(profileName);
         SaveProfiles();
     }
 }
Esempio n. 17
0
        private void AddInterpreterProfileItem()
        {
            var interpreterProfileItem = new ProfileSelectorItemViewModel()
            {
                ProfileName        = $"{_userInfo.FirstName} {_userInfo.LastName}",
                ProfileTypeCaption = "Interpreter",
                ProfileType        = UserTypes.Interpreter,
                ProfileTypeImage   = ImageSource.FromFile("account_circle_gray.png"),
            };

            Profiles.Add(interpreterProfileItem);
        }
 public void AddNewProfile(string forgeVersion, string installationName)
 {
     if (Profiles.ContainsKey("BuddyPals") == false)
     {
         LauncherProfile newProfile = new LauncherProfile("Furnace", "2019-11-27T01:40:56.781Z", forgeVersion, installationName, "custom", javaArgs: "-Xmx4G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M");
         Profiles.Add("BuddyPals", newProfile);
     }
     else
     {
         Profiles["BuddyPals"].UpdateForge(forgeVersion, installationName);
     }
 }
        /// <summary> Add a quality control profile with user settings, such as which
        /// division types to include for selection </summary>
        /// <param name="New_Profile"> New profile to add </param>
        public void Add_Profile(QualityControl_Profile New_Profile)
        {
            // Add to the dictionary of profiles
            Profiles.Add(New_Profile);
            profilesDictionary[New_Profile.Profile_Name] = New_Profile;

            // Was this the default profile?
            if (New_Profile.Default_Profile)
            {
                DefaultProfile = New_Profile.Profile_Name;
            }
        }
Esempio n. 20
0
        public ApplicationProfile AddNewProfile(String profileName)
        {
            ApplicationProfile _newProfile = CreateNewProfile(profileName);

            Profiles.Add(_newProfile);

            SaveProfiles();

            SwitchToProfile(_newProfile);

            return(_newProfile);
        }
Esempio n. 21
0
        private void Update()
        {
            Profiles.Clear();

            foreach (ReleaseCheckoutProfile profile in m_model)
            {
                Profiles.Add(new ReleaseCheckoutProfileRecordViewModel()
                {
                    Model = profile
                });
            }
        }
        public void Handle(ProfileDocumentAddedEvent message)
        {
            var panel = Profiles.FirstOrDefault(s => s.ContentId == message.Document.ContentId);

            if (panel == null)
            {
                panel = message.Document;
                Profiles.Add(panel);
            }

            panel.IsPanelActive = true;
            ActiveDocument      = message.Document;
        }
Esempio n. 23
0
        public LaunchSettings(LaunchSettingsData settingsData, string?activeProfile = null)
        {
            Requires.NotNull(settingsData.Profiles !, nameof(settingsData.Profiles));

            Profiles = ImmutableList <ILaunchProfile> .Empty;
            foreach (LaunchProfileData profile in settingsData.Profiles)
            {
                Profiles = Profiles.Add(new LaunchProfile(profile));
            }

            GlobalSettings     = settingsData.OtherSettings == null ? ImmutableStringDictionary <object> .EmptyOrdinal : settingsData.OtherSettings.ToImmutableDictionary();
            _activeProfileName = activeProfile;
        }
Esempio n. 24
0
 public void AddProfile(string id, LauncherProfile launcherProfile)
 {
     if (string.IsNullOrWhiteSpace(id))
     {
         throw new ArgumentNullException(nameof(id));
     }
     if (Profiles.Keys.Contains(id))
     {
         throw new ArgumentException($"Profile with id '{id}' already exists.");
     }
     launcherProfile.AssociatedId = id;
     Profiles.Add(id, launcherProfile);
 }
 public void LoadAnalyticsProfiles()
 {
     Google.Apis.Analytics.v3.ManagementResource.ProfilesResource.ListRequest request = analyticsService.Management.Profiles.List("~all", "~all");
     Google.Apis.Analytics.v3.Data.Profiles profiles = request.Execute();
     if (Profiles == null)
     {
         Profiles = new List <Google.Apis.Analytics.v3.Data.Profile>();
     }
     foreach (Google.Apis.Analytics.v3.Data.Profile p in profiles.Items)
     {
         Profiles.Add(p);
     }
 }
Esempio n. 26
0
        public static PvPProfile EnsureProfile(PlayerMobile pm, bool replace = false)
        {
            if (!Profiles.ContainsKey(pm))
            {
                Profiles.Add(pm, new PvPProfile(pm));
            }
            else if (replace || Profiles[pm] == null || Profiles[pm].Deleted)
            {
                Profiles[pm] = new PvPProfile(pm);
            }

            return(Profiles[pm]);
        }
        private async Task Initialise()
        {
            var profiles = await _devService.GetProfilesAsync();

            foreach (var profile in profiles)
            {
                Profiles.Add(profile);
            }
            OnPropertyChanged("Profiles");
            SetDevDetails();
            IsRunning = false;
            OnPropertyChanged("IsRunning");
        }
 private void PopulateProfiles(IEnumerable <MouseProfileModel> profiles)
 {
     Profiles.Clear();
     Profiles.Add(Service.GetDefaultMouseProfile());
     if (profiles == null)
     {
         return;
     }
     foreach (var item in profiles)
     {
         Profiles.Add(item);
     }
 }
Esempio n. 29
0
        private void AddProfile([NotNull] object obj)
        {
            Assert.ArgumentNotNull(obj, "obj");

            var castedProfileName = obj as string;

            if (!String.IsNullOrEmpty(castedProfileName))
            {
                Profiles.Add(new ProfileViewModel(castedProfileName, false));
                ProfileHolder.Instance.CreateNewProfile(castedProfileName);
            }

            UpdateAddProfileCommandCanExecute();
        }
Esempio n. 30
0
            public void Add(string key, PasswordGenerator.CombinedKeyOptions options)
            {
                for (var index = 0; index < Profiles.Count; index++)
                {
                    var kvp = Profiles[index];
                    if (kvp.Key == key)
                    {
                        Profiles[index] = new KeyValuePair <string, PasswordGenerator.CombinedKeyOptions>(key, options);
                        return;
                    }
                }

                Profiles.Add(new KeyValuePair <string, PasswordGenerator.CombinedKeyOptions>(key, options));
            }
Esempio n. 31
0
 public static void LoadProfilesFromXml(XElement xProfiles)
 {
     if (xProfiles != null)
     {
         foreach (var prof in xProfiles.Descendants().Where(element => element.Name == "Profile"))
         {
             Profile newProf = new Profile();
             newProf.LoadFromXml(prof);
             Profiles.Add(newProf);
             newProf.DeActivate(); // important
         }
         StartUpProfile = Profiles.Where(p => p.Name == xProfiles.GetElementValueTrimmed("StartupProfile")).FirstOrDefault();
     }
 }