コード例 #1
5
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.AddExtension = true;
            ofd.DefaultExt = "*.*";
            ofd.Filter = "Media Files (*.*)|*.*";
            ofd.ShowDialog();

            try
            {
                mediaElement.Source = new Uri(ofd.FileName);
                textBlock.Text = mediaElement.Volume.ToString();
                mediaElement.Pause();
            }

            catch
            {
                new NullReferenceException("Error");
            }

            System.Windows.Threading.DispatcherTimer dispatchTimer = new System.Windows.Threading.DispatcherTimer();
            dispatchTimer.Tick += new EventHandler(timer_Tick);
            dispatchTimer.Interval = new TimeSpan(0, 0, 1);
            dispatchTimer.Start();
        }
コード例 #2
0
 public ImageExt()
 {
     InitializeComponent();
     timer = new System.Windows.Threading.DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(30);
     timer.Tick += new EventHandler(timer_Tick);
 }
コード例 #3
0
 void _splashScreen_Tick(object sender, EventArgs e)
 {
     _splashTimer.Stop();
     _splashTimer.Tick -= new EventHandler(_splashScreen_Tick);
     _splashTimer = null;
     NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
 }
コード例 #4
0
        private void HandleLoaded(object sender, RoutedEventArgs e)
        {
            if (bridge == null)
            {
                WPFSpinnakerConfiguration.Init();

                // Using log4net with Spinnaker is optional.
                log4net.Config.XmlConfigurator.Configure();
                SpinnakerLog4netAdapter.Init();

                bridge = SpinnakerConfiguration.CurrentConfig.CreateBrowserBridge(webBrowser);
                SplashViewModel splashViewModel = new SampleApplication.Core.SampleApplication().Init();
                bridge.ShowView("SplashView.html", splashViewModel);
                splashViewModel.PropertyChanged += (propSender,propChangeEvent) =>
                {
                    if (propChangeEvent.PropertyName == "CurrentPage")
                        bridge.ExecuteScriptFunction("setHeroBackground");
                };

                System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
                dispatcherTimer.Tick += new EventHandler((o, tickArgs) =>
                {
                    splashViewModel.RealtimeViewModel.HandleGUITimerTick();
                });
                dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 50);
                dispatcherTimer.Start();
            }
        }
コード例 #5
0
 private void StartTimer(object sender, System.Windows.RoutedEventArgs e)
 {
     System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
     myDispatcherTimer.Interval = new TimeSpan(0, 0, 1);
     myDispatcherTimer.Tick += new EventHandler(Each_Tick);
     myDispatcherTimer.Start();
 }
コード例 #6
0
 public SplashScreen()
 {
     InitializeComponent();
     _splashTimer = new System.Windows.Threading.DispatcherTimer();
     this.Loaded += new RoutedEventHandler(SplashScreen_Loaded);
     progressBar.IsIndeterminate = true;
 }
コード例 #7
0
        //runs everything.
        public MainWindow() {
            InitializeComponent();
            _writer = null;

            //state variables
            _logging = false;
            _email_logging = false;
            _log_path = GetDefaultDirectory();

            //create the page objects
            CreatePages();
            ContentFrame.Navigate(_student_id_page);

            //sets up timers to go at particular times
            //start of cougtech and end of cougtech working hours
            startDayTimer = new System.Windows.Threading.DispatcherTimer(); // Timer to automatically start logging at 8:00 am
            startDayTimer.Interval = TimeUntilNextTimer(startTime);
            startDayTimer.IsEnabled = true;
            startDayTimer.Tick += new EventHandler(AutoStartLog);

            endDayTimer = new System.Windows.Threading.DispatcherTimer(); // Timer to automatically end logging at 5:00 pm
            endDayTimer.Interval = TimeUntilNextTimer(endTime);
            endDayTimer.IsEnabled = true;
            endDayTimer.Tick += new EventHandler(AutoEndLog);

            ContentFrame.Navigated += ContentFrame_Navigated;
            ContentFrame.Navigating += ContentFrame_Navigating;

        }
コード例 #8
0
ファイル: RuleLine.xaml.cs プロジェクト: JuRogn/OA
 public RuleLine()
 {
     InitializeComponent();
     _doubleClickTimer = new System.Windows.Threading.DispatcherTimer();
     _doubleClickTimer.Interval = new TimeSpan(0, 0, 0, 0, 200);
     _doubleClickTimer.Tick += new EventHandler(DoubleClick_Timer);
 }
コード例 #9
0
        public MainWindow()
        {
            InitializeComponent();
            logger.Trace("After InitializeComponent");
            // Add all the sample stations to the main grid
            addStationControlToGrid(sampleGrid);
            logger.Trace("Added station control to grid");
            // Create a dispatch timer that will be triggered every second.
            dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            logger.Trace("Timer created");

            // Search for the NLog config named sampleFile (or wrapped_sampleFile) and show the location on the screen
            LoggingConfiguration config = LogManager.Configuration;
            foreach (Target currentTarget in config.AllTargets)
            {
                if (currentTarget is FileTarget)
                {
                    if (currentTarget.Name.StartsWith("sampleFile"))
                    {

                        FileTarget standardTarget = currentTarget as FileTarget;
                        string expandedFileName = NLog.Layouts.SimpleLayout.Evaluate(standardTarget.FileName.ToString());
                        logFileLocationTextBlock.Text = expandedFileName;
                        break;
                    }
                }
            }
        }
コード例 #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TaskDialogViewModel"/> class.
        /// </summary>
        /// <param name="options">Options to use.</param>
        public TaskDialogViewModel(TaskDialogOptions options)
            : this()
        {
            this.options = options;

            _expandedInfoVisible = options.ExpandedByDefault;
            _verificationChecked = options.VerificationByDefault;

            if (options.EnableCallbackTimer)
            {
                // By default it will run on the default dispatcher and with Background priority
                _callbackTimer = new System.Windows.Threading.DispatcherTimer();

                _callbackTimer.Interval = CallbackTimerInterval;
                _callbackTimer.Tick += new EventHandler(CallbackTimer_Tick);
            }

            FixAllButtonLabelAccessKeys();

            // If radio buttons are defined, set the radio result to the default selected radio
            if (RadioButtons.Count > 0)
            {
                _radioResult = RadioButtons[DefaultButtonIndex].ID;
            }
        }
コード例 #11
0
 public void StartTimer()
 {
     submitTimer = new System.Windows.Threading.DispatcherTimer();
     submitTimer.Interval = TimeSpan.FromSeconds(10);
     submitTimer.IsEnabled = true;
     submitTimer.Tick += SubmitTimer_Tick;
 }
コード例 #12
0
        public CuttingPage(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder,
            YellowstonePathology.Business.Test.Model.TestOrder testOrder,
            YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
            YellowstonePathology.Business.Label.Model.HistologySlidePaperLabelPrinter histologySlidePaperLabelPrinter,
            YellowstonePathology.UI.Navigation.PageNavigator pageNavigator)
        {
            this.m_AliquotOrder = aliquotOrder;
            this.m_AccessionOrder = accessionOrder;
            this.m_TestOrder = testOrder;
            this.m_PageNavigator = pageNavigator;
            this.m_HistologySlidePaperLabelPrinter = histologySlidePaperLabelPrinter;

            this.m_SpecimenOrder = this.m_AccessionOrder.SpecimenOrderCollection.GetSpecimenOrderByAliquotOrderId(this.m_AliquotOrder.AliquotOrderId);
            this.m_PanelSetOrder = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrderByTestOrderId(this.m_TestOrder.TestOrderId);
            this.m_PanelOrder = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelOrderByTestOrderId(this.m_TestOrder.TestOrderId);

            this.m_SystemIdentity = Business.User.SystemIdentity.Instance;

            this.m_ListBoxSlidesMouseDownTimer = new System.Windows.Threading.DispatcherTimer();
            this.m_ListBoxSlidesMouseDownTimer.Interval = new TimeSpan(0, 0, 0, 0, 750);
            this.m_ListBoxSlidesMouseDownTimer.Tick += new EventHandler(ListBoxSlidesMouseDownTimer_Tick);

            this.m_BarcodeScanPort = YellowstonePathology.Business.BarcodeScanning.BarcodeScanPort.Instance;

            InitializeComponent();
            DataContext = this;

            this.m_PageTimeoutTimer = new System.Windows.Threading.DispatcherTimer();
            this.m_PageTimeoutTimer.Interval = TimeSpan.FromMinutes(15);
            this.m_PageTimeoutTimer.Tick += new EventHandler(PageTimeoutTimer_Tick);
            this.m_PageTimeoutTimer.Start();

            this.Loaded += new RoutedEventHandler(CuttingPage_Loaded);
            this.Unloaded += new RoutedEventHandler(CuttingPage_Unloaded);
        }
コード例 #13
0
 public void StopTimer()
 {
     if (submitTimer != null) {
         submitTimer.IsEnabled = false; // stop timer
         submitTimer = null;
     }
 }
コード例 #14
0
        ObservableBackwardsRingBuffer<WeakReference> focussedElementBuffer = new ObservableBackwardsRingBuffer<WeakReference>(10);//because we don't know which controls to track until after the RapidFindReplaceControl is created, we must record a list and pick the first one that is pertinent
        
        public FocusMonitor(DependencyObject focusScopeToMonitor)
        {
            if (focusScopeToMonitor!=null && FocusManager.GetIsFocusScope(focusScopeToMonitor))
            {
                this.focusScopeToMonitorRef = new WeakReference(focusScopeToMonitor);
            }

            //poll for focus to track ordering of focused elements
            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += delegate{
                if (focusScopeToMonitorRef!=null && focusScopeToMonitorRef.IsAlive)
                {
                    IInputElement logicalFocus = FocusManager.GetFocusedElement(focusScopeToMonitorRef.Target as DependencyObject);
                    IInputElement keyboardFocus = Keyboard.FocusedElement;
                    if (logicalFocus == keyboardFocus && keyboardFocus is UIElement)
                    {
                        //if(RapidFindReplaceControl.GetIsFindable(keyboardFocus as UIElement))
                            //lastKeyboardFocusRef = new WeakReference(keyboardFocus as DependencyObject);
                        if (focussedElementBuffer.Count==0 || (focussedElementBuffer[0] != null && focussedElementBuffer[0].IsAlive && focussedElementBuffer[0].Target != keyboardFocus))
                            focussedElementBuffer.AddItem(new WeakReference(keyboardFocus as UIElement));
                    }
                }
                else
                    dispatcherTimer.Stop();
            };
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            dispatcherTimer.Start();
        }
コード例 #15
0
 public MainWindows()
 {
     InitializeComponent();
     Timer timActu = new Timer();
     timActu.Interval = new TimeSpan(0, 5, 0);
     timActu.Tick += timActu_Tick;
 }
コード例 #16
0
 private void CreateTimer()
 {
     System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
     dispatcherTimer.Tick += new EventHandler(tmrSecond_Tick);
     dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
     dispatcherTimer.Start();
 }
コード例 #17
0
        public StandardMainControl()
        {
            UserIDClick = new Utility.CommandHandler(
                delegate(object sender)
                {
                    UserSelectWindow win = new UserSelectWindow();
                    win.EquipmentInstance = EquipmentInstance;
                    win.Owner = Application.Current.Windows.OfType<Window>().SingleOrDefault(x => x.IsActive);

                    if ((bool)win.ShowDialog() == true)
                    {
                        EquipmentInstance.CurrentUser = win.SelectedUser;
                    }
                }, true);

            InitializeComponent();

            Manager.LogManager.Instance.OnWriteTraceLog += WriteTraceLog;

            System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            timer.Tick +=
                delegate(object sender, EventArgs e)
                {
                    CurrentTime = DateTime.Now;
                };

            timer.Start();
        }
コード例 #18
0
        public MainPage()
        {
            // Required to initialize variables
            InitializeComponent();

            //ScalePlayer();
            SizeChanged += MainPage_SizeChanged;
            LayoutUpdated += MainPage_LayoutUpdated;

            MediaControls.TogglePlay += MediaControls_TogglePlay;
            MediaControls.StopVideo += MediaControls_StopVideo;
            MediaControls.JumpBack += MediaControls_JumpBack;
            MediaControls.JumpForward += MediaControls_JumpForward;
            MediaControls.VolumeChanged += MediaControls_VolumeChanged;
            MediaControls.PositionMarkerChanged+=MediaControls_PositionMarkerChanged;
            MediaControls.FastForward += MediaControls_FastForward;
            MediaControls.Rewind += MediaControls_Rewind;
            MediaControls.GoFullscreen += MediaControls_GoFullscreen;

            MediaPlayer.CurrentStateChanged += MediaPlayer_CurrentStateChanged;
            MediaPlayer.MarkerReached += MediaPlayer_MarkerReached;
            MediaPlayer.MediaEnded += MediaPlayer_MediaEnded;
            MediaPlayer.MediaFailed += MediaPlayer_MediaFailed;

            //SizeChanged+=MainPage_SizeChanged;

            // Start a periodic timer to keep the controls up to date.
            timer = new System.Windows.Threading.DispatcherTimer {Interval = TimeSpan.FromSeconds(0.5)};
            timer.Tick += timer_Tick;
            timer.Start();
        }
コード例 #19
0
        //private void rightOverLeft_Checked(object sender, RoutedEventArgs e)
        //{
        //    colorWindow.changeHandOrientation(0);
        //}

        //private void leftOverRight_Checked(object sender, RoutedEventArgs e)
        //{
        //    colorWindow.changeHandOrientation(1);
        //}


        private void calibrateButton_Click(object sender, RoutedEventArgs e)
        {
                myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
                myDispatcherTimer.Interval = new TimeSpan(0, 0, 1); // 1 second
                myDispatcherTimer.Tick += new EventHandler(Each_Tick);
                myDispatcherTimer.Start();
        }
コード例 #20
0
        public Accelerometro()
        {
            InitializeComponent();

            accelerometer = new Accelerometer();
            accelerometer.TimeBetweenUpdates = TimeSpan.FromMilliseconds(100);
            accelerometer.Start();

            myFile = IsolatedStorageFile.GetUserStoreForApplication();

            if (!myFile.FileExists("Impo.txt"))
            {
                IsolatedStorageFileStream dataFile = myFile.CreateFile("Impo.txt");
                dataFile.Close();
            }

            Wb = new WebBrowser();
            Connesso = false;
            Carica();

            System.Windows.Threading.DispatcherTimer dt = new System.Windows.Threading.DispatcherTimer();
            dt.Interval = new TimeSpan(0, 0, 0, 0, 250); // 500 Milliseconds
            dt.Tick += new EventHandler(dt_Tick);
            dt.Start();
        }
コード例 #21
0
 public void Logger_Loaded(object sender, RoutedEventArgs e)
 {
     var dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
     dispatcherTimer.Tick += OnTimerEvent;
     dispatcherTimer.Interval = new TimeSpan(Settings.Default.FrequencySelector, 0, 0);
     dispatcherTimer.Start();
 }
コード例 #22
0
        public MainViewModel()
        {
            this.agencies = new ObservableCollection<Agency>();
            this.routes = new ObservableCollection<Route>();
            this.stops = new ObservableCollection<Stop>();
            this.selectedRoutesNames = new ObservableCollection<string>();
            this.currVehicles = new ObservableCollection<Vehicle>();

            this.routeCache = new Dictionary<long, Route>();
            this.stopCache = new Dictionary<long, Stop>();
            this.arrivalCache = new Dictionary<long, Dictionary<long, ArrivalInfo>>();
            this.segmentCache = new Dictionary<long,string>();

            this.selectedRoutes = new List<long>();
            this.selectedAgencies = new List<long>();

            this.restoredAgencies = new List<long>();
            this.restoredRoutes = new List<long>();

            dt = new System.Windows.Threading.DispatcherTimer();
            dt.Interval = new TimeSpan(0, 0, 0, 5);
            dt.Tick += new EventHandler(dt_Tick);
            dt.Start();

            dataHandler = new TranslocDataHandler();
        }
コード例 #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScratchpadControl"/> class.
        /// </summary>
        public ScratchpadControl()
        {
            this.InitializeComponent();

            mDlgOpen = new Microsoft.Win32.OpenFileDialog {Filter = "Text files (*.txt)|*.txt"};

            mDlgSave = new Microsoft.Win32.SaveFileDialog
            {
                Filter = "Text file (*.txt)|*.txt",
                //REMOVE IN RELEASE
                InitialDirectory = @"D:\Applications\Workspace\Cpp\"
            };

            contentPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ScratchPadExtension";
            Directory.CreateDirectory(contentPath);

            contentPath += "\\currContent.txt";

            //Make config file if doesn't exist
            if (!File.Exists(contentPath))
            {
                File.WriteAllText(contentPath, "");
            }

            // Set timer to save file contents no more often than once every 30 seconds and only after modification
            dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 30);

            //Read file path of last content
            ScratchBox.Text = File.ReadAllText(contentPath);
        }
コード例 #24
0
 private void startTimer()
 {
     System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
     dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
     dispatcherTimer.Interval = new TimeSpan(0, 0, 3);
     dispatcherTimer.Start();
 }
コード例 #25
0
        //------------------------------------------------------
        //
        //  Constructor
        //
        //------------------------------------------------------
        public Gameplay(int initialHeight, int initialWidth)
        {
            InitializeComponent();
            this.initialHeight = initialHeight;
            this.initialWidth = initialWidth;
            tileSizeWidth = CANVAS_SIZE[0] / initialWidth;
            tileSizeHeight = CANVAS_SIZE[1] / initialHeight;
            canvas.Width = CANVAS_SIZE[0];
            canvas.Height = CANVAS_SIZE[1];

            //focus on button to enable keyhanling
            buttonNewPuzzle.Focus();
            
            //new game
            buttonNewPuzzle_Click(null, null);
            
            //speed of autosolver
            dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 400);
            dispatcherTimer.Start();
            
            //clock timer
            timererek = new System.Windows.Threading.DispatcherTimer();
            timererek.Tick += new EventHandler(timerek_Tick);
            timererek.Interval = new TimeSpan(0, 0, 1);
            timererek.Start();
        }
コード例 #26
0
        public override void OnPlotterAttached(Plotter plotter)
        {
            base.OnPlotterAttached(plotter);

            timer = new System.Windows.Threading.DispatcherTimer();
            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = TimeSpan.FromMilliseconds(1);



            plotter.CentralGrid.MouseLeftButtonDown += new MouseButtonEventHandler(CentralGrid_MouseLeftButtonDown);
            plotter.CentralGrid.MouseLeftButtonUp += new MouseButtonEventHandler(CentralGrid_MouseLeftButtonUp);

            plotter.CentralGrid.MouseMove += new MouseEventHandler(CentralGrid_MouseMove);
            plotter.CentralGrid.MouseWheel += new MouseWheelEventHandler(CentralGrid_MouseWheel);
            plotter.CentralGrid.MouseLeave += new MouseEventHandler(CentralGrid_MouseLeave);
            //plotter.CentralGrid.MouseEnter += new MouseEventHandler(CentralGrid_MouseEnter);
            plotter.KeyDown += new KeyEventHandler(plotter_KeyDown);
            plotter.KeyUp += new KeyEventHandler(plotter_KeyUp);

            zoomingRect.Stroke = new SolidColorBrush(Colors.LightGray);
            Color fillColor = new Color();
            fillColor.A = 40;
            fillColor.R = 0x80;
            fillColor.G = 0x80;
            fillColor.B = 0x80;
            zoomingRect.RadiusX = 2;
            zoomingRect.RadiusY = 2;

            zoomingRect.Fill = new SolidColorBrush(fillColor);
        }
コード例 #27
0
        private async void ButtonStart_Click(object sender, RoutedEventArgs e)
        {
            ButtonStart.IsEnabled = false;
            Slider_Duration.IsEnabled = false;


            TimeSpan duration = TimeSpan.FromSeconds(this.Slider_Duration.Value);


            System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Start();
            timer.Tick += timer_Tick;


            LabelCountdown.Content = Convert.ToInt32(duration.TotalSeconds);


            try
            {
                await StartTimerAsync(duration);
            }
            finally
            {
                timer.Stop();
                ButtonStart.IsEnabled = true;
                Slider_Duration.IsEnabled = true;
                LabelCountdown.Content = 0;
            }
        }
コード例 #28
0
        // コンストラクター
        public MainPage()
        {
            InitializeComponent();

            // 100ミリ秒毎に満了する様にタイマーを開始
            readTimer = new System.Windows.Threading.DispatcherTimer();
            readTimer.Tick += new EventHandler( readTimer_Tick );
            readTimer.Interval = TimeSpan.FromMilliseconds( 100 );
            //readTimer.Start();

            try {
                canvas1.Width = width;
                canvas1.Height = height;

                myClient.BeginJoinGroup(
                    result =>
                    {
                        try {
                            myClient.EndJoinGroup( result );
                            myClient.MulticastLoopback = true;
                        }
                        catch ( Exception ex ) {
                            MessageBox.Show( "Join succeeded. but something wrong. " + ex.Message );
                        }
                    }, null
                );

                Receive();
            }
            catch ( Exception ex ) {
                MessageBox.Show( "Join failed. " + ex.Message );
            }
        }
コード例 #29
0
ファイル: Visualiser.xaml.cs プロジェクト: imanavaz/CONVErT
        public Visualiser()
        {
            InitializeComponent();

            //sourceFile = "../../Resources/salestable.xml";
            //tvvm = new TreeViewViewModel(sourceFile);
            //ModelTreeView.DataContext = tvvm;
            myToolbox = new Toolbox();
            //string elementsFile = DirectoryHelper.getFilePath("Resources\\ToolBoxItems.xml");
            //loadToolboxes(elementsFile);

            suggestions = new ObservableCollection<Suggestion>();
            suggestionsListBox.ItemsSource = suggestions;

            //initiate the scheduling canvas
            initiateSchedulingCanvas();

            prettyPrinter = new XmlPrettyPrinter();

            ShowSample = false;//set popup for sample to false

            popupTimer = new System.Windows.Threading.DispatcherTimer();
            popupTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            popupTimer.Interval = new TimeSpan(0, 0, 2);

            logger = new Logger("VisualiserLogger");
            logsTab.Content = logger;
        }
コード例 #30
0
        public MainPage()
        {
            InitializeComponent();
            SettingsFrame.Opacity = 0;

            if (!Application.Current.IsRunningOutOfBrowser)
            {
                closeImage.Visibility = System.Windows.Visibility.Collapsed;
                minimizeImage.Visibility = System.Windows.Visibility.Collapsed;
            }

            if (Application.Current.InstallState == InstallState.NotInstalled)
                Application.Current.InstallStateChanged += Current_InstallStateChanged;
            else
                InstallBtn.Visibility = System.Windows.Visibility.Collapsed;

            Alarms = new ObservableCollection<Classes.Alarm>();

            Alarms.Add(new Classes.Alarm("Wake up my ChickPea!") { Enabled = true, AlarmTime = new Classes.Time(7,30,00), Desc = "She is wonderful and deserves a loving wakeup call... :)" });
            Alarms.Add(new Classes.Alarm("Arise! Seize the Day! Carpe Diem!!") { Enabled = true });

            AlarmFrame.DataContext = Alarms;

            Storyboard.SetTarget(ColorAnim, (Classes.ColorResourceWrapper)Application.Current.Resources["Hinting"]);

            System.Windows.Threading.DispatcherTimer Checker = new System.Windows.Threading.DispatcherTimer();
            Checker.Interval = new TimeSpan(0, 0, 1);
            Checker.Tick += Checker_Tick;
            Checker.Start();
        }
コード例 #31
0
        void Init()
        {
            DummyScenarioRunner.Init(DummyMgr, AddLog);
            DummyMgr.LogFunc = AddLog;
            logMsgQueue      = new System.Collections.Concurrent.ConcurrentQueue <string>();

            dispatcherUITimer          = new System.Windows.Threading.DispatcherTimer();
            dispatcherUITimer.Tick    += new EventHandler(UpdateUI);
            dispatcherUITimer.Interval = new TimeSpan(0, 0, 0, 1);
            dispatcherUITimer.Start();

            dispatcherLogTimer          = new System.Windows.Threading.DispatcherTimer();
            dispatcherLogTimer.Tick    += new EventHandler(UpdateLogPrint);
            dispatcherLogTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            dispatcherLogTimer.Start();
        }
コード例 #32
0
        public MainWindow()
        {
            InitializeComponent();

            IsLocked = false;

            SystemEvents.SessionSwitch += new SessionSwitchEventHandler(SystemEvents_SessionSwitch);

            Config = new Configuration();
            var dispatcherTimer = new System.Windows.Threading.DispatcherTimer();

            dispatcherTimer.Tick    += DispatcherTimerOnTick;
            dispatcherTimer.Interval = Config.Interval;
            dispatcherTimer.Start();
            DoFetch();
        }
コード例 #33
0
        private void MainMenu_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            i += 1;
            System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
            timer.Interval  = new TimeSpan(0, 0, 0, 0, 300);
            timer.Tick     += (s, e1) => { timer.IsEnabled = false; i = 0; };
            timer.IsEnabled = true;

            if (i % 2 == 0)
            {
                timer.IsEnabled = false;
                i = 0;
                this.WindowState = this.WindowState == WindowState.Maximized ?
                                   WindowState.Normal : WindowState.Maximized;
            }
        }
コード例 #34
0
        public MoveMouse()
        {
            InitializeComponent();
            Loaded += MoveMouseData_loaded;


            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += (sender, e) =>
            {
                X_label.Content = System.Windows.Forms.Cursor.Position.X;
                Y_label.Content = System.Windows.Forms.Cursor.Position.Y;
            };

            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);
            dispatcherTimer.Start();
        }
コード例 #35
0
        private void WindowLoaded(object sender, System.Windows.RoutedEventArgs e)
        {
            Utility.SetUserTheme();

            Utility.MainWindow = this;

            CurrentUserLabel.Content = "کاربر کنونی : " + Utility.CurrentUser.Username;

            System.Windows.Threading.DispatcherTimer oDispatcherTimer = new System.Windows.Threading.DispatcherTimer();

            oDispatcherTimer.IsEnabled = true;

            oDispatcherTimer.Tick += ODispatcherTimer_Tick;

            // SetUserSettings();
        }
コード例 #36
0
ファイル: SolveTestViewModel.cs プロジェクト: shymmi/WPFTests
        public SolveTestViewModel()
        {
            _test              = UserContext.test;
            _questions         = new ObservableCollection <QuestionViewModel>();
            _submitTestCommand = new RelayCommand(param => SubmitTest());
            _endTestCommand    = new RelayCommand(param => EndTest());
            SetUpQuestions();
            _minutes    = _test.Minutes;
            _seconds    = 5;
            _isTimeLeft = true;

            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1);
            dispatcherTimer.Start();
        }
コード例 #37
0
ファイル: MainWindow.xaml.cs プロジェクト: jcyuyi/MQuiz
        public MainWindow()
        {
            InitializeComponent();
            sliderTimeInterval.ValueChanged += sliderTimeInterval_ValueChanged;
            cbLimitedTime.Checked           += cbLimitedTime_Checked;
            cbLimitedTime.Unchecked         += cbLimitedTime_Unchecked;

            //init dispatcherTimer
            dispatcherTimer          = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100); //call Tick every 0.1s

            statusMsg = "Ready. ";

            //btnStart_Click(null, null);
        }
コード例 #38
0
        public StopWatch()
        {
            InitializeComponent();

            // for job documentation
            sw_Date    = DateTime.Now.ToString("yyyyMMdd");
            sw_RelTime = "0";

            // Stop watch init and set Millisecands
            timer          = new System.Windows.Threading.DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(100);
            timer.Tick    += new EventHandler(showTime);

            btnStop.IsEnabled = false;
            Stopwatch_active  = true;   // StopWatch-Window open
        }
コード例 #39
0
        private void PhoneApplicationPageLoaded(object sender, RoutedEventArgs e)
        {
            _random = new Random();
            for (var i = 0; i < Circles; ++i)
            {
                var ellipse = new Ellipse();
                DrawCircle(ellipse);
                drawCanvas.Children.Add(ellipse);
            }

            _dt = new System.Windows.Threading.DispatcherTimer {
                Interval = new TimeSpan(0, 0, 0, 0, 250)
            };
            _dt.Tick += DtTick;
            _dt.Start();
        }
コード例 #40
0
 public void Start()
 {
     _lastDataObj = null;
     _lastText    = string.Empty;
     if (Common.AppSettings.Instance.EnableClipboardStreamURLIntegration)
     {
         System.Windows.Threading.DispatcherTimer _tProcess = new System.Windows.Threading.DispatcherTimer(System.Windows.Threading.DispatcherPriority.ApplicationIdle);
         _tProcess.Interval = TimeSpan.FromMilliseconds(1500);
         _tProcess.Tick    += _tProcess_Tick;
         _tProcess.Start();
     }
     else
     {
         Stop();
     }
 }
コード例 #41
0
 public void OnGameStart(object sender, BitmapSource firstImage)
 {
     if (_gameHasStarted)
     {
         return;
     }
     loadWindow.Close();
     _gameHasStarted = true;
     _gameTimer      = new System.Windows.Threading.DispatcherTimer()
     {
         Interval = TimeSpan.FromSeconds(1)
     };
     _gameTimer.Tick += UpdateTime;
     _gameTimer.Start();
     _kinectOutput.ImageReady -= OnGameStart;
 }
コード例 #42
0
        private void PhoneApplicationPageLoaded(object sender, RoutedEventArgs e)
        {
            _dt = new System.Windows.Threading.DispatcherTimer {
                Interval = new TimeSpan(0, 0, 0, 0, 250)
            };
            _dt.Tick += DtTick;
            _dt.Start();

            _originalRed   = (byte)_random.Next(255);
            _originalGreen = (byte)_random.Next(255);
            _originalBlue  = (byte)_random.Next(255);

            taskRectangle.Fill = new SolidColorBrush(Color.FromArgb(255, _originalRed, _originalGreen, _originalBlue));

            _hintsUsed = 0;
        }
コード例 #43
0
        public ScanContainerPage(YellowstonePathology.Business.User.SystemIdentity systemIdentity, string message)
        {
            this.m_SystemIdentity  = systemIdentity;
            this.m_Message         = message;
            this.m_BarcodeScanPort = YellowstonePathology.Business.BarcodeScanning.BarcodeScanPort.Instance;

            this.m_PageTimeOutTimer          = new System.Windows.Threading.DispatcherTimer();
            this.m_PageTimeOutTimer.Interval = new TimeSpan(0, 20, 0);
            this.m_PageTimeOutTimer.Tick    += new EventHandler(PageTimeOutTimer_Tick);

            InitializeComponent();

            DataContext = this;
            Loaded     += new RoutedEventHandler(ScanContainerPage_Loaded);
            Unloaded   += new RoutedEventHandler(ScanContainerPage_Unloaded);
        }
コード例 #44
0
        public MainWindow()
        {
            InitializeComponent();

#if DEBUG
            if (Debugger.IsAttached)
            {
                UpdateManager.InitUpdateManagerForTests();
            }
#endif

            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += OnTick;
            dispatcherTimer.Interval = TimeSpan.FromSeconds(1);
            dispatcherTimer.Start();
        }
コード例 #45
0
        public DocPreviewPackage()
        {
            // Inside this method you can place any initialization code that does not require
            // any Visual Studio service because at this point the package object is created but
            // not sited yet inside Visual Studio environment. The place to do all the other
            // initialization is the Initialize method.
            //AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            //var textEditorEvents = Global.GetDTE2().Events.TextEditorEvents;
            //textEditorEvents.LineChanged += TextEditorEvents_LineChanged;

            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += DispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 2);
            dispatcherTimer.Start();
        }
コード例 #46
0
        public MainWindow()
        {
            #region first main

            InitializeComponent();

            dispatcherTimer          = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);


            fileChanged = true;
            LoadModel();

            #endregion
        }
コード例 #47
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ThrottleTimer"/> class.
 /// </summary>
 /// <param name="milliseconds">Milliseconds to throttle.</param>
 /// <param name="handler">The delegate to invoke.</param>
 internal ThrottleTimer(int milliseconds, Action handler)
 {
     this.Action   = handler;
     throttleTimer = new System.Windows.Threading.DispatcherTimer()
     {
         Interval = TimeSpan.FromMilliseconds(milliseconds)
     };
     throttleTimer.Tick += (s, e) =>
     {
         if (this.Action != null)
         {
             this.Action.Invoke();
         }
         throttleTimer.Stop();
     };
 }
コード例 #48
0
        public ManagerView()
        {
            InitializeComponent();

            orderViewModel = new OrderViewModel();
            DataContext    = orderViewModel;

            LoadOrders();

            // Обновление окна по таймеру
            var dispatcherTimer = new System.Windows.Threading.DispatcherTimer();

            dispatcherTimer.Tick    += new EventHandler(WindowActivated);
            dispatcherTimer.Interval = new TimeSpan(0, 5, 0);
            dispatcherTimer.Start();
        }
コード例 #49
0
        public InstallAnimationUC()
        {
            InitializeComponent();
            frameTimer          = new System.Windows.Threading.DispatcherTimer();
            frameTimer.Tick    += OnFrame;
            frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 60.0);
            frameTimer.Start();

            this.spawnPoint = new Point3D(0.0, 0.0, 0.0);

            pm = new ParticleSystemManager();

            this.WorldModels.Children.Add(pm.CreateParticleSystem(500, (Color)ColorConverter.ConvertFromString("#FF9AF7FE")));

            rand = new Random(this.GetHashCode());
        }
コード例 #50
0
ファイル: AutoNavigation.cs プロジェクト: AsserSwelam/Test
        public void Stop()
        {
            if (_accelerometer != null)
            {
                _accelerometer.Stop();
                _accelerometer = null;
            }

            if (_myDispatcherTimer != null)
            {
                _myDispatcherTimer.Stop();
                _myDispatcherTimer = null;
            }

            FirePanToEvent("none");
        }
コード例 #51
0
        // Add code here

        #endregion

        public MainWindow()
        {
            InitializeComponent();

            #region Random Number

            // Add code here

            #endregion

            // Set game loop timer
            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += dispatcherTimer_Tick;
            dispatcherTimer.Interval = new TimeSpan(10000); // 10000 ticks = 1 milisecond
            dispatcherTimer.Start();
        }
コード例 #52
0
        public PrincipalWindow(UsuarioType usuario, Negocio negocio)
        {
            InitializeComponent();
            this.usuario   = usuario;
            lblNombre.Text = usuario.Nombre;
            lblTipo.Text   = usuario.Rol == 1001 ? "Común" : "Administrador";

            comprobarPermisos();

            this.negocio = negocio;

            System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
            timer.Tick    += new EventHandler(timer_Tick);
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Start();
        }
コード例 #53
0
        private void tickMethod(object sender, EventArgs e)
        {
            bool isMainThread = Program.IsMainThread();

            System.Windows.Forms.Timer timer = sender as System.Windows.Forms.Timer;
            if (timer != null)
            {
                timer.Stop();
            }
            else
            {
                System.Windows.Threading.DispatcherTimer dtimer = sender as System.Windows.Threading.DispatcherTimer;
                dtimer.Stop();
            }
            throw new NotImplementedException();
        }
コード例 #54
0
        private void InitDdBmsInfoWnd()
        {
            ListBmsInfo.Clear();

            string strConfigFile = XmlHelper.m_strDdProtocolFile;

            XmlHelper.LoadXmlConfig(strConfigFile, "bms_info/register_node_info", ListBmsInfo);
            XmlHelper.LoadCellVoltageConfig(strConfigFile, ListCellVoltage, "A210");
            XmlHelper.LoadXmlConfig(strConfigFile, "device_info/register_node_info", ListDeviceInfo);
            XmlHelper.LoadDdBatStatConfig(strConfigFile, "battery_status_info/register_byte/bit_status_info", listBmsStatusInfo, "内部状态");
            XmlHelper.LoadDdBatStatConfig(strConfigFile, "battery_status_info/register_byte/bit_status_info", listBmsErrInfo, "Errors");
            XmlHelper.LoadDdBatStatConfig(strConfigFile, "battery_status_info/register_byte/bit_status_info", listBmsWarnInfo, "Warring");
            XmlHelper.LoadXmlConfig(strConfigFile, "feedback_info/register_node_info", ListFeedbackInfo);
            timer       = new System.Windows.Threading.DispatcherTimer();
            timer.Tick += new EventHandler(OnTimer);
        }
コード例 #55
0
        /// <summary>
        /// Initialization of variables and sets
        /// </summary>
        private void InitializeObjects()
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

            systemState = new SystemState();
            solver      = new ODESolver(systemState.SolverParameters);
            solver.SetupStrategy(new InterferedSystemODESolverFunctionStrategy());

            SceneControl.ResetSimulation(systemState);
            SceneControl.UpdateState(systemState);
            SceneControl.UpdateCamera(systemState);

            dispatcherTimer          = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += DispatcherTimerTick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 16);
        }
コード例 #56
0
        public FlowNode(IContainer container, FlowNodeType at)
            : this()
        {
            _container = container;
            editType   = PageEditType.Add;

            this.HisRunModel = at;

            System.Windows.Browser.HtmlPage.Document.AttachEvent("oncontextmenu", OnContextMenu);
            this.Name = FK_Flow;

            _doubleClickTimer          = new System.Windows.Threading.DispatcherTimer();
            _doubleClickTimer.Interval = new TimeSpan(0, 0, 0, 0, SystemConst.DoubleClickTime);
            _doubleClickTimer.Tick    += new EventHandler(DoubleClick_Timer);
            sbDisplay.Begin();
        }
コード例 #57
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     Keyboard.Focus(txtPW);
     lstU = UserDAO.getAllUsers();
     if (j == 5) {
         txtPW.IsEnabled = false;
         btnLogin.IsEnabled = false;
         txtNotice.Text = "CONNEXION BLOQUEE";
         txtNotice.Foreground = Brushes.Red;
     }
     lblDate.Content = DateTime.Now.ToShortDateString();
     System.Windows.Threading.DispatcherTimer timer = new System.Windows.Threading.DispatcherTimer();
     timer.Interval = new TimeSpan(0, 0, 1);
     timer.Tick += timer_Tick;
     timer.Start();
 }
コード例 #58
0
        public MainWindow()
        {
            InitializeComponent();

            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += new EventHandler(TickEvent);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 5);
            dispatcherTimer.Start();
            RenderBuffer.Instance.clearBuffer();


            meshes = Common.LoadJSONFileAsync("monkey.babylon");

            camera.Position = new Vector3d(0, 0, 10.0f);
            camera.Target   = Vector3d.Zero;
        }
コード例 #59
0
        public mainwindow()
        {
            InitializeComponent();
            // var point = Mouse.GetPosition();
            //Point pointToWindow = Mouse.GetPosition(this);
            // MouseX = point.X;
            //MouseY = point.Y;

            System.Windows.Threading.DispatcherTimer dispatcherTimer = new

                                                                       System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += dispatcherTimer_Tick; //event!!
            dispatcherTimer.Interval = new TimeSpan(20, 0, 0);
            dispatcherTimer.Interval = TimeSpan.FromMilliseconds(1);
            dispatcherTimer.Start();
        }
コード例 #60
0
        public MainWindow()
        {
            InitializeComponent();

            player = new EasyCSCorePlayer();

            clipboardMonitor = new ClipboardMonitor();

            //setup 1s callback
            System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick    += new EventHandler(DispatcherTimer_Tick1Second);
            dispatcherTimer.Interval = new TimeSpan(days: 0, hours: 0, minutes: 0, seconds: 0, milliseconds: 500);
            dispatcherTimer.Start();

            LoadConfigFromFileOrDefault(TOML_PATH);
        }