Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();


            AllTutorsTableAdapter tutorTableAdapt = new AllTutorsTableAdapter();

            tutorTableAdapt.Fill(tutorTable);
            ScheduleTableAdapter scheduleAdapt = new ScheduleTableAdapter();

            scheduleAdapt.Fill(scheduleTable);
            SubjectTableAdapter subjectAdapt = new SubjectTableAdapter();

            subjectAdapt.Fill(subjectTable);
            tutorTableAdapt.Dispose();
            scheduleAdapt.Dispose();
            subjectAdapt.Dispose();
            strImagePath = ConfigurationManager.AppSettings["ImagePath"];
            strPPPath    = ConfigurationManager.AppSettings["PPPath"];

            DirectoryInfo dir = new DirectoryInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, strImagePath));

            foreach (FileInfo file in dir.EnumerateFiles())
            {
                file.Delete();
            }
            int numberVisibleSlides = 0;

            for (int i = 1; i < objSlides.Count; i++)
            {
                if (objSlides[i].SlideShowTransition.Hidden == MsoTriState.msoFalse)
                {
                    objSlides[i].Export(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, strImagePath, i.ToString("D2", CultureInfo.CurrentCulture) + "_" + DateTime.Now.ToString("HH-mm-ss") + ".jpg"), "JPG");

                    numberVisibleSlides++;
                }
            }
            updateSlide = numberVisibleSlides;
            //Initialize Image control, Image directory path and Image timer.
            IntervalTimer = Convert.ToInt32(ConfigurationManager.AppSettings["IntervalTime"], CultureInfo.CurrentCulture);

            ImageControls = new[] { myImage, myImage2 };



            timerImageChange = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, IntervalTimer)
            };
            timerImageChange.Tick += new EventHandler(TimerImageChange_Tick);
            clockUpdate            = new DispatcherTimer()
            {
                Interval = new TimeSpan(0, 0, 1)
            };
            clockUpdate.Tick += new EventHandler(ClockUpdate_Tick);
        }
Exemple #2
0
        static void Init()
        {
            TutorDataSet db = new TutorDataSet();

            db.Clear();
            application.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;
            objSSS.Run();
            AllTutorsTableAdapter tutorTableAdapt = new AllTutorsTableAdapter();

            tutorTableAdapt.Fill(tutorTable);
            ScheduleTableAdapter scheduleAdapt = new ScheduleTableAdapter();

            scheduleAdapt.Fill(scheduleTable);
            SubjectTableAdapter subjectAdapt = new SubjectTableAdapter();

            subjectAdapt.Fill(subjectTable);
        }
Exemple #3
0
        public Form()
        {
            AllTutorsTableAdapter tutorTableAdapt = new AllTutorsTableAdapter();

            tutorTableAdapt.Fill(tutorTable);
            ScheduleTableAdapter scheduleAdapt = new ScheduleTableAdapter();

            scheduleAdapt.Fill(scheduleTable);
            SubjectTableAdapter subjectAdapt = new SubjectTableAdapter();

            subjectAdapt.Fill(subjectTable);
            tutorTableAdapt.Dispose();
            scheduleAdapt.Dispose();
            subjectAdapt.Dispose();
            InitializeComponent();
            Topmost = true;
        }
        public MainWindow()
        {
            InitializeComponent();
            AllTutorsTableAdapter tutorTableAdapt = new AllTutorsTableAdapter();

            tutorTableAdapt.Fill(tutorTable);
            ScheduleTableAdapter scheduleAdapt = new ScheduleTableAdapter();

            scheduleAdapt.Fill(scheduleTable);
            SubjectTableAdapter subjectAdapt = new SubjectTableAdapter();

            subjectAdapt.Fill(subjectTable);
            tutorTableAdapt.Dispose();
            scheduleAdapt.Dispose();
            subjectAdapt.Dispose();
            DirectoryInfo dir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "\\Images");

            foreach (FileInfo file in dir.EnumerateFiles())
            {
                file.Delete();
            }
            for (int i = 1; i < objSlides.Count; i++)
            {
                objSlides[i].Export(AppDomain.CurrentDomain.BaseDirectory + "\\Images\\" + (i).ToString(CultureInfo.CurrentCulture) + ".jpg", "JPG");
            }

            //Initialize Image control, Image directory path and Image timer.
            IntervalTimer = Convert.ToInt32(ConfigurationManager.AppSettings["IntervalTime"], CultureInfo.CurrentCulture);
            strImagePath  = ConfigurationManager.AppSettings["ImagePath"];
            ImageControls = new[] { myImage, myImage2 };

            //LoadImageFolder(strImagePath);

            timerImageChange = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, IntervalTimer)
            };
            timerImageChange.Tick += new EventHandler(TimerImageChange_Tick);
            clockUpdate            = new DispatcherTimer()
            {
                Interval = new TimeSpan(0, 0, 1)
            };
            clockUpdate.Tick += new EventHandler(ClockUpdate_Tick);
        }