Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 /// <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);
     }
 }
Ejemplo n.º 3
0
        /// <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);
        }
Ejemplo n.º 4
0
 /// <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();
 }
Ejemplo n.º 5
0
 /// <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);
     }
 }
Ejemplo n.º 6
0
        /// <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);
            }
        }
Ejemplo n.º 7
0
        /// <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);
            }
        }
Ejemplo n.º 8
0
 /// <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);
     }
 }
Ejemplo n.º 9
0
 /// <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);
 }
Ejemplo n.º 10
0
 /// <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);
 }
Ejemplo n.º 11
0
 /// <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);
 }
Ejemplo n.º 12
0
 /// <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);
 }
Ejemplo n.º 13
0
 /// <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);
 }
Ejemplo n.º 14
0
 /// <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);
 }
Ejemplo n.º 15
0
 /// <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);
 }
Ejemplo n.º 16
0
 /// <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);
 }
Ejemplo n.º 17
0
        /// <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);
        }
Ejemplo n.º 18
0
 /// <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);
 }
Ejemplo n.º 19
0
 /// <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);
 }
Ejemplo n.º 20
0
 /// <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);
 }
Ejemplo n.º 21
0
        /// <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);
        }
Ejemplo n.º 22
0
 private void ChatOnGroups(object sender, GroupsArgs e)
 {
     cbGroups.Items.Clear();
     e.Groups.ForEach(x => cbGroups.Items.Add(x));
     cbGroups.SelectedIndex = 0;
 }