Ejemplo n.º 1
1
        public PlatformWpf()
            : base(null, true)
        {
            var app = new Application ();
            var slCanvas = new Canvas ();
            var win = new Window
            {
                Title = Title,
                Width = Width,
                Height = Height,
                Content = slCanvas
            };

            var cirrusCanvas = new CirrusCanvas(slCanvas, Width, Height);
            MainCanvas = cirrusCanvas;

            win.Show ();

            EntryPoint.Invoke (null, null);

            var timer = new DispatcherTimer ();
            timer.Tick += runDelegate;
            timer.Interval = TimeSpan.FromMilliseconds (1);

            timer.Start ();
            app.Run ();
        }
Ejemplo n.º 2
1
        public ViewModel()
        {
            mgt = new ManagementClass("Win32_Processor");
            procs = mgt.GetInstances();

            CPU = new ObservableCollection<Model>();
            timer = new DispatcherTimer();
            random = new Random();
            time = DateTime.Now;
            cpuCounter = new PerformanceCounter();
            cpuCounter.CategoryName = "Processor";
            cpuCounter.CounterName = "% Processor Time";
            cpuCounter.InstanceName = "_Total";
            ramCounter = new PerformanceCounter("Memory", "Available MBytes");
            ProcessorID = GetProcessorID();
            processes = Process.GetProcesses();
            Processes = processes.Length;
            MaximumSpeed = GetMaxClockSpeed();
            LogicalProcessors = GetNumberOfLogicalProcessors();
            Cores = GetNumberOfCores();
            L2Cache = GetL2CacheSize();
            L3Cache = GetL3CacheSize();
            foreach (ManagementObject item in procs)
                L1Cache = ((UInt32)item.Properties["L2CacheSize"].Value / 2).ToString() + " KB";

            timer.Interval = TimeSpan.FromMilliseconds(1000);
            timer.Tick += timer_Tick;
            timer.Start();
            for (int i = 0; i < 60; i++)
            {
                CPU.Add(new Model(time, 0,0));
                time = time.AddSeconds(1);
            }
        }
Ejemplo n.º 3
1
 public XNAAsyncDispatcher(TimeSpan dispatchInterval)
 {
     FrameworkDispatcher.Update();
     this._frameworkDispatcherTimer = new DispatcherTimer();
     this._frameworkDispatcherTimer.Tick += new EventHandler(frameworkDispatcherTimer_Tick);
     this._frameworkDispatcherTimer.Interval = dispatchInterval;
 }
Ejemplo n.º 4
0
        public WorkspaceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit<IWorkspaceDataUnit>();
            _crmDataUnit = dataUnitLocator.ResolveDataUnit<ICrmDataUnit>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            var time = (int?)ApplicationSettings.Read("LogoutTime");
            _logoutTime = (time.HasValue && time.Value > 0) ? time.Value : 30; // 30 minutes - default logout time

            EventManager.RegisterClassHandler(typeof(Window), UIElement.KeyDownEvent, new RoutedEventHandler(Window_KeyDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseDownEvent, new RoutedEventHandler(Window_MouseDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseMoveEvent, new RoutedEventHandler(Window_MouseMove));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseWheelEvent, new RoutedEventHandler(Window_MouseWheel));

            _timer = new Timer(LogoutByInactivity, null, 1000 * 60 * _logoutTime, Timeout.Infinite);

            _updateTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
            _updateTimer.Tick += UpdateTimer_Tick;

            _updateTimer.Start();

            _updateTimerEvents = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
            _updateTimerEvents.Tick += _updateTimerEvents_Tick;

            _updateTimerEvents.Start();
        }
Ejemplo n.º 5
0
        public DocumentViewModel(
            IDialogService dialogService,
            IWindowManager windowManager,
            ISiteContextGenerator siteContextGenerator,
            Func<string, IMetaWeblogService> getMetaWeblog,
            ISettingsProvider settingsProvider,
            IDocumentParser documentParser)
        {
            this.dialogService = dialogService;
            this.windowManager = windowManager;
            this.siteContextGenerator = siteContextGenerator;
            this.getMetaWeblog = getMetaWeblog;
            this.settingsProvider = settingsProvider;
            this.documentParser = documentParser;

            FontSize = GetFontSize();

            title = "New Document";
            Original = "";
            Document = new TextDocument();
            Post = new Post();
            timer = new DispatcherTimer();
            timer.Tick += TimerTick;
            timer.Interval = delay;
        }
 void timer_phidao_demo()
 {
     Time_phidao_demo          = new System.Windows.Threading.DispatcherTimer();
     Time_phidao_demo.Tick    += Time_phidao_demo_Tick;
     Time_phidao_demo.Interval = new TimeSpan(0, 0, 1);
     //Time_phidao_demo.Start();
 }
Ejemplo n.º 7
0
 private void acceptButton_Click(object sender, RoutedEventArgs e)
 {
     if (!running)
     {
         if (LogYN.IsChecked == true)
         {
             writeToFile = true;
         }
         else
         {
             writeToFile = false;
         }
         osoite             = PageURL.Text;
         lineLength         = 53 + osoite.Length;
         contentToBeChecked = FetchContent.GetPageHash(osoite);
         int timeInt = Convert.ToInt32(AikaVali.Text);
         this.ValueMultiplier();
         _timer          = new System.Windows.Threading.DispatcherTimer();
         _timer.Interval = TimeSpan.FromMilliseconds(multiplier * timeInt);
         _timer.Tick    += _timerTick;
         _timer.Start();
         running = true;
         AcceptButton.Content = "Stop";
         LogYN.IsEnabled      = false;
     }
     else
     {
         StopTimer();
     }
     this.nIcon.Icon    = new Icon("hippo.ico");
     this.nIcon.Visible = true;
 }
Ejemplo n.º 8
0
        private void Start()
        {
            //this.Hide();

            _timer = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromMilliseconds(10);
            _timer.Tick += _timer_Tick;
            _timer.Start();

            _events = new Events();
            _storage = new Storage(_events);
            _trayIcon = new TrayIcon(this);

            _events.OnInvokeDrop += _storage.Drop;
            _events.OnInvokeExpire += _storage.Expire;
            _events.OnInvokePeek += _storage.Peek;
            _events.OnInvokePoke += _storage.Poke;
            _events.OnInvokePinch += _storage.Pinch;
            _events.OnInvokePop += _storage.Pop;
            _events.OnInvokePush += _storage.Push;
            _events.OnInvokeShunt += _storage.Shunt;
            _events.OnInvokeReverse += _storage.Reverse;
            _events.OnInvokeRotateLeft += _storage.RotateLeft;
            _events.OnInvokeRotateRight += _storage.RotateRight;
            _events.OnInvokeSwap += _storage.Swap;
            _events.OnInvokeWipe += _storage.Wipe;
        }
Ejemplo n.º 9
0
 public PictureController()
 {
     slideShowTimer = new DispatcherTimer();
     Duration = new Duration(TimeSpan.FromSeconds(5));
     slideShowTimer.Interval = Duration.TimeSpan;
     slideShowTimer.Tick += new EventHandler(slideShowTimer_Tick);
 }
Ejemplo n.º 10
0
        //========================================================================================
        // Constructors
        //========================================================================================
        /// <summary>
        /// This constructor must be called by implementors or the fading functionality
        /// will not work.
        /// </summary>
        public FadingWindow()
            : base()
        {
            this.Opacity = 0.0;

            // by setting it hidden, this hides the window from the Alt-Tab program switcher
            this.Visibility = Visibility.Hidden;

            DoubleAnimation animation = new DoubleAnimation(
                HiddenOpacity, VisibleOpacity, new Duration(TimeSpan.FromMilliseconds(300)));
            animation.BeginTime = TimeSpan.FromMilliseconds(100);
            animation.AutoReverse = false;

            this.fadeInStoryboard = new Storyboard();
            this.fadeInStoryboard.Children.Add(animation);
            this.fadeInStoryboard.Completed += new EventHandler(ShowCompleted);

            animation = new DoubleAnimation(
                VisibleOpacity, HiddenOpacity, new Duration(TimeSpan.FromMilliseconds(500)));
            animation.BeginTime = TimeSpan.FromMilliseconds(100);
            animation.AutoReverse = false;

            this.fadeOutStoryboard = new Storyboard();
            this.fadeOutStoryboard.Children.Add(animation);
            this.fadeOutStoryboard.Completed += new EventHandler(HideCompleted);

            this.timer = new DispatcherTimer();
            this.timer.Tick += new EventHandler(InitiateFadeOut);
            this.timer.Interval = DefaultFadeOutDelay;
        }
Ejemplo n.º 11
0
        public MainWindow()
        {
            InitializeComponent();

            VolumeSlider.Value = VolumeSlider.Maximum / 2;
            MediaView.Volume   = (VolumeSlider.Value / 100);

            PlayOrPause.Background   = new ImageBrush(PlayPic.Source);
            SkipBack.Background      = new ImageBrush(BackPic.Source);
            SkipFoward.Background    = new ImageBrush(FowardPic.Source);
            FullScreenBtn.Background = new ImageBrush(FullscreenPic.Source);
            muteBtn.Background       = new ImageBrush(MutePic.Source);
            PrevPic.Background       = new ImageBrush(LeftPic.Source);
            NextPic.Background       = new ImageBrush(RightPic.Source);
            RotateBtn.Background     = new ImageBrush(RotatePic.Source);


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

            restingTimer          = new System.Windows.Threading.DispatcherTimer();
            restingTimer.Tick    += new EventHandler(restingTimer_Tick);
            restingTimer.Interval = new TimeSpan(0, 0, 1);

            if (Application.Current.Properties["ArbitraryArgName"] != null)
            {
                MediaView.Source = new Uri(Application.Current.Properties["ArbitraryArgName"].ToString());
                MediaView.Play();
                PlayOrPause.Background = new ImageBrush(PausePic.Source);
                PlayOrPause.ToolTip    = "Pause";
            }
        }
Ejemplo n.º 12
0
        private void ComboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string spotname = ComboBox1.SelectedItem.ToString();
            //string SpotNum = "";

            var retRows = from spot in spotdata.景点介绍
                          where spot.称 == spotname
                          select new { openTime = spot.开放时间, price = spot.门票, address = spot.地址, introduction = spot.简介, num = spot.序号 };

            foreach (var item in retRows)
            {
                Price.Text        = item.price;
                OpenTime.Text     = item.openTime;
                Address.Text      = item.address;
                Introduction.Text = item.introduction;
                SpotNum           = item.num;
            }

            introduction  = Introduction.Text;
            Image1.Source = new BitmapImage(new Uri(@System.AppDomain.CurrentDomain.BaseDirectory + "image/" + SpotNum + "_3.jpg"));

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

            dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 4);
            dispatcherTimer.Start();
        }
Ejemplo n.º 13
0
        public PatientDetail3DManager(object fe)
        {
            baseFrameworkElement = fe as FrameworkElement;

            if (baseFrameworkElement == null)
            {
                return;
            }

            detailFront2D = (FrameworkElement)baseFrameworkElement.FindName("DetailFront2D");
            detailBack2D  = (FrameworkElement)baseFrameworkElement.FindName("DetailBack2D");
            detailBack2DWrapperTranslate  = (TranslateTransform)baseFrameworkElement.FindName("DetailBack2DWrapperTranslate");
            detailFront2DWrapperTranslate = (TranslateTransform)baseFrameworkElement.FindName("DetailFront2DWrapperTranslate");
            masterView2DWrapperTranslate  = (TranslateTransform)baseFrameworkElement.FindName("MasterView2DWrapperTranslate");
            detailBack2DWrapper           = (FrameworkElement)baseFrameworkElement.FindName("DetailBack2DWrapper");
            detailMain = (FrameworkElement)baseFrameworkElement.FindName("Detail");
            patientDetailRotater3DTransition = (IdentityMine.Avalon.Controls.Rotater3DTransition)baseFrameworkElement.FindName("PatientDetailRotater3DTransition");
            patientDetailRotater3DTransition.RotateCompleted += new IdentityMine.Avalon.Controls.Rotater3DTransition.SelectedEventHandler(patientDetailRotater3DTransition_RotateCompleted);

            masterView2D = (FrameworkElement)baseFrameworkElement.FindName("MasterView2D");
            patientMasterRotater3DTransition = (IdentityMine.Avalon.Controls.Rotater3DTransition)baseFrameworkElement.FindName("PatientMasterRotater3DTransition");
            patientMasterRotater3DTransition.RotateCompleted += new IdentityMine.Avalon.Controls.Rotater3DTransition.SelectedEventHandler(patientMasterRotater3DTransition_RotateCompleted);

            detailMain.LayoutUpdated += new EventHandler(detailMain_LayoutUpdated); // detail page changes layout with in the grid and 2D and 3D elements need to be updated

            detailBack2DWrapperTranslate.X = 10000;                                 // move back offscreen

            //setup a timer for updating the MasterView3D area. Due to bugs in VisualBrush on Beta2. This technique is being used
            //brushMaster = new VisualBrush(visual);
            uiMasterView3DTimer          = new System.Windows.Threading.DispatcherTimer();
            uiMasterView3DTimer.Interval = TimeSpan.FromMilliseconds(timerMasterView3DFrameRate);
            uiMasterView3DTimer.Tick    += new EventHandler(uiTimerMasterView3D_Tick);
            uiMasterView3DTimer.Stop();
        }
Ejemplo n.º 14
0
        void Countdown(int count, TimeSpan interval, Action <int> ts, bool start)
        {
            var dt = new System.Windows.Threading.DispatcherTimer();

            dt.Interval = interval;
            dt.Tick    += (_, a) =>
            {
                if (count-- == 0)
                {
                    dt.Stop();
                }
                else
                {
                    ts(count);
                }
            };
            ts(count);

            if (start == true)
            {
                dt.Start();
            }
            else if (start == false)
            {
                dt.Stop();
            }
        }
Ejemplo n.º 15
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            productLines = Properties.Settings.Default.ProductLines.Split(',').ToList();

            initPage();

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



            timer = new System.Timers.Timer();
            ((System.ComponentModel.ISupportInitialize)(this.timer)).BeginInit();
            timer.Enabled  = false;
            timer.Interval = BaseConfig.KanbanTimerInterval;
            timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);

            ((System.ComponentModel.ISupportInitialize)(this.timer)).EndInit();
            timer.Start();


            LampUtil.TurnNormal();

            if (Properties.Settings.Default.OnTest)
            {
                test_btn_Checked(null, null);
            }
            else
            {
                test_btn_Unchecked(null, null);
            }
        }
Ejemplo n.º 16
0
        public MainViewModel()
        {
            synth = new SpeechSynthesizer();
            synth.SelectVoiceByHints(VoiceGender.Male);
            synth.Rate = 4;

            cpuPage  = new Pages.CPUPage();
            mainPage = new Pages.MainPage();
            ramPage  = new Pages.RAMPage();
            gpuPage  = new Pages.GPUPage();

            cpuPage.CpuInCriticalTemperature += CpuPage_CpuInCriticalTemperature;
            ramPage.RamLowMemory             += RamPage_RamLowMemory;
            gpuPage.GpuCriticalTemperature   += GpuPage_GpuCriticalTemperature;
            current      = mainPage;
            mainSelected = "LightGray";

            timer       = GetTimer(1);
            timer.Tick += Timer_Tick;
            timer.Start();

            timerForLog       = GetTimer(10);
            timerForLog.Tick += TimerForLog_Tick;
            timerForLog.Start();
        }
Ejemplo n.º 17
0
        private void EditorOnTextChanged(object sender, EventArgs eventArgs)
        {
            //todo : ew.
            _scene.FragmentShaderSource = Editor.Text;

            if (timer == null)
            {
                timer    = new DispatcherTimer();
                Closing += (q, args) =>
                {
                    timer?.Stop();
                };
                timer.Tick += (s, args) =>
                {
                    Dispatcher.Invoke(() => { _scene.Initialise(_gl); });
                    timer.Stop();
                };
            }
            else
            {
                timer.Stop();
            }
            timer.Interval = TimeSpan.FromMilliseconds(500);
            timer.Start();
        }
Ejemplo n.º 18
0
 void StartTimer()
 {
     timer = new DispatcherTimer();
     timer.Interval = TimeSpan.FromSeconds(5);
     timer.Tick += new EventHandler(timer_Elapsed);
     timer.Start();
 }
Ejemplo n.º 19
0
 public StartPage()
 {
     InitializeComponent();
     dispatcherTimer = new DispatcherTimer();
     dispatcherTimer.Interval = TimeSpan.FromMilliseconds(1);
     dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
 }
Ejemplo n.º 20
0
 public Scheduler(Dispatcher dispatcher, TimeSpan delay)
 {
     if (dispatcher != null)
     {
         _time = new DispatcherTimer(delay, DispatcherPriority.Background, _time_Tick, dispatcher);
     }
 }
Ejemplo n.º 21
0
            public Watek(string _server, string _port, string _database, string _login, string _pass, string _nazwa, string _sqlQuestion, string _sqlUpdate, string _kolumnaIf, string _kolumnaThen,
                         string _wyrazenieIf, string _wartoscThen, NpgsqlConnection _connection, NpgsqlDataAdapter _dataAdapter, Int64 _interwal)
            {
                server   = _server;
                port     = _port;
                database = _database;
                login    = _login;
                pass     = _pass;

                nazwaWatku  = _nazwa;
                sqlQuestion = _sqlQuestion;
                sqlUpdate   = _sqlUpdate;
                cacheTable  = new DataTable();


                string[] rozbity = sqlQuestion.Split(' ');
                tabela = rozbity[rozbity.Count() - 1].Replace("\"", "");

                kolumnaIf   = _kolumnaIf;
                kolumnaThen = _kolumnaThen;
                wyrazenieIf = _wyrazenieIf;
                wartoscThen = _wartoscThen;
                connection  = _connection;
                dataAdapter = _dataAdapter;
                interwal    = _interwal;
                dziala      = true;


                //this.Dispatcher.Invoke(() =>
                //{
                TimerWatkow          = new System.Windows.Threading.DispatcherTimer();
                TimerWatkow.Tick    += new EventHandler(dispatcherTimer_Tick);
                TimerWatkow.Interval = new TimeSpan(interwal);
                //});
            }
Ejemplo n.º 22
0
        public ImportResultsPage( )
        {
            InitializeComponent();

            timmer       = new System.Windows.Threading.DispatcherTimer( );
            timmer.Tick += timmer_Tick;
        }
        public DlGroupMigrationMain()
        {
            InitializeComponent();

            _timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(1)};
            _timer.Tick += _timer_Tick;
        }
Ejemplo n.º 24
0
        public FlyThru()
        {
            // Start point/range
            float xs = -0.5f;
            float ys = 0.0f;
            float rs = 3.0f;

            // End point/range
            float xe = -.2649f;
            float ye = -.8506f;
            float re = 0.00048828125f;

            // Interpolate all the points in between
            float l = 1.0f / (RenderPoints.Length - 1);
            for (int i = 0; i < RenderPoints.Length; i++)
            {
                float scale = (float)Math.Pow(l * i, 0.03125);
                RenderPoints[i] = Tuple.Create(xs + (xe - xs) * scale, ys + (ye - ys) * scale, rs + (re - rs) * scale);
            }

            // Initialize the visible elements, just for fun
            XC = xs;
            YC = ys;
            Scale = rs;
            IsRyuJIT = MainWindow.IsRyuJITLoaded() ? Visibility.Visible : Visibility.Collapsed;

            // WPF initialization
            InitializeComponent();

            // Create the timer to update the screen
            renderClock = new DispatcherTimer() { Interval = new TimeSpan(0, 0, 0, 0, 16) };// 62.5 FPS should be sufficient
            renderClock.Tick += renderClock_Tick;
        }
Ejemplo n.º 25
0
        public MainWindow()
        {
            this.Topmost = true;
            InitializeComponent();

            real_Tag_Entitys = new Real_Tag_Entitys();
            data             = new List <users>();
            LSS = new Log_Sub_System.Log_Sub_System(real_Tag_Entitys);
            foreach (users user in real_Tag_Entitys.users)
            {
                data.Add(user);
            }
            users_grid.ItemsSource = data;
            Dictionary <string, int> lRole = new Dictionary <string, int>();

            lRole.Add("Оператор", 0);
            lRole.Add("Технолог", 1);
            lRole.Add("Инженер", 2);
            Role.ItemsSource      = lRole;
            Heat_Assist.IsChecked = Tags.get_Heat_Assist();



            plc     = new Plc(CpuType.S71500, "192.168.1.122", 0, 1);
            on      = new SolidColorBrush(Color.FromRgb(0, 255, 0));
            off     = new SolidColorBrush(Color.FromRgb(255, 0, 0));
            neutral = new SolidColorBrush(Color.FromRgb(221, 221, 221));



            dispatcherTimer = new DispatcherTimer();


            rt = new RotateTransform();
        }
 void timer_xoay()
 {
     Time_xoay          = new System.Windows.Threading.DispatcherTimer();
     Time_xoay.Tick    += Time_xoay_Tick;
     Time_xoay.Interval = new TimeSpan(0, 0, 1 / 2);
     //Time_xoay.Start();
 }
Ejemplo n.º 27
0
        public AdvancedSearch()
        {
            stockIcons = new StockIcons();

            documentsStockIcon = stockIcons.DocumentAssociated;
            videosStockIcon = stockIcons.VideoFiles;
            musicStockIcon = stockIcons.AudioFiles;
            picturesStockIcon = stockIcons.ImageFiles;

            InitializeComponent();

            // Set our default
            DocumentsRadioButton.IsChecked = true;

            // 
            prop1prop2OperationComboBox.SelectedIndex = 0;

            // Because the search can take some time, using a background thread.
            // This timer will check if that thread is still alive and accordingly update
            // the cursor
            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.IsEnabled = true;
            timer.Tick += new EventHandler(timer_Tick);
        }
Ejemplo n.º 28
0
 private void ctrlImageflick()
 {
     System.Windows.Threading.DispatcherTimer dTimer = new System.Windows.Threading.DispatcherTimer();
     dTimer.Tick    += new EventHandler(dTimer_Tick);
     dTimer.Interval = new TimeSpan(0, 0, 0, 0, 150);
     dTimer.Start();
 }
Ejemplo n.º 29
0
        /// <summary>
        /// Método encargado de iniciar actualizaciones para el despliegue de
        /// el listado de dispositivos cercanos y niveles de contaminación.
        /// </summary>
        public void actualizar()
        {
            try
            {
                if (HayConexiónInternet())
                {
                    WS = new WSSemanticSearchSoapClient();

                    DispatcherTimer dispatcherTimer;
                    dispatcherTimer          = new System.Windows.Threading.DispatcherTimer();
                    dispatcherTimer.Tick    += new EventHandler(actualizaciones_Tick);
                    dispatcherTimer.Interval = new TimeSpan(0, 0, tSegundosConsultas);        //Con t = 1 seg esta funcionando perfecto
                    dispatcherTimer.Start();


                    DispatcherTimer timerConexionInternet;
                    timerConexionInternet          = new System.Windows.Threading.DispatcherTimer();
                    timerConexionInternet.Tick    += new EventHandler(ConexionInternet_TimerTick); //Se establece a quien se va a estar invocando
                    timerConexionInternet.Interval = new TimeSpan(0, 0, tSegundosHayInternet);     //Se establece intervalos de tiempo (t = 4)
                    timerConexionInternet.Start();
                }
            }
            finally
            {
            }
        }
        private static void GetSmoll(NotificationControl notificationControl, int timeSpanSec = 5)
        {
            DoubleAnimation getSmoll = new DoubleAnimation();
            TimeSpan        timeSpan = TimeSpan.FromSeconds(timeSpanSec);

            getSmoll.From     = notificationControl.Width;
            getSmoll.To       = 0;
            getSmoll.Duration = new Duration(TimeSpan.FromMilliseconds(300));
            Storyboard.SetTargetName(getSmoll, notificationControl.Name);
            Storyboard.SetTargetProperty(getSmoll, new PropertyPath(Window.WidthProperty));
            Storyboard sb1 = new Storyboard();

            sb1.Children.Add(getSmoll);
            DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();

            dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = timeSpan;
            dispatcherTimer.Start();

            void dispatcherTimer_Tick(object sender, EventArgs e)
            {
                dispatcherTimer.IsEnabled = false;
                sb1.Begin(notificationControl);
            }
        }
Ejemplo n.º 31
0
        public MainWindow()
        {
            InitializeComponent();

            Stream iconResource = Assembly.GetExecutingAssembly().GetManifestResourceStream("DateTimeConverter.Images.Clock.ico");
            this.Icon = BitmapFrame.Create(iconResource);

            this.menuItemExit.Click += MenuItemExit_Click;
            this.menuItemClear.Click += MenuItemClear_Click;
            this.menuItemGithub.Click += MenuItemGithub_Click;
            this.menuItemAbout.Click += MenuItemAbout_Click;

            this.dateTimeOnRemoteComputer.Value = DateTime.Now;
            this.dateTimeOnRemoteComputer.Format = Xceed.Wpf.Toolkit.DateTimeFormat.Custom;
            this.dateTimeOnRemoteComputer.FormatString = this.dateTimeFormatStr;
            this.dateTimeOnRemoteComputer.ValueChanged += DateTimeOnRemoteComputer_ValueChanged;

            this.dateTimeOfEvent.Value = DateTime.Now;
            this.dateTimeOfEvent.Format = Xceed.Wpf.Toolkit.DateTimeFormat.Custom;
            this.dateTimeOfEvent.FormatString = this.dateTimeFormatStr;
            this.dateTimeOfEvent.ValueChanged += DateTimeOfEvent_ValueChanged;

            this.UpdateCurrentTime();
            dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(DispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
            dispatcherTimer.Start();
        }
Ejemplo n.º 32
0
        //what shall be done when "Start/Stop Automatic Turns" button is pressed
        private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (worldBoards[0] == null)
            {
                NowaGra_Click(sender, e);
            }
            while (worldBoards[0] == null)
            {
                await Task.Delay(25);
            }


            if (automatic == true)
            {
                automatic = false;
                automaticButton.Background = buttonDefault;
                dispatcherTimer.Stop();
            }
            else
            {
                automatic = true;
                automaticButton.Background = new SolidColorBrush(Colors.Red);
            }

            if (automatic == true)
            {
                dispatcherTimer          = new System.Windows.Threading.DispatcherTimer();
                dispatcherTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
                dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
                dispatcherTimer.Start();
            }
        }
Ejemplo n.º 33
0
        public OverviewViewModel()
        {
            today = DateTime.Today;

            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMinutes(1);
            timer.Tick += (sender, args) =>
                {
                    if (DateTime.Today <= today) return;

                    today = DateTime.Today;
                    UpdateHeaders();
                };
            timer.Start();

            ItemSelectionChangedCommand = new ActionCommand(ItemSelectionChanged);
            LinkCommand = new ActionCommand(ShowLink);
            LoadedCommand = new ActionCommand(Loaded);
            TodayCommand = new ActionCommand(_ => Show(MenuRepository.GetTodaysMenu()));
            ExpandAllCommand = new ActionCommand(_ => SetAllExpansion(true));
            CollapseAllCommand = new ActionCommand(_ =>
                {
                    SetAllSelection(false);
                    SetAllExpansion(false);
                });
        }
Ejemplo n.º 34
0
        public MainWindow()
        {
            InitializeComponent();
            this.Title    = "Carrot Quest - " + player.Name;
            player.Attack = new NormalAttack();
            fillNpc();
            this.KeyDown += new KeyEventHandler(MainWindow_KeyDown);
            //timer
            DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer();

            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            TimeSpan interval = TimeSpan.FromMilliseconds(10);

            dispatcherTimer.Interval = interval;
            dispatcherTimer.Start();

            /*game.currentMapNumber = 7;
             * game.currentMaxMapNumber = 8;
             * game.storyPosition = 12;
             * player.Lvl = 9;
             * player.XP = 80;
             * game.hasHoney = true;
             * game.hasBlueberry = true;
             * game.hasApple = true;*/
            //timer
        }
 public PointSymbolConfigControl()
 {
     DefaultStyleKey = typeof(PointSymbolConfigControl);
     
     _opacityChangedTimer = new DispatcherTimer() { Interval = new TimeSpan(0, 0, 0, 0, 500) };
     _opacityChangedTimer.Tick += OpacityChangedTimer_Tick;
 }
Ejemplo n.º 36
0
        public UdpDiscovery()
        {
            try
            {
                _globalUdp.UdpClient = new UdpClient();
                _globalUdp.Ep        = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("255.255.255.255"), 30303);
                var bindEp      = new System.Net.IPEndPoint(System.Net.IPAddress.Any, 30303);
                var discoverMsg = Encoding.ASCII.GetBytes("Discovery: Gdje ste?");

                _globalUdp.UdpClient.Client.Bind(bindEp);
                _globalUdp.UdpClient.EnableBroadcast   = true;
                _globalUdp.UdpClient.MulticastLoopback = false;

                _globalUdp.UdpClient.BeginReceive(ReceiveCallback, _globalUdp);
                _globalUdp.UdpClient.Send(discoverMsg, discoverMsg.Length, new System.Net.IPEndPoint(System.Net.IPAddress.Parse("255.255.255.255"), 30303));

                var discoverTimer = new System.Windows.Threading.DispatcherTimer();
                discoverTimer.Tick    += new EventHandler(discoverTimer_Tick);
                discoverTimer.Interval = new TimeSpan(0, 0, 5);
                discoverTimer.Start();
            }
            catch (Exception)
            {
                // ignored
            }
        }
Ejemplo n.º 37
0
 public ClearMineGame()
 {
     timer = new DispatcherTimer() { Interval = new TimeSpan(0, 0, 0, 0, 100) };
     timer.Tick += OnTick;
     Settings.Default.PropertyChanged += OnSettingsChanged;
     MessageManager.SubscribeMessage<CellStateMessage>(OnCellStatusChanged);
 }
Ejemplo n.º 38
0
        private void ExitImageFinish_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (GridFaier.Visibility == Visibility.Visible)
            {
                GridFaier.Visibility = Visibility.Hidden;

                ExitImage.Visibility      = Visibility.Hidden;
                ChetForm.Visibility       = Visibility.Hidden;
                PrimerLabel.Visibility    = Visibility.Hidden;
                OtvetTextBox.Visibility   = Visibility.Hidden;
                TimeLabel.Visibility      = Visibility.Hidden;
                CancelImage.Visibility    = Visibility.Hidden;
                SkipImage.Visibility      = Visibility.Hidden;
                label3.Visibility         = Visibility.Hidden;
                label4.Visibility         = Visibility.Hidden;
                label4_Copy.Visibility    = Visibility.Hidden;
                skiplabel.Visibility      = Visibility.Hidden;
                falselabel.Visibility     = Visibility.Hidden;
                truelabel.Visibility      = Visibility.Hidden;
                HelpFaierImage.Visibility = Visibility.Hidden;
            }
            GridGameFinish.Visibility = Visibility.Hidden;
            if (GridMagic.Visibility == Visibility.Visible)
            {
                GridMagic.Visibility = Visibility.Hidden;
                GridDedus.Visibility = Visibility.Hidden;
                timer_magic.Stop();
                timer_magic        = new System.Windows.Threading.DispatcherTimer(); GridGameFinish.Visibility = Visibility.Visible;
                min_count          = 0;
                sec_count          = 0;
                TimeLabel2.Content = "00:00";
            }
        }
 public UpdateProgressViewModel(UpdateManager updateManger,IProductUpdate productUpdate)
 {
     _updateManger = updateManger;
     _productUpdate = productUpdate;
     _dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher.CurrentDispatcher);
     StartUpdateProgressTimer();
 }
Ejemplo n.º 40
0
        private void Exit_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            GridFaier.Visibility = Visibility.Hidden;

            ExitImage.Visibility      = Visibility.Hidden;
            ChetForm.Visibility       = Visibility.Hidden;
            PrimerLabel.Visibility    = Visibility.Hidden;
            OtvetTextBox.Visibility   = Visibility.Hidden;
            TimeLabel.Visibility      = Visibility.Hidden;
            CancelImage.Visibility    = Visibility.Hidden;
            SkipImage.Visibility      = Visibility.Hidden;
            label3.Visibility         = Visibility.Hidden;
            label4.Visibility         = Visibility.Hidden;
            label4_Copy.Visibility    = Visibility.Hidden;
            skiplabel.Visibility      = Visibility.Hidden;
            falselabel.Visibility     = Visibility.Hidden;
            truelabel.Visibility      = Visibility.Hidden;
            HelpFaierImage.Visibility = Visibility.Hidden;
            sec_count          = 0;
            min_count          = 0;
            falselabel.Content = "0";
            skiplabel.Content  = "0";
            truelabel.Content  = "0";
            timer_primer.Stop();
            timer_primer = new System.Windows.Threading.DispatcherTimer();
            count_game   = attempt.Attempt(@"Attempt.txt");
        }
		private GitViewModel()
		{
			timer = new DispatcherTimer();
			timer.Interval = TimeSpan.FromMilliseconds(100);
			timer.Tick += new EventHandler(timer_Tick);
			timer.Start();
		}
Ejemplo n.º 42
0
        private void timer_primerTick(object sender, EventArgs e)
        {
            string sec, min;

            sec_count++;
            if (sec_count > 59)
            {
                min_count++;
                sec_count = 0;
            }
            sec = sec_count > 9 ? sec_count.ToString() : "0" + sec_count;
            min = min_count > 9 ? min_count.ToString() : "0" + min_count;
            TimeLabel.Content = min + ":" + sec;
            if (checkBoxTimeSetting.IsChecked.Value)
            {
                if (min_count == time_user)
                {
                    timer_primer.Stop();
                    timer_primer = new System.Windows.Threading.DispatcherTimer();
                    U            = true_ovet - skip_otvet;
                    U            = U / (min_count * 60 + sec_count);
                    U            = U * 60;
                    GridGameFinish.Visibility = Visibility.Visible;
                    CountPrimerItog.Content   = String.Format("Вы решили примеров: {0}", true_ovet);
                    CountTimeItog.Content     = String.Format("За время: {0}:{1}", min, sec);
                    CountUItog.Content        = String.Format("Ваша скорость: {0:#.##}", U);
                    CountGameToday.Content    = String.Format("Попытка за сегодня: {0}", attempt.Attempt(@"Attempt.txt"));
                    stat.Statistic("ExStat.txt", String.Format("{0} \t {1}", U, DateTime.Now));
                    true_ovet = 0; false_otvet = 0;
                }
            }
        }
        void queryTaskPoint_ExecuteCompleted(object sender, QueryEventArgs args)
        {
            FeatureSet featureSet = args.FeatureSet;

            if (featureSet == null || featureSet.Features.Count < 1)
            {
                MessageBox.Show("No features returned from query");
                return;
            }

            GraphicsLayer graphicsLayer = MyMap.Layers["MyPointGraphicsLayer"] as GraphicsLayer;

            foreach (Graphic graphic in args.FeatureSet.Features)
            {
                graphic.Symbol = LayoutRoot.Resources["YellowMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
                graphicsLayer.Graphics.Add(graphic);
            }

            if (featureSet.Features.Count == 1000)
            {
                DispatcherTimer UpdateTimer = new System.Windows.Threading.DispatcherTimer();
                UpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 250);
                UpdateTimer.Tick    += (evtsender, a) =>
                {
                    LoadPointGraphics(graphicsLayer.Graphics.Count, graphicsLayer.Graphics.Count + 1000);
                    UpdateTimer.Stop();
                };
                UpdateTimer.Start();
            }
        }
Ejemplo n.º 44
0
        private void timer_magicTick(object sender, EventArgs e)
        {
            string sec, min;

            sec_count++;
            if (sec_count > 59)
            {
                min_count++;
                sec_count = 0;
            }
            sec = sec_count > 9 ? sec_count.ToString() : "0" + sec_count;
            min = min_count > 9 ? min_count.ToString() : "0" + min_count;
            TimeLabel2.Content = min + ":" + sec;
            if (min_count == time_user_magic)
            {
                timer_magic.Stop();
                timer_magic = new System.Windows.Threading.DispatcherTimer();
                U           = magic_true_inLabel;
                U           = U / (min_count * 60 + sec_count);
                U           = U * 60;
                GridGameFinish.Visibility = Visibility.Visible;
                CountPrimerItog.Content   = String.Format("Вы решили квадратов: {0}", magic_true_inLabel);
                CountTimeItog.Content     = String.Format("За время: {0}:{1}", min, sec);
                CountUItog.Content        = String.Format("Ваша скорость: {0:#.##}", U);
                CountGameToday.Content    = String.Format("Попытка за сегодня: {0}", attempt.Attempt(@"MSAttempt.txt"));
                stat.Statistic("MagStat.txt", String.Format("{0} \t {1}", U, DateTime.Now));
                magic_false_inLabel = 0;
                magic_true_inLabel  = 0;
            }
        }
Ejemplo n.º 45
0
        public Paper()
        {
            // paper properties
            Background = new SolidColorBrush(Colors.White);
            Cursor = Cursors.IBeam;

            // setup caret
            caret = new Rectangle();
            caret.Fill = new SolidColorBrush(Colors.Black);
            caret.Height = 12;
            caret.Width = 1;
            caret.Margin = new Thickness(-1, 0, 0, 0);

            // setup caret timer
            caretTimer = new DispatcherTimer();
            caretTimer.Interval = TimeSpan.FromSeconds(0.5);
            caretTimer.Tick += delegate { caret.Visibility = (caret.Visibility == Visibility.Visible || !ShowCaret) ? Visibility.Collapsed : Visibility.Visible; };
            caretTimer.Start();

            // setup highlighting indicies
            HighlightedBlocks = new List<Character>();
            HighlightFromIndex = new Index(0, 0);
            HighlightToIndex = new Index(0, 0);

            // events
            MouseLeftButtonDown += Paper_MouseLeftButtonDown;
            MouseLeftButtonUp += Paper_MouseLeftButtonUp;
        }
Ejemplo n.º 46
0
        /// <summary>
        /// Método asincrono el cual se encarga de actualizar la lista de sensores desplegados en la pantalla
        /// cada cierto intervalo de tiempo en las coordenadas indicadas por el GPS de la posición actual.
        /// </summary>
        public async void cargarListaSensores()
        {
            try
            {
                if (HayConexiónInternet())
                {
                    Geolocator  myGeolocator  = new Geolocator();
                    Geoposition myGeoposition = await myGeolocator.GetGeopositionAsync();

                    //la = Convert.ToDouble(myGeoposition.Coordinate.Latitude);
                    //lo = Convert.ToDouble(myGeoposition.Coordinate.Longitude);
                    la = 2.446479;
                    lo = -76.598496;

                    //Se inician las actualizaciones
                    DispatcherTimer dispatcherTimer;
                    dispatcherTimer          = new System.Windows.Threading.DispatcherTimer();
                    dispatcherTimer.Tick    += new EventHandler(cargarDatos_Tick);      //Actualización de datos
                    dispatcherTimer.Interval = new TimeSpan(0, 0, tSegundosConsultas);
                    dispatcherTimer.Start();


                    DispatcherTimer timerConexionInternet;
                    timerConexionInternet          = new System.Windows.Threading.DispatcherTimer();
                    timerConexionInternet.Tick    += new EventHandler(ConexionInternet_TimerTick); //Se establece a quien se va a estar invocando
                    timerConexionInternet.Interval = new TimeSpan(0, 0, tSegundosHayInternet);     //Se establece intervalos de tiempo (t = 4)
                    timerConexionInternet.Start();
                }
            }
            finally
            {
            }
        }
Ejemplo n.º 47
0
 public ViewModel()
 {
     Current = this;
     PrimarySerial.NewMessageReceived += PrimarySerial_NewMessageReceived;
     if (IsDebugMode)
     {
         DispatcherTimer dt = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(1) };
         dt.Tick += delegate
         {
             if (!IsRandomizerEnabled || Calibrator.ActiveCalibrationSub == null)
                 return;
             double val = 0;
             switch (Calibrator.CalibrationTarget)
             {
                 case CalibrationTarget.Pump:
                     weight = weight + rnd.NextDouble() * (double)Calibrator.ActiveCalibrationSub.Setpoint / 500000;
                     val = weight;
                     break;
                 case CalibrationTarget.Stirrer:
                     val = (0.7 * rnd.NextDouble() + 0.3) * (double)Calibrator.ActiveCalibrationSub.Setpoint / 60;
                     break;
             }
             if (Calibrator.ActiveCalibrationSub != null)
                 Calibrator.ActiveCalibrationSub.AddPoint(new DataPoint(DateTime.Now, val));
         };
         dt.Start();
     }
 }
Ejemplo n.º 48
0
 /// <summary>
 /// Creates the filter for the control.
 /// </summary>
 /// <param name="control">The control to use <see cref="Dispatcher.Invoke(DispatcherPriority,Delegate)"/> for the safe
 /// starting and stopping of the Timer instance.</param>
 /// <param name="duration">The initial value for <see cref="Duration"/>.</param>
 public EventFilter(Control control, TimeSpan duration)
 {
     timer        = new Timer();
     this.control = control;
     init();
     this.Duration = duration;
 }
 private void startclock()
 {
     DispatcherTimer timer = new DispatcherTimer();
     timer.Interval = TimeSpan.FromSeconds(1);
     timer.Tick += tickevent;
     timer.Start();
 }
Ejemplo n.º 50
0
 public void TimerWork()
 {
     timer          = new DispatcherTimer();
     timer.Tick    += new EventHandler(timer_Tick);
     timer.Interval = new TimeSpan(0, 0, 1);
     timer.Start();
 }
 public MainWindow()
 {
     //img = new Image();
     //img.Source = new BitmapImage(new Uri(String.Format("pack://*****:*****@"/cat1.png", UriKind.Relative));
     //img.Source = new BitmapImage(new Uri(String.Format("pack://application:,,,/pwsg6;component/Images/{0}/{1}.png", animations[i],j), UriKind.RelativeOrAbsolute));
     wynik = 0;
     zolte = 0;
     godziny = 0;
     minuty = 0;
     sekundy = 0;
     tiki = 0;
     rozmiary = new int[] { 8, 8, 7, 9, 5, 7 };
     SizeX = 10;
     SizeY = 10;
     ksztalty = new Border[SizeY, SizeX];
     timer = new DispatcherTimer();
     timer.Interval = new TimeSpan(150 * 10000);
     timer.Tick += timer_Tick;
     InitializeComponent();
     timerLabel.Content = "Czas: 0:0:0";
     wynikLabel.Content = "Wynik: 0";
     RobPlansze();
     timer.Start();
 }
Ejemplo n.º 52
0
        private void Actualizar()
        {
            aTimer.Stop();
            //TEMPORIZADOR
            Temporizador          = new System.Windows.Threading.DispatcherTimer();
            Temporizador.Tick    += new EventHandler(dispatcherTimer_Tick);
            Temporizador.Interval = new TimeSpan(0, 0, 1);
            Tiempo = new TimeSpan();
            Temporizador.Start();
            LogManager.Instancia.AgregarMensaje("Comenzando importación de datos.");

            ImportadorDatos importa = new ImportadorDatos(this.registro);

            try
            {
                var hilo = new Thread(
                    new ThreadStart(() =>
                {
                    importa.Procesar();
                    LogManager.Instancia.AgregarMensaje("¡Importacion Finalizada!");
                    Temporizador.Stop();
                    aTimer.Start();
                    LogManager.Instancia.Resetear();
                })
                    );
                hilo.IsBackground = true;
                hilo.Start();
            }
            catch (Exception exc)
            {
                Mensajes.Error(exc);
            }
        }
Ejemplo n.º 53
0
        /*
         * Initializes the GUI components, creates the cells 2d array, and sets up the board/tiles/characters, etc.
         */
        public MainWindow()
        {
            InitializeComponent();
            setupBoard("testmap.txt");
            selectedCharacterRow = 0;
            selectedCharacterCol = 0;

            //For attack animation
            dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += onUpdate;
            dispatcherTimer.Interval = TimePerFrame;

            //For testing purposes, characters added in this way. When the game is at the point where the hero data is taken from the world map, or
            //is global to the whole program, and setUpBoard() can read positions to add the characters, then they will be added in setUpBoard() rather than here.
            boardspaces[5, 3].tileCharacter = new SoftwareEngineer(5,3);
           
            refreshBoardSpace(5, 3);
            boardspaces[1, 2].tileCharacter = new SystemsAnalyst(1,2);
            refreshBoardSpace(1, 2);
            boardspaces[2, 2].tileCharacter = new NetworkArchitect(2, 2);
            refreshBoardSpace(2, 2);
            boardspaces[5, 5].tileCharacter = new CampusPolice(5, 5);
            refreshBoardSpace(5, 5);
            boardspaces[6, 5].tileCharacter = new CampusPolice(6, 5);
            refreshBoardSpace(6, 5);
            boardspaces[5, 1].tileCharacter = new CampusPolice(5, 1);
            refreshBoardSpace(5, 1);
            boardspaces[11, 9].tileCharacter = new CampusPolice(11,9);
            refreshBoardSpace(11, 9);
            boardspaces[13, 8].tileCharacter = new FoodServer(13,8);
            refreshBoardSpace(13, 8);
            boardspaces[14, 3].tileCharacter = new Gardener(14,3);
            refreshBoardSpace(14, 3);
        }
Ejemplo n.º 54
0
 public ClockTimer()
 {
     this._dispatcherTimer = new DispatcherTimer();
       this._dispatcherTimer.Tick += dispatcherTimer_Tick;
       this._dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
       this._dispatcherTimer.Start();
 }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();

            timer = new DispatcherTimer();
            timer.Tick += timer_Tick;
            timer.Interval = TimeSpan.FromMilliseconds(66);

            if (Accelerometer.IsSupported)
            {
                accelSensor = new Accelerometer();
                accelSensor.TimeBetweenUpdates = TimeSpan.FromMilliseconds(66);
            }

            if (Compass.IsSupported)
            {
                compassSensor = new Compass();
                compassSensor.TimeBetweenUpdates = TimeSpan.FromMilliseconds(66);
                compassSensor.Calibrate += compassSensor_Calibrate;
            }

            if (Gyroscope.IsSupported)
            {
                gyroSensor = new Gyroscope();
                gyroSensor.TimeBetweenUpdates = TimeSpan.FromMilliseconds(66);
            }
        }
Ejemplo n.º 56
0
        public MainViewModel(IConfigurationService configService, INuiService nuiService, IKeyboardService keyboardService)
        {
            this.keyboardService = keyboardService;
            this.keyboardService.KeyUp += new EventHandler<KeyEventArgs>(keyboardService_KeyUp);
            this.configService = configService;
            this.nuiService = nuiService;
            this.nuiService.UserRaisedHand += new EventHandler<HandRaisedEventArgs>(nuiService_UserRaisedHand);
            this.nuiService.UserEnteredBounds += new EventHandler(nuiService_UserEnteredBounds);
            this.nuiService.UserExitedBounds += new EventHandler(nuiService_UserExitedBounds);
            this.ToggleCommand = new RelayCommand(this.ExecuteToggleCommand);
            this.AutoPlayCommand = new RelayCommand(this.ExecuteAutoPlayCommand);
            this.ToggleKinectVisionCommand = new RelayCommand(this.ExecuteToggleKinectVisionCommand);
            this.MainBackgroundBrush = (Brush)Application.Current.Resources["DefaultBackground"];
            this.EngineeringBackgroundBrush = new SolidColorBrush(Color.FromArgb(255, 0, 49, 83));

            this.videoTimer = new DispatcherTimer();
            this.videoTimer.Interval = TimeSpan.FromMilliseconds(50);
            this.videoTimer.Tick += new EventHandler(videoTimer_Tick);
            this.videoTimer.Start();

            if (!IsInDesignMode)
            {
                Application.Current.MainWindow.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged);
            }
        }
 public StopSelectionViewModel(IUnitOfWork unitOfWork, AppUse appUse, INavigationService navigationService)
     : base(appUse, ApplicationPage.StopSelection, unitOfWork, navigationService)
 {
     this.timerSearch = new DispatcherTimer();
     this.timerSearch.Interval = new TimeSpan(0, 0, 1);
     this.timerSearch.Tick += TimerTickSearch;
 }
Ejemplo n.º 58
0
 public void StartTimer()
 {
     this.startTime = DateTime.Now;
     this.timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(10) };
     this.timer.Tick += this.OnTimerTick;
     this.timer.Start();
 }
Ejemplo n.º 59
0
    public TestSuiteDialog(bool isCreate, TestSuiteVm baseTestSuite, Settings settings)
    {
      _baseTestSuite = baseTestSuite;

      _assembliesChangedTimer          = new DispatcherTimer();
      _assembliesChangedTimer.Interval = TimeSpan.FromSeconds(1.3);
      _assembliesChangedTimer.Tick    += _assembliesEdit_timer_Tick;

      _libsChangedTimer          = new DispatcherTimer();
      _libsChangedTimer.Interval = TimeSpan.FromSeconds(1.3);
      _libsChangedTimer.Tick    += _libsEdit_timer_Tick;

      DataContext = _model = new TestSuiteCreateOrEditModel(settings, isCreate, baseTestSuite?.DisableSemanticAnalysis ?? false);

      InitializeComponent();

      if (baseTestSuite != null)
      {
        _model.RootFolder           = baseTestSuite.Solution.RootFolder;
        _model.SuiteName            = baseTestSuite.Name;
        _model.NormalizedAssemblies = baseTestSuite.Assemblies;
        _model.NormalizedLibs       = baseTestSuite.Libs;

        if (baseTestSuite.Language != Nitra.Language.Instance)
          _model.SelectedLanguage = baseTestSuite.Language;
      }

      _assemblies.Text = _model.NormalizedAssembliesText;
      _assemblies.TextChanged += _assemblies_TextChanged;

      _libs.Text = _model.NormalizedLibsText;
      _libs.TextChanged += _libs_TextChanged;
    }
 void khoitaogetdatafromarduinoTimer()
 {
     getdatafromarduinoTimer          = new System.Windows.Threading.DispatcherTimer();
     getdatafromarduinoTimer.Tick    += checkdatafromarduino;
     getdatafromarduinoTimer.Interval = new TimeSpan(0, 0, 1 / 2);
     getdatafromarduinoTimer.Start();
 }