Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reflection Parameter Problem object[] Pin
Gideon Engelberth11-Dec-09 4:23
Gideon Engelberth11-Dec-09 4:23 
QuestionSendTcpSynExample.cs Pin
3bood.ghzawi10-Dec-09 21:27
3bood.ghzawi10-Dec-09 21:27 
AnswerRe: SendTcpSynExample.cs Pin
Covean10-Dec-09 23:03
Covean10-Dec-09 23:03 
QuestionSendTcpSynExample.cs Pin
3bood.ghzawi10-Dec-09 21:24
3bood.ghzawi10-Dec-09 21:24 
AnswerRe: SendTcpSynExample.cs Pin
dan!sh 10-Dec-09 22:24
professional dan!sh 10-Dec-09 22:24 
QuestionHow can I embedd MsWord in Iframe on my aspx page using C#.Net Pin
jalajbakshi10-Dec-09 18:15
jalajbakshi10-Dec-09 18:15 
AnswerRe: How can I embedd MsWord in Iframe on my aspx page using C#.Net Pin
ravinder4u10-Dec-09 18:19
ravinder4u10-Dec-09 18:19 
QuestionControl.Invoke must be used to interact with controls created on a seperate thread Pin
benjamin yap10-Dec-09 18:02
benjamin yap10-Dec-09 18:02 
Hi, I get this error despite create a delegate..

private delegate void ResumeChart();
ResumeChart ChartResume;

private void ResumeChartLayout()
{
    this.m_ChartControl.ResumeChartLayout();
}

void ResetChart()
{
    this.Invoke(ChartResume);
}


Inside my constructor I have this.

public frmGraph(String stockQuote,String[] args)
{
    InitializeComponent();
    newArgs = new String[args.Length];
    Array.Copy(args, newArgs, args.Length);
    token = newArgs[0];

    this.stockQuote = stockQuote;
    //this.stockQuote = "MGM";
    label1.Text = stockQuote;
    this.Text = stockQuote + " Graph";
    ChartResume = ResumeChartLayout;
}


Inside my form load, i create a new thread to call another function

        private void frmGraph_Load(object sender, EventArgs e)
        {   
            FillDataTable();

            //SetFilter(DateTime.Now.AddDays(-9), DateTime.Now);
            m_ChartControl.Charts[0].Data = this.GenareteDataForCandle();
            m_ChartControl.SuspendChartLayout();
            m_ChartControl.LoadTheme("Manco.Chart.CF.Theme.xml");
            m_ChartControl.Charts[0].ChartType = ChartType.Line;

            m_ChartControl.Charts[0].ValueAxisList[0].Min = this.m_dStokMin;
            m_ChartControl.Charts[0].ValueAxisList[0].Max = this.m_dStokMax;


            workerThread2 = new Thread(new ThreadStart(AddAnnotations));
            workerThread2.Start();

            m_ChartControl.ResumeChartLayout();
        }


This is my AddAnnotation function that will invoke the ResetChart() method

public void AddAnnotations()
{
    string toa = "calls";
    Annotation[] anno = null;
    int countA = 0;
    int arrayIndex = 0;
    while (true)
    {

        XmlDocument xmlPlogs = getAllPlogs(toa);
        XmlNodeList plogs = xmlPlogs.SelectNodes("/PlogList/Plog");

        foreach (XmlNode plog in plogs)
        {
            XmlNodeList receivers = plog.SelectNodes("PlogUnique/Message/Receiver");

            foreach (DateTime dt in dateArray)
            {
                DateTime newDT = Convert.ToDateTime(plog.SelectSingleNode("PlogCommon/TimeOfOccurrence").InnerText);
                newDT = Convert.ToDateTime(newDT.ToString("dd MMM"));
                String content = plog.SelectSingleNode("PlogUnique/Message/Content").InnerText;
                if((content.Contains(stockQuote)) && (newDT.ToString() == dt.ToString()))
                {
                    for (int i = 0; i < dateArray.Length; i++)
                    {
                        if (dateArray[i] == newDT)
                        {
                            arrayIndex = i;
                        }
                    }
                    anno[countA] = m_ChartControl.Charts[0].AnnotationList.CreateAnnotation();
                    anno[countA].Location.TypeX = LengthType.Bound;
                    anno[countA].Location.X = arrayIndex;
                    anno[countA].Location.TypeY = LengthType.Bound;
                    anno[countA].Location.Y = 0;

                    anno[countA].Data = "     ";
                    anno[countA].Font.Size = 4;
                    anno[countA].Font.Bold = false;
                    anno[countA].Color = Color.FromArgb(1, 1, 1);

                    modulePath = this.GetType().Module.FullyQualifiedName;
                    moduleDir = Path.GetDirectoryName(modulePath);
                    anno[countA].ImageFile = Path.Combine(moduleDir, "ArrUp.png");
                    countA++;
                }

            }
        }
        Thread.Sleep(5 * 60 * 1000);
        ResetChart();
    }
}

AnswerRe: Control.Invoke must be used to interact with controls created on a seperate thread Pin
vivasaayi10-Dec-09 20:58
vivasaayi10-Dec-09 20:58 
GeneralRe: Control.Invoke must be used to interact with controls created on a seperate thread Pin
benjamin yap10-Dec-09 21:34
benjamin yap10-Dec-09 21:34 
GeneralRe: Control.Invoke must be used to interact with controls created on a seperate thread Pin
vivasaayi11-Dec-09 1:32
vivasaayi11-Dec-09 1:32 
GeneralRe: Control.Invoke must be used to interact with controls created on a seperate thread [modified] Pin
benjamin yap11-Dec-09 4:32
benjamin yap11-Dec-09 4:32 
QuestionGeneric Property Error Pin
Lino Chacko10-Dec-09 16:41
Lino Chacko10-Dec-09 16:41 
AnswerRe: Generic Property Error Pin
Migounette10-Dec-09 22:48
Migounette10-Dec-09 22:48 
QuestionHow to traverse a tree (class containing parent and child properties of the same class) using threads? Pin
Rafferty Uy10-Dec-09 15:42
Rafferty Uy10-Dec-09 15:42 
AnswerRe: How to traverse a tree (class containing parent and child properties of the same class) using threads? Pin
Migounette11-Dec-09 4:41
Migounette11-Dec-09 4:41 
Questionhi Pin
bassam eshteba10-Dec-09 12:43
bassam eshteba10-Dec-09 12:43 
AnswerRe: hi Pin
Sir Dot Net10-Dec-09 13:23
Sir Dot Net10-Dec-09 13:23 
GeneralRe: hi Pin
bassam eshteba10-Dec-09 14:00
bassam eshteba10-Dec-09 14:00 
Questionhi Pin
bassam eshteba10-Dec-09 12:01
bassam eshteba10-Dec-09 12:01 
AnswerRe: hi Pin
Luc Pattyn10-Dec-09 12:04
sitebuilderLuc Pattyn10-Dec-09 12:04 
JokeRe: hi Pin
dan!sh 10-Dec-09 17:51
professional dan!sh 10-Dec-09 17:51 
AnswerRe: hi Pin
bassam eshteba10-Dec-09 12:17
bassam eshteba10-Dec-09 12:17 
GeneralRe: hi Pin
Luc Pattyn10-Dec-09 14:10
sitebuilderLuc Pattyn10-Dec-09 14:10 
QuestionUsing html agility pack Pin
Baeltazor10-Dec-09 11:01
Baeltazor10-Dec-09 11:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.