/// <summary> /// Searches the text control_ search text. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> private void searchTextControl_SearchText(object sender, TextArgs args) { this.Page = 0; this.TextSearched = args.Text; Args.GroupsArgs groupArgs = new GroupsArgs(args.Text, this.Page, null); this.SearchText(sender, groupArgs); }
/// <summary> /// Loads the groups. /// </summary> /// <param name="groupsList">The groups list.</param> /// <param name="groupArgs">The group args.</param> public void LoadGroups(List <Model.Group.Group> groupsList, GroupsArgs groupArgs) { this.Page = groupArgs.Page; this.TextSearched = groupArgs.Text; this.pGroupsList.Controls.Clear(); if (this.Page == 0) { this.pagination.DisablePreviousLink(); } else { this.pagination.EnablePreviousLink(); } if (groupsList.Count == 10) { this.pagination.EnableNextLink(); } else { this.pagination.DisableNextLink(); } foreach (Model.Group.Group group in groupsList) { GroupResult groupResult = new GroupResult(); groupResult.LoadData(group); groupResult.Dock = DockStyle.Top; groupResult.SubscribeToGroup += new Delegates.Delegates.SubscribeToGroupHandler(groupResult_SubscribeToGroup); groupResult.OpenGroupResults += new Delegates.Delegates.OpenGroupResultsHandler(groupResult_OpenGroupResults); this.pGroupsList.Controls.Add(groupResult); } }
/// <summary> /// Calls the groups page. /// </summary> /// <param name="args">The args.</param> private void callGroupsPage(GroupsArgs args) { Command command = new Command(); command.Tab = "groups"; command.Args = args; this.Session.FormController.AddCommand(command); }
/// <summary> /// Loads the groups page. /// </summary> /// <param name="args">The args.</param> public void LoadGroupsPage(GroupsArgs args) { if (this.groupsPage == null) { this.CreateGroupPublicationsPage(args); } this.groupsPage.LoadGroups(groupController.SearchGroupsByName(args.Text, 10, args.Page), args); this.groupsPage.BringToFront(); this.groupsPage.Show(); }
/// <summary> /// Groups the subscription. /// </summary> /// <param name="args">The args.</param> private void groupSubscription(GroupsArgs args) { try { Guid newGuid = Guid.Empty; groupController.AddJoinRequest(out newGuid, this.Session.User.Id, this.Session.CurrentToken, args.Group.Id, this.Session.User.Id); this.Session.CurrentToken = newGuid; } catch (Exception ex) { MessageBox.Show("Error while trying to add subscription to group - " + ex.Message); } }
/// <summary> /// Executes the command group. /// </summary> /// <param name="command">The command.</param> private void executeCommandGroup(Command command) { GroupsArgs args = ((GroupsArgs)command.Args); if (args.Text == "" && args.Group == null) { this.main.CreateGroupsPage(); } else if ((args.Group == null) && (args.Text != "")) { this.main.LoadGroupsPage(args); } else { this.main.LoadGroupPublications(args); } }
/// <summary> /// Loads the group publications. /// </summary> /// <param name="args">The args.</param> public void LoadGroupPublications(GroupsArgs args) { if (this.searchPublicationPage == null) { this.CreateGroupPublicationsPage(args); } try { Guid newToken = Session.CurrentToken; this.searchPublicationPage.LoadPublications(publicationController.GetPublicationsForGroup(out newToken, args.Group.Id, Session.CurrentToken, Session.User.Id, 10, args.Page)); Session.CurrentToken = newToken; this.searchPublicationPage.BringToFront(); this.searchPublicationPage.Show(); } catch (Exception ex) { MessageBox.Show("Error while trying to load group publications " + ex.Message); } }
/// <summary> /// Creates the group publications page. /// </summary> /// <param name="args">The args.</param> public void CreateGroupPublicationsPage(GroupsArgs args) { try { this.searchPublicationPage = new PublicationsSearchResult(); this.searchPublicationPage.LoadTitle(args.Group); Guid newToken = Session.CurrentToken; this.searchPublicationPage.LoadPublications(publicationController.GetPublicationsForGroup(out newToken, args.Group.Id, Session.CurrentToken, Session.User.Id, 10, 0)); Session.CurrentToken = newToken; this.searchPublicationPage.Dock = DockStyle.Fill; this.searchPublicationPage.SubscribeToGroup += new Delegates.Delegates.SubscribeToGroupHandler(searchPublicationPage_SubscribeToGroup); this.searchPublicationPage.ChangeGroupsPage += new PublicationsSearchResult.ChangeGroupsPageHandler(searchPublicationPage_ChangeGroupsPage); this.pContent.Controls.Add(searchPublicationPage); searchPublicationPage.BringToFront(); searchPublicationPage.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Groupses the page_ subscribe to group. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupsPage_SubscribeToGroup(object sender, GroupsArgs args) { this.groupSubscription(args); }
/// <summary> /// Searches the publication page_ subscribe to group. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void searchPublicationPage_SubscribeToGroup(object sender, GroupsArgs args) { this.groupSubscription(args); }
/// <summary> /// Searches the publication page_ change groups page. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void searchPublicationPage_ChangeGroupsPage(object sender, GroupsArgs args) { this.callGroupsPage(args); }
/// <summary> /// Groupses the page_ search text. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupsPage_SearchText(object sender, GroupsArgs args) { this.callGroupsPage(args); }
/// <summary> /// Groupses the page_ call next page. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupsPage_CallNextPage(object sender, GroupsArgs args) { this.callGroupsPage(args); }
/// <summary> /// Groupses the page_ call previous page. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupsPage_CallPreviousPage(object sender, GroupsArgs args) { this.callGroupsPage(args); }
/// <summary> /// Groupses the page_ open group results. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupsPage_OpenGroupResults(object sender, GroupsArgs args) { this.callGroupsPage(args); }
/// <summary> /// Groups the result_ open group results. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupResult_OpenGroupResults(object sender, GroupsArgs args) { this.OpenGroupResults(sender, args); }
/// <summary> /// Handles the Click event of the bSubscribe control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void bSubscribe_Click(object sender, EventArgs e) { GroupsArgs args = new GroupsArgs("", 0, this.GroupData); this.SubscribeToGroup(sender, args); }
/// <summary> /// Title_s the subscribe to group. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void title_SubscribeToGroup(object sender, GroupsArgs args) { this.SubscribeToGroup(sender, args); }
/// <summary> /// Groups the result_ subscribe to group. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> void groupResult_SubscribeToGroup(object sender, GroupsArgs args) { this.SubscribeToGroup(sender, args); }
/// <summary> /// Pagination_s the call previous page. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The args.</param> private void pagination_CallPreviousPage(object sender, PageArgs args) { this.Page = args.Page; Args.GroupsArgs groupArgs = new GroupsArgs(this.TextSearched, args.Page, null); this.CallPreviousPage(sender, groupArgs); }
/// <summary> /// Handles the LinkClicked event of the lTagText control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.LinkLabelLinkClickedEventArgs"/> instance containing the event data.</param> private void lTagText_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { GroupsArgs args = new GroupsArgs("", 0, this.GroupData); this.OpenGroupResults(sender, args); }
private void ChatOnGroups(object sender, GroupsArgs e) { cbGroups.Items.Clear(); e.Groups.ForEach(x => cbGroups.Items.Add(x)); cbGroups.SelectedIndex = 0; }