Click here to Skip to main content
15,914,924 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public void DispatcherTimerSetup(HttpClient httpClient)
       {
           Client = httpClient;
           dispatcherTimer = new DispatcherTimer();
           dispatcherTimer.Tick += dispatcherTimer_Tick;
           dispatcherTimer.Interval = new TimeSpan(0, 1, 0); // TimeSpan for 1 Minute 0 secs
           if (!dispatcherTimer.IsEnabled)
           {
               dispatcherTimer.Start();
           }
       }



C#
class DispatcherTimer
   {
       public void Start();
   }



here I am getting this ERROR

DispatcherTimer.Start()' must declare a body because it is not marked abstract, extern, or partial
Posted

In your DispatcherTimer class, you declare a Start() method but you do not give it a body (i.e.: you do not implement the method). You should have:
C#
class DispatcherTimer
{
   public void Start()
   {
      // Your implementation of the Start() method
   }
}

or create the class as abstract and the method as virtual:
C#
abstract class DispatcherTimer
{
   public virtual void Start();
}
 
Share this answer
 
Comments
Balu Balaji 5-Dec-13 4:11am    
I tried your second method
abstract class DispatcherTimer
{
public virtual void Start();
}
But I am getting same error which I mentioned in above even I don't have any idea how to implement this start() method I am Implementing this code using C#4.0 in MVC4. I am new to this technology can you help me in this
phil.o 5-Dec-13 4:49am    
Since I do not have a clue about what you want to do, I cannot decently help you to implement. Sorry.
First we need to add this NameSpace
using System.Windows.Threading;

After that we need to add Windowsbase.dll Assembly
Now My solution working fine

Thanks to all
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900