Exemple #1
0
    public List <WebsiteLink> GetAllLinks(string usernumber)
    {
        List <WebsiteLink> Links = new List <WebsiteLink>();

        OpenDBConnection();

        SqlCommand ucommand;

        ucommand = new SqlCommand("SELECT * from dash_website where fld_UserNumber = @usernumber AND (fld_Status IS NULL OR fld_Status <> 'D') order by date DESC", conn);
        ucommand.Parameters.Add(new SqlParameter("usernumber", usernumber));


        using (SqlDataReader reader = ucommand.ExecuteReader())
        {
            while (reader.Read())
            {
                WebsiteLink links = new WebsiteLink();
                links.website = reader["website"].ToString();

                Links.Add(links);
            }
        }
        ucommand.Dispose();
        CloseDBConnection();

        return(Links);
    }
Exemple #2
0
        /// <summary>
        /// Opens default web browser with provided link.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        private void ListBox_MouseLeftButtonDown_OpenLinkURL(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            ListBoxItem item = sender as ListBoxItem;

            if (item != null)
            {
                WebsiteLink link = (WebsiteLink)item.DataContext;
                Process.Start(new ProcessStartInfo(link.LinkURL));
                e.Handled = true;
            }
        }
Exemple #3
0
        /// <summary>
        /// Handles the MouseLeftButtonUp event of the MenuItems inside the Help drowndown menu.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        private void HelpMenuItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MenuItem item = sender as MenuItem;

            if (item != null)
            {
                WebsiteLink link = (WebsiteLink)item.DataContext;
                Process.Start(new ProcessStartInfo(link.LinkURL));
                e.Handled = true;
            }
        }
Exemple #4
0
        /// <summary>
        /// Opens experiment when double clicked on the row
        /// </summary>
        /// <param name="source">Source.</param>
        /// <param name="args">Arguments.</param>
        private void OpenWebsiteLink(object source, RowActivatedArgs args)
        {
            TreeIter item;
            NodeView nodeView = (NodeView)source;

            if (nodeView.Selection.GetSelected(out item))
            {
                WebsiteLink link = (WebsiteLink)nodeView.Model.GetValue(item, 1);
                link.OpenLink();
            }
        }
Exemple #5
0
 public WebsiteLinkMenuItem(WebsiteLink link) : base(link.Title)
 {
     m_websiteLink = link;
 }
Exemple #6
0
        private void RenderWebsiteLink(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            WebsiteLink websiteLink = (WebsiteLink)model.GetValue(iter, 1);

            (cell as CellRendererText).Text = websiteLink.Title + "\n" + websiteLink.Description;
        }