public void CreateProfile(string accountName, string profileName) { ObjectFactory.GetInstance <PluginContextMock>().AccountName = accountName; ProfileCollection.Add(new ProfileCreationArgs(profileName, new object())); Bus.ResetExpectations(); NServiceBusMockRegistry.Setup(Bus); Context.AccountName = accountName; Context.ProfileName = profileName; }
private void AddButton_Click(object sender, EventArgs e) { CreateProfileWindow cpw = new CreateProfileWindow(); cpw.ShowDialog(); if (cpw.rv != null) { pCollection.Add(cpw.rv); ProfileData.Rows.Add(cpw.rv.NickName, cpw.rv.eMail, cpw.rv.Score, cpw.rv.WinCount, cpw.rv.LossCount); } }
protected void Page_Load(object sender, System.EventArgs e) { ProfileCollection myProfiles = new ProfileCollection(); SqlDataReader rdr = new Arena.DataLayer.Core.ProfileData().GetProfileByOwnerID(CurrentOrganization.OrganizationID, CurrentPerson.PersonID, true); while (rdr.Read()) { myProfiles.Add(new Profile(rdr)); } rdr.Close(); rptTags.DataSource = myProfiles; rptTags.DataBind(); }
/// <summary> /// Retrieve the profile for the specified user. If the profile is cached in the database /// it returns the full details immediately. Otherwise it creates and returns an empty /// profile. /// </summary> /// <param name="username">The user whose profile is requested</param> /// <returns>A profile for the specified user. May be incomplete if the full profile /// is not cached in the database.</returns> public static Profile ProfileForUser(string username) { // Enforce lowercase usernames username = username.ToLower(); ProfileCollection prc = CIX.ProfileCollection; Profile profile = prc.Get(username); if (profile == null) { profile = new Profile { Username = username, }; prc.Add(profile); } return(profile); }
public MainWindow() { InitializeComponent(); try { LoadProfiles(); } catch { } if (_profiles == null) { _profiles = new ProfileCollection(); _profiles.Add(new Profile() { Name = "Default" }); _profiles.DefaultProfile = "Default"; } cmbProfiles.ItemsSource = _profiles; }
public void CreateProfileForAccount(string profileName, string accountName) { ObjectFactory.GetInstance <PluginContextMock>().AccountName = accountName; ProfileCollection.Add(new ProfileCreationArgs(profileName, new object())); }
private void CompleteQuery() { if (startDateCalendar.SelectedDate.Value.Date.Equals(DateTime.Today)) { _query.TimePeriod = (TimePeriod)Enum.Parse(typeof(TimePeriod), TimeSpanBoxesColl.Where(p => (bool)p.IsChecked).First().Tag.ToString()); _query.SelectDates = false; } else { _query.EndDate = (DateTime)endDateCalendar.SelectedDate; _query.SelectDates = true; } if (_query.Ids.Count == 0) { Item pItem = new Item(_query.ProfileId.First().Value, _query.ProfileId.First().Key); ProfileCollection multipleProfile = new ProfileCollection(); multipleProfile.Add(pItem); _query.Ids = multipleProfile; } if (dimensionsMayHaveChanged) _query.Dimensions = GetCheckedItems(DimensionsView.tree.Items[0] as SizeViewModel); if (metricsMayHaveChanged) _query.Metrics = GetCheckedItems(MetricsView.tree.Items[0] as SizeViewModel); // If the user have not entered a interval of hits to view, then set them static here before calling GA. // if (startIndexTextBox.Text.Equals("")) // startIndexTextBox.Text = "0"; if (maxResultsTextBox.Text.Equals("0")) maxResultsTextBox.Text = "10000"; _query.StartIndex = int.Parse(startIndexTextBox.Text); _query.MaxResults = int.Parse(maxResultsTextBox.Text); if (sortBycomboBox.SelectedIndex != -1) { queryNotCompleted = false; ListSortOrder(); } // _query.Ids.Clear(); // _query.Ids.Add((comboBoxProfile.SelectedItem as Entry).Title, (comboBoxProfile.SelectedItem as Entry).ProfileId); }
private void BindProfileListBox() { ProfileCollection multiProfiles = new ProfileCollection(); Binding profileBinding = new Binding(); ProfileCollection multipleProfiles = new ProfileCollection(); Item pItem; if (_query.Ids.Count == 0) { pItem = new Item(_query.ProfileId.First().Value, _query.ProfileId.First().Key); multipleProfiles.Add(pItem); _query.Ids = multipleProfiles; } foreach (Item item in _query.Ids) { // make sure item's Value is set string value = (item.Key.IndexOf("ga:") == 0 ? "" : "ga:") + item.Key; if (_query.ProfileId.ContainsValue(value)) { item.Value = _query.ProfileId.GetKeyByValue(value); } multiProfiles.Add(item); } _query.Ids = multiProfiles; profileBinding.Source = multiProfiles; profileBox.SetBinding(ListBox.ItemsSourceProperty, profileBinding); }