System.Timers.Timer.BeginInit C# (CSharp) Méthode

BeginInit() public méthode

Notifies the object that initialization is beginning and tells it to stand by.

public BeginInit ( ) : void
Résultat void
        public void BeginInit()
        {
            Close();
            _initializing = true;
        }

Usage Example

Exemple #1
0
        public AlertBox(Alert A)
        {
            InitializeComponent();
            Invalidate();
            try
            {
                using (MemoryStream memory = new MemoryStream())
                {
                    A.GetIcon().Save(memory, ImageFormat.Png);
                    memory.Position = 0;
                    BitmapImage i = new BitmapImage();
                    i.BeginInit();
                    i.StreamSource = memory;
                    i.CacheOption = BitmapCacheOption.OnLoad;
                    i.EndInit();
                    A_ICON.Source = i;
                }

                using (MemoryStream memory = new MemoryStream())
                {
                    global::Warmon.Properties.Resources.credits.Save(memory, ImageFormat.Png);
                    memory.Position = 0;
                    BitmapImage i = new BitmapImage();
                    i.BeginInit();
                    i.StreamSource = memory;
                    i.CacheOption = BitmapCacheOption.OnLoad;
                    i.EndInit();
                    A_CRED.Source = i;
                }

                turner = A;

                A_CREDITS.Content = A.GetCredits();
                A_REMAIN.Content = A.GetTimeOverdue();
                A_TITLE.Content = A.GetTitle();
                A_LOC.Content = A.GetMission() + " - " + A.GetPlanet();
                System.Collections.IEnumerator en = A.GetRewards().GetEnumerator();
                while (en.MoveNext())
                {
                    A_REWARDS.Content += en.Current + "\n";
                }

                timmy = new Timer();
                timmy.BeginInit();
                timmy.Interval = 250;
                timmy.Elapsed += delegate(object sender, ElapsedEventArgs e)
                {
                    Dispatcher.BeginInvoke(DispatcherPriority.Background, new MainWindow.PrimeDelegate(UpdateTime));
                };
                timmy.EndInit();
                timmy.Start();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
All Usage Examples Of System.Timers.Timer::BeginInit