当前位置: 首页>>代码示例>>C#>>正文


C# Timer.Start方法代码示例

本文整理汇总了C#中Timer.Start方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.Start方法的具体用法?C# Timer.Start怎么用?C# Timer.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Timer的用法示例。


在下文中一共展示了Timer.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 1:
                    {
                        TimeSpan duration = reader.ReadTimeSpan();

                        m_Timer = new InternalTimer(this, duration);
                        m_Timer.Start();

                        m_End = DateTime.Now + duration;

                        break;
                    }
                case 0:
                    {
                        TimeSpan duration = TimeSpan.FromSeconds(10.0);

                        m_Timer = new InternalTimer(this, duration);
                        m_Timer.Start();

                        m_End = DateTime.Now + duration;

                        break;
                    }
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:32,代码来源:NaturalFire.cs

示例2: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
              		int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_End = reader.ReadDeltaTime();
                    m_EvolutionTimer = new EvolutionTimer( this, m_End - DateTime.Now );
                    m_EvolutionTimer.Start();

                    break;
                }
                case 0:
                {
                    TimeSpan duration = TimeSpan.FromDays( 1.0 );

                    m_EvolutionTimer = new EvolutionTimer( this, duration );
                    m_EvolutionTimer.Start();
                    m_End = DateTime.Now + duration;

                    break;
                }
            }
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:27,代码来源:Korpre+Egg.cs

示例3: DoBenchmark

 private static void DoBenchmark()
 {
     Timer t = new Timer();
     
     t.Start();
     rc = new ReferenceCounted();
     for( int i = 0; i < NumIterations; i++ )
     {
         rc2 = rc;
         rc3 = rc2;
         rc = rc3;
         rc3 = rc;
         
     }        
     t.End();
     Console.WriteLine( "Reference counted: {0}", t.Interval );
     
     t.Start();
     gc = new TracingGC();
     for( int i = 0; i < NumIterations; i++ )
     {
         gc2 = gc;
         gc3 = gc2;
         gc = gc3;
         gc3 = gc;
     }
     t.End();
     Console.WriteLine( "Tracing GC: {0}", t.Interval ); 
 }
开发者ID:ArildF,项目名称:masters,代码行数:29,代码来源:Fields.cs

示例4: MainForm_Load

	void MainForm_Load (object sender, EventArgs e)
	{
		_timer = new Timer ();
		_timer.Tick += new EventHandler (Timer_Ticket);
		_timer.Interval = 100;
		_timer.Start ();
	}
开发者ID:mono,项目名称:gert,代码行数:7,代码来源:test.cs

示例5: PageEntry

        public PageEntry(Mobile sender, string message, PageType type)
        {
            m_Sender = sender;
            m_Sent = DateTime.UtcNow;
            m_Message = Utility.FixHtml(message);
            m_Type = type;
            m_PageLocation = sender.Location;
            m_PageMap = sender.Map;

            PlayerMobile pm = sender as PlayerMobile;
            if (pm != null && pm.SpeechLog != null && Array.IndexOf(SpeechLogAttachment, type) >= 0)
            {
                m_SpeechLog = new List<SpeechLogEntry>(pm.SpeechLog);
            }

            m_Timer = new InternalTimer(this);
            m_Timer.Start();

            StaffHistory history = Reports.Reports.StaffHistory;

            if (history != null)
            {
                m_PageInfo = new PageInfo(this);

                history.AddPage(m_PageInfo);
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:27,代码来源:PageQueue.cs

示例6: BalloonBox

        public BalloonBox(MainWindow owner, string message)
        {
            InitializeComponent();

            //Margin = new Thickness(10);
            double msgLength = MeasureString(message);

            Message.Text = message;
            Message.TextWrapping = TextWrapping.Wrap;

            Width = GetWidth(msgLength);
            Height = GetHeight(msgLength);
            Point p = GetPosition();
            Left = p.X;//Forms.Screen.PrimaryScreen.WorkingArea.Width - Width;
            Top = p.Y;

            timer = new Timer(10 * 1000);
            timer.Elapsed += new ElapsedEventHandler(timer_Elapsed);
            timer.Enabled = true;
            timer.Start();

            BoxStart = this.Resources["PopupShow"] as Storyboard;
            BoxEnd = this.Resources["PopupHide"] as Storyboard;
            BoxEnd.Completed += new EventHandler(BoxEnd_Completed);
        }
开发者ID:AndyAn,项目名称:Miiror,代码行数:25,代码来源:BalloonBox.xaml.cs

示例7: Start

	void Start()
    {
        Debug.Log("Start");
        _timer = new Timer(1); // tick each second
	    _timer.Tick += TickHandler; // subscribe
        _timer.Start();
    }
开发者ID:groov0v,项目名称:edriven-gui,代码行数:7,代码来源:TimerTest.cs

示例8: Main

        public Main()
        {
            InitializeComponent();

            _mainEmailsPath = ConfigurationSettings.AppSettings["EmailClient"];

            if (!Directory.Exists(_mainEmailsPath))
            {
                Directory.CreateDirectory(_mainEmailsPath);
            }

            try
            {
                ConnectionManager.Instance.WCFConnect();
                EstablishConnectionToServer();
                ShowControls();
            }
            catch
            {
                HideControls();
                _timer = new Timer();
                _timer.Interval = 1000;
                _timer.Tick += _timer_Tick;
                _timer.Start();
            }
        }
开发者ID:idlearch,项目名称:Email,代码行数:26,代码来源:Main.cs

示例9: ProgramStarted

        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            ethernet_J11D.UseThisNetworkInterface();
            //ethernet_J11D.UseDHCP();

            string[] dns;
            dns = new string[1] { "4.2.2.3" };

            ethernet_J11D.NetworkSettings.EnableStaticIP("206.205.188.35", "255.255.252.0", "206.205.188.1");
            ethernet_J11D.NetworkSettings.EnableStaticDns(dns);

            //Thread.Sleep(10000);

            //var interfaces = NetworkInterface.GetAllNetworkInterfaces();

            var networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0];

            Debug.Print("Interface set to " + networkInterface.IPAddress);
            Debug.Print(DateTime.Now.ToString());

            Microsoft.SPOT.Hardware.Utility.SetLocalTime(Microsoft.ServiceBus.Micro.NtpClient.GetNetworkTime());

            byte[] ca = Gadgeteer.ServiceBusDirect.Resource1.GetBytes(
                Gadgeteer.ServiceBusDirect.Resource1.BinaryResources.VerisignCA);

            X509Certificate[] caCerts =
                new X509Certificate[] { new X509Certificate(ca) };

            multicolorLed.TurnOff();

            Timer timer = new Timer(3000, Timer.BehaviorType.RunContinuously);
            timer.Tick += timer_Tick;
            timer.Start();
        }
开发者ID:rickggaribay,项目名称:IoT,代码行数:35,代码来源:Program.cs

示例10: ajastam

 void ajastam()
 {
     Timer ajastin = new Timer();
     ajastin.Interval = 6.5;
     ajastin.Timeout +=luokylalainen;
     ajastin.Start();
 }
开发者ID:veissuli,项目名称:Cow-the-monstaaah,代码行数:7,代码来源:asdlehmaasd.cs

示例11: ArmyBase

		public ArmyBase(int Team, AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) 
            : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
		{
			this.Body = 400 + Utility.Random(2);
			this.Hue = Utility.RandomSkinHue();
            this.Team = Team;

			this.Skills[SkillName.DetectHidden].Base = 100;
            this.Skills[SkillName.MagicResist].Base = 120;

			int iHue = 20 + Team * 40;
			int jHue = 25 + Team * 40;

			Item hair = new Item( Utility.RandomList( 0x203C, 0x203B, 0x203C, 0x203D ) );
			hair.Hue = iHue;
			hair.Layer = Layer.Hair;
			hair.Movable = false;
			AddItem( hair );

			LeatherGloves glv = new LeatherGloves();
			glv.Hue = iHue;
			glv.LootType = LootType.Newbied;
			AddItem(glv);

			Container pack = new Backpack();

			pack.Movable = false;

			AddItem( pack );

			m_Timer = new AutokillTimer(this);
			m_Timer.Start();
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:33,代码来源:ArmyBase.cs

示例12: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Boat = reader.ReadItem() as BaseBoat;
					m_Side = (PlankSide) reader.ReadInt();
					m_Locked = reader.ReadBool();
					m_KeyValue = reader.ReadUInt();

					if ( m_Boat == null )
						Delete();

					break;
				}
			}

			if ( IsOpen )
			{
				m_CloseTimer = new CloseTimer( this );
				m_CloseTimer.Start();
			}
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:28,代码来源:Plank.cs

示例13: PreviewHouse

        public PreviewHouse(int multiID)
            : base(multiID)
        {
            m_Components = new List<Item>();

            MultiComponentList mcl = Components;

            for (int i = 1; i < mcl.List.Length; ++i)
            {
                MultiTileEntry entry = mcl.List[i];

                if (entry.m_Flags == 0)
                {
                    //Item item = new Static((int)entry.m_ItemID);
                    Item item = new Static(entry.m_ItemID & TileData.MaxItemValue);

                    item.MoveToWorld(new Point3D(X + entry.m_OffsetX, Y + entry.m_OffsetY, Z + entry.m_OffsetZ), Map);

                    m_Components.Add(item);
                }
            }

            m_Timer = new DecayTimer(this);
            m_Timer.Start();
        }
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:25,代码来源:PreviewHouse.cs

示例14: OnDamage

		public override void OnDamage( int amount, Mobile attacker, bool willKill )
		{
			if ( attacker != null && !willKill && amount > 5 && 50 > Utility.Random( 100 ) )
			{
				if ( this.Hits < (this.HitsMax/3) && this.Sacked )
				{
					attacker.SendMessage("The elemental's body bursts open!");
					AcidPool acid = new AcidPool(attacker);
					acid.Map = attacker.Map;
					acid.Location = attacker.Location;
					attacker.PlaySound( 0x25 );
				}
				else if ( !this.Sacked )
				{
					attacker.SendMessage("Acid spills from the damaged elemental!");
					AcidPool acid = new AcidPool(attacker);
					acid.Map = attacker.Map;
					acid.Location = attacker.Location;
					attacker.PlaySound( 0x25 );
				}
				BurnTimer = new m_Timer( attacker );
				BurnTimer.Start();
			}

			base.OnDamage( amount, attacker, willKill );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:26,代码来源:AcidElemental.cs

示例15: Start

 // Use this for initialization
 void Start()
 {
     test = new Timer(3.0f);
     test.tick += Test;
     test.tick += Test2;
     test.Start();
 }
开发者ID:xiayoubin,项目名称:Unity3d-Timer,代码行数:8,代码来源:TimerManager.cs


注:本文中的Timer.Start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。