Esempio n. 1
0
        void Explorer_BeforeNavigate(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Cancel)
        {
            //throw new Exception("The method or operation is not implemented.");
            ri = new RestImpl();
            string tagURL = URL;

            //MessageBox.Show("getew");
            if (!tagURL.EndsWith("/"))
            {
                tagURL += "/";
            }

            try
            {
                string target_url = "http://spheresolutions.org/feedmanager/admin/tag_counter.php";
                webRequest = ri.CreateRequestForTagCount(target_url, tagURL);

                string response = ri.GetResponse(webRequest);

                this.lblSubmitThisStory.Text = "Submit this story ";

                if (Int32.Parse(response) > 0)
                {
                    this.lblSubmitThisStory.Text += "(" + response + ")";
                }
                else
                {
                    this.lblSubmitThisStory.Text += "(" + response + ")";
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 2
0
        void timer2_Tick(object sender, EventArgs e)
        {
            ri = new RestImpl();
            string tagURL = Explorer.LocationURL;

            if (tagURL != previousURL && tagURL != String.Empty)
            {
                previousURL = tagURL;
                try
                {
                    string target_url = "http://sgcsoft.net/work/commoncause/admin/tag_counter.php";
                    webRequest = ri.CreateRequestForTagCount(target_url, tagURL);

                    string response = ri.GetResponse(webRequest);
                    this.lblTags.Text = "";

                    if (Int32.Parse(response) > 0)
                    {
                        this.lblTags.Text = "Add (" + response + ")";
                    }
                    else
                    {
                        this.lblTags.Text = "Add (" + response + ")";
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Esempio n. 3
0
        private void pcboxDrop_Click(object sender, MouseEventArgs e)
        {
            RestImpl ri = new RestImpl();

            string tagURL = Explorer.LocationURL;

            //if (tagURL.StartsWith("http://") )
            //{
            //    tagURL = tagURL.Substring(7, tagURL.Length - 7);
            //}
            //if (tagURL.StartsWith("https://"))
            //{
            //    tagURL = tagURL.Substring(8, tagURL.Length - 8);
            //}
            //tagURL = tagURL.Substring(0, tagURL.Length - 1);


            try
            {
                string         target_url = "http://sgcsoft.net/work/commoncause/admin/tag_counter.php";
                HttpWebRequest webRequest = ri.CreateRequestForTagCount(target_url, tagURL);

                string response = ri.GetResponse(webRequest);


                this.addUrlToolStripMenuItem.Text = "";
                if (Int32.Parse(response) > 0)
                {
                    this.addUrlToolStripMenuItem.Text = "Add URL: " + response + " Tags";
                }
                else
                {
                    this.addUrlToolStripMenuItem.Text = "Add URL: " + response + " Tag";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addUrlToolStripMenuItem });
            this.contextMenuStrip1.Name = "contextMenuStrip1";

            this.contextMenuStrip1.Size = new System.Drawing.Size(149, 48);
            this.contextMenuStrip1.ResumeLayout(false);
            this.contextMenuStrip1.Show(this.Location.X + 35, this.Location.Y + 65);
        }
Esempio n. 4
0
        private void pcboxDrop_Click(object sender, MouseEventArgs e)
        {
            RestImpl ri = new RestImpl();

            string tagURL = Explorer.LocationURL;



            try
            {
                string         target_url = "http://spheresolutions.org/feedmanager/admin/tag_counter.php";
                HttpWebRequest webRequest = ri.CreateRequestForTagCount(target_url, tagURL);

                string response = ri.GetResponse(webRequest);


                this.addUrlToolStripMenuItem.Text = "";
                if (Int32.Parse(response) > 0)
                {
                    this.addUrlToolStripMenuItem.Text = "Add URL: " + response + " Tags";
                }
                else
                {
                    this.addUrlToolStripMenuItem.Text = "Add URL: " + response + " Tag";
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString());
            }
            this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addUrlToolStripMenuItem });
            this.contextMenuStrip1.Name = "contextMenuStrip1";

            this.contextMenuStrip1.Size = new System.Drawing.Size(149, 48);
            this.contextMenuStrip1.ResumeLayout(false);
            this.contextMenuStrip1.Show(this.Location.X + 35, this.Location.Y + 65);
        }
Esempio n. 5
0
        public void loadTags(object pDisp, ref object URL)
        {
            MessageBox.Show("HIT !!!!");

            ri = new RestImpl();
            string tagURL = URL.ToString();

            try
            {
                string target_url = "http://sgcsoft.net/work/commoncause/admin/tag_counter.php";
                webRequest = ri.CreateRequestForTagCount(target_url, tagURL);

                string response = ri.GetResponse(webRequest);


                this.lblTags.Text = "";

                if (Int32.Parse(response) > 0)
                {
                    this.lblTags.Text = "Add (" + response + ")";
                }
                else
                {
                    this.lblTags.Text = "Add (" + response + ")";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            //this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addUrlToolStripMenuItem });
            //this.contextMenuStrip1.Name = "contextMenuStrip1";

            //this.contextMenuStrip1.Size = new System.Drawing.Size(149, 48);
            //this.contextMenuStrip1.ResumeLayout(false);
            //this.contextMenuStrip1.Show(this.Location.X + 35, this.Location.Y + 65);
        }
Esempio n. 6
0
        private void CommonCause_Load(object sender, EventArgs e)
        {
            previousURL = Explorer.LocationURL;
            MessageBox.Show(previousURL);
            if (previousURL != String.Empty)
            {
                try
                {
                    ri = new RestImpl();
                    string target_url = "http://sgcsoft.net/work/commoncause/admin/tag_counter.php";
                    webRequest = ri.CreateRequestForTagCount(target_url, previousURL);

                    string response = ri.GetResponse(webRequest);
                    MessageBox.Show(response);
                    this.lblTags.Text = "";

                    if (Int32.Parse(response) > 0)
                    {
                        this.lblTags.Text = "Add (" + response + ")";
                    }
                    else
                    {
                        this.lblTags.Text = "Add (" + response + ")";
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            timer2.Start();
            timer2.Tick += new EventHandler(timer2_Tick);
            //MessageBox.Show("Hi ! iam changing how r u????????");
            ri = new RestImpl();
            IDictionary <String, String> paramList = new Dictionary <String, String>();

            //MessageBox.Show(strResponse);
            try
            {
                string target_url = "http://sgcsoft.net/work/commoncause/admin/commoncause_xml.php";
                webRequest  = ri.CreateRequest(target_url, paramList);
                strResponse = ri.GetXMLResponse(webRequest);

                /*get the deley counter*/
                XmlNodeList list      = strResponse.GetElementsByTagName("alerts");
                XmlElement  element   = (XmlElement)list.Item(0);
                Int32       deleyTime = Int32.Parse(element.GetAttribute("delay"));
                //MessageBox.Show("DELAY TIME IS : " + deleyTime.ToString());
                //MessageBox.Show(element.InnerText);

                /*get the alert messages*/
                alertlist = strResponse.GetElementsByTagName("alert");

                counter      = 0;
                srchLbl.Text = "";
                srchLbl.Text = alertlist.Item(counter).InnerText;

                timer1.Start();
                timer1.Interval = deleyTime * 1000;
                timer1.Tick    += new EventHandler(timer1_Tick);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
            }


            this.imgbtn.Location = new System.Drawing.Point(Screen.PrimaryScreen.Bounds.Width - 200, 0);
            this.Controls.Add(this.imgbtn);
        }