Click here to Skip to main content
15,885,309 members
Home / Discussions / C#
   

C#

 
GeneralRe: why not escape to catch an error when i next run? Pin
Member 245846723-Feb-17 16:08
Member 245846723-Feb-17 16:08 
GeneralRe: why not escape to catch an error when i next run? Pin
OriginalGriff23-Feb-17 20:35
mveOriginalGriff23-Feb-17 20:35 
GeneralRe: why not escape to catch an error when i next run? Pin
Member 24584672-Mar-17 16:03
Member 24584672-Mar-17 16:03 
AnswerRe: why not escape to catch an error when i next run? Pin
Eddy Vluggen23-Feb-17 2:43
professionalEddy Vluggen23-Feb-17 2:43 
QuestionVS c# 2015 Setup Project: How to force Rollback before commit on my own condition Pin
nemo1423-Feb-17 1:07
nemo1423-Feb-17 1:07 
AnswerRe: VS c# 2015 Setup Project: How to force Rollback before commit on my own condition Pin
OriginalGriff23-Feb-17 1:22
mveOriginalGriff23-Feb-17 1:22 
AnswerRe: VS c# 2015 Setup Project: How to force Rollback before commit on my own condition Pin
Bernhard Hiller23-Feb-17 21:39
Bernhard Hiller23-Feb-17 21:39 
QuestionC# Winform: Slide show is not working when i use Quartz.net to fire my routine at specific time Pin
Tridip Bhattacharjee22-Feb-17 23:01
professionalTridip Bhattacharjee22-Feb-17 23:01 
here i am giving a small my code snippet just to show what i am trying to achieve.
C#
private void frmMain_Load(object sender, EventArgs e)
        {
            // construct a scheduler factory
            ISchedulerFactory schedFact = new StdSchedulerFactory();

            // get a scheduler
            sched = schedFact.GetScheduler();
            sched.Start();

            IJobDetail job = JobBuilder.Create<frmMain>()
                .WithIdentity("Job", "group")
                .Build();

            ITrigger trigger = TriggerBuilder.Create()
               .WithDailyTimeIntervalSchedule
                 (s =>
                    s.WithIntervalInHours(24)
                   .OnEveryDay()
                   .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(01, 55))
                 )
               .Build();

            sched.ScheduleJob(job, trigger);
        }

        public void Execute(IJobExecutionContext context)
        {
            generate();
        }

        public void generate()
        {
            if (this.FetchStart != null)
                this.FetchStart(this, new EventArgs());

            System.Threading.Thread.Sleep(5000);

            if (this.FetchDone != null)
                this.FetchDone(this, new EventArgs());
        }

i have done my project with VS2013 community edition. my objective is to call slide show routine every day at specific time. when i am calling my slide show routine without quartz.net scheduler then it is working fine but when i invoke my routine by quartz.net scheduler then routine is getting called but no slide show image is showing.

what [problem occur is not clear to me. as per my objective i have to use quartz.net scheduler because i need to invoke my routine at a specific time of day every day.

here i am sharing my project code because it is in onedrive. so my request please some one download my project and run at your end to see the problem and tell me the reason which causes not to show images on picture box.

if possible please rectify my code with quartz.net scheduler code. one drive project link is https://1drv.ms/f/s!AmIfMNV-CodPa81zFiNH6Ur7qro

i upload my project folder.

thanks

----------------------------------------------------------------------------------------------------------
UPDATE

when i use background worker along with quartz.net to call my generate routine then also no improvement i found. same problem that slide show image is not appearing on picture box.
here is the code for quartz.net with background worker
C#
public partial class frmMain : Form, IJob
    {
        ucSlide oSlide = new ucSlide();
        IScheduler sched = null;
        BackgroundWorker m_oWorker = null;

        public event EventHandler FetchStart;
        public event EventHandler FetchDone;
        public event EventHandler NoDataFound;

        public frmMain()
        {
            InitializeComponent();

            m_oWorker = new BackgroundWorker();
            m_oWorker.DoWork += new DoWorkEventHandler(m_oWorker_DoWork);
            m_oWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(m_oWorker_RunWorkerCompleted);

            oSlide.MainForm = this;
            oSlide.SlideSource = Utility.SlidePath;

            this.Controls.Add(oSlide);
            oSlide.Dock = DockStyle.Fill;
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            // construct a scheduler factory
            ISchedulerFactory schedFact = new StdSchedulerFactory();

            // get a scheduler
            sched = schedFact.GetScheduler();
            sched.Start();

            IJobDetail job = JobBuilder.Create<frmMain>()
                .WithIdentity("Job", "group")
                .Build();

            ITrigger trigger = TriggerBuilder.Create()
               .WithDailyTimeIntervalSchedule
                 (s =>
                    s.WithIntervalInHours(24)
                   .OnEveryDay()
                   .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(02,23))
                 )
               .Build();

            sched.ScheduleJob(job, trigger);
        }

        public void Execute(IJobExecutionContext context)
        {
            m_oWorker.RunWorkerAsync();

        }

        public void generate()
        {
            if (this.FetchStart != null)
                this.FetchStart(this, new EventArgs());

            System.Threading.Thread.Sleep(5000);

            if (this.FetchDone != null)
                this.FetchDone(this, new EventArgs());
        }

        void m_oWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            generate();
        }

        void m_oWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            // The background process is complete. We need to inspect
            // our response to see if an error occurred, a cancel was
            // requested or if we completed successfully.  
            //if (e.Cancelled)
            //{
            //    //lblStatus.Text = "Task Cancelled.";
            //    isBusy = false;
            //}

            //// Check to see if an error occurred in the background process.

            //else if (e.Error != null)
            //{
            //    //lblStatus.Text = "Error while performing background operation.";
            //    MessageBox.Show(e.Error.InnerException.Message.ToString());
            //    isBusy = false;
            //}
            //else
            //{
            //    // Everything completed normally.
            //    //lblStatus.Text = "Task Completed...";
            //    isBusy = false;
            //}
        }
    }

thanks
tbhattacharjee

AnswerRe: C# Winform: Slide show is not working when i use Quartz.net to fire my routine at specific time Pin
Pete O'Hanlon22-Feb-17 23:32
mvePete O'Hanlon22-Feb-17 23:32 
AnswerRe: C# Winform: Slide show is not working when i use Quartz.net to fire my routine at specific time Pin
Gerry Schmitz23-Feb-17 9:44
mveGerry Schmitz23-Feb-17 9:44 
QuestionSpell checker for c# project Pin
Ramesh Tigapuram21-Feb-17 22:14
Ramesh Tigapuram21-Feb-17 22:14 
AnswerRe: Spell checker for c# project Pin
Richard MacCutchan21-Feb-17 23:18
mveRichard MacCutchan21-Feb-17 23:18 
AnswerRe: Spell checker for c# project Pin
Pete O'Hanlon21-Feb-17 23:19
mvePete O'Hanlon21-Feb-17 23:19 
QuestionSea trying to change the RichTextBox does not work ? Pin
Member 245846721-Feb-17 18:59
Member 245846721-Feb-17 18:59 
AnswerRe: Sea trying to change the RichTextBox does not work ? Pin
Pete O'Hanlon21-Feb-17 21:27
mvePete O'Hanlon21-Feb-17 21:27 
QuestionPrinting arabic from epson TM-T88V VB.NET, C# Pin
aliraza156721-Feb-17 2:02
professionalaliraza156721-Feb-17 2:02 
AnswerRe: Printing arabic from epson TM-T88V VB.NET, C# Pin
Jochen Arndt21-Feb-17 2:48
professionalJochen Arndt21-Feb-17 2:48 
AnswerRe: Printing arabic from epson TM-T88V VB.NET, C# Pin
tiochus23-Feb-17 22:26
tiochus23-Feb-17 22:26 
QuestionVerify Email problem with AdminControler.cs Pin
John Nederveen20-Feb-17 9:08
John Nederveen20-Feb-17 9:08 
AnswerRe: Verify Email problem with AdminControler.cs Pin
Afzaal Ahmad Zeeshan20-Feb-17 11:09
professionalAfzaal Ahmad Zeeshan20-Feb-17 11:09 
GeneralRe: Verify Email problem with AdminControler.cs Pin
John Nederveen20-Feb-17 12:57
John Nederveen20-Feb-17 12:57 
SuggestionRe: Verify Email problem with AdminControler.cs Pin
Afzaal Ahmad Zeeshan20-Feb-17 22:49
professionalAfzaal Ahmad Zeeshan20-Feb-17 22:49 
GeneralRe: Verify Email problem with AdminControler.cs Pin
John Nederveen21-Feb-17 6:03
John Nederveen21-Feb-17 6:03 
GeneralRe: Verify Email problem with AdminControler.cs Pin
Afzaal Ahmad Zeeshan21-Feb-17 6:06
professionalAfzaal Ahmad Zeeshan21-Feb-17 6:06 
GeneralRe: Verify Email problem with AdminControler.cs Pin
John Nederveen21-Feb-17 8:20
John Nederveen21-Feb-17 8:20 

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.