none
How to schedule with Rx framework running a function at 6:00am. every day

    Question

  • How to schedule with Rx framework running a function at 6:00am. every day 

    and then run next function 8:00a.am.

    inside the function there may be smaller function should run sequentially that means a should run first before b, only a finish or timeout then run b


    Designer



    • Edited by oooooxxxxx Wednesday, August 28, 2013 2:15 AM
    Wednesday, August 28, 2013 1:26 AM

Answers

  • Hi,

    I'm not familiar with Rx Framework. But I find a sample on the CodeProject here and take a glance at the code. And I think maybe you could firstly subscribe a main working method, for example MainMethod(), and the body of the method would be like this:

    bool b=false;
    bool isAFinished=false;
    void MainMethod()
    {
    	while(b)
    	{
    		if("06:00".Equals(DateTime.Now.ToString("hhMM")))
    		{
    			MethodA();
    		}
    		if("08:00".Equals(DateTime.Now.ToString("hhMM")))
    		{
    			if(isAFinished)
    				MethodB();
    		}
    	}
    }
    void MethodA()
    {
    	if(finished)
    		isAFinished = true;
    	if(timeout)
    		isAFinished = true;
    }
    void MethodB()
    {
    	//...
    	isAFinished = false;
    }


    Caillen
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, August 29, 2013 2:45 AM