Esempio n. 1
2
        public RectangleTransparent()
        {
            clearPen = new Pen(Color.FromArgb(1, 0, 0, 0));
            borderDotPen = new Pen(Color.Black, 1);
            borderDotPen2 = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            penTimer = Stopwatch.StartNew();
            ScreenRectangle = CaptureHelpers.GetScreenBounds();

            surface = new Bitmap(ScreenRectangle.Width, ScreenRectangle.Height);
            gSurface = Graphics.FromImage(surface);
            gSurface.InterpolationMode = InterpolationMode.NearestNeighbor;
            gSurface.SmoothingMode = SmoothingMode.HighSpeed;
            gSurface.CompositingMode = CompositingMode.SourceCopy;
            gSurface.CompositingQuality = CompositingQuality.HighSpeed;
            gSurface.Clear(Color.FromArgb(1, 0, 0, 0));

            StartPosition = FormStartPosition.Manual;
            Bounds = ScreenRectangle;
            Text = "ShareX - " + Resources.RectangleTransparent_RectangleTransparent_Rectangle_capture_transparent;

            Shown += RectangleLight_Shown;
            KeyUp += RectangleLight_KeyUp;
            MouseDown += RectangleLight_MouseDown;
            MouseUp += RectangleLight_MouseUp;

            using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair))
            {
                Cursor = new Cursor(cursorStream);
            }

            timer = new Timer { Interval = 10 };
            timer.Tick += timer_Tick;
            timer.Start();
        }
Esempio n. 2
1
        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;
                    }
            }
        }
Esempio n. 3
1
        private static void Main()
        {
            DefaultMediaDevice = new MMDeviceEnumerator().GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
            DefaultMediaDevice.AudioEndpointVolume.OnVolumeNotification += new AudioEndpointVolumeNotificationDelegate(AudioEndpointVolume_OnVolumeNotification);

            TrayIcon = new NotifyIcon();
            TrayIcon.Icon = IconFromVolume();
            TrayIcon.Text = ToolTipFromVolume();
            TrayIcon.MouseClick += new MouseEventHandler(TrayIcon_MouseClick);
            TrayIcon.MouseDoubleClick += new MouseEventHandler(TrayIcon_MouseDoubleClick);
            TrayIcon.Visible = true;

            TrayIcon.ContextMenu = new ContextMenu();
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("Open Volume Mixer", (o, e) => { Process.Start(SystemDir + "sndvol.exe"); }));
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("-"));
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("Playback devices", (o, e) => { Process.Start(SystemDir + "rundll32.exe", @"Shell32.dll,Control_RunDLL mmsys.cpl,,playback"); }));
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("Recording devices", (o, e) => { Process.Start(SystemDir + "rundll32.exe", @"Shell32.dll,Control_RunDLL mmsys.cpl,,recording"); }));
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("Sounds", (o, e) => { Process.Start(SystemDir + "rundll32.exe", @"Shell32.dll,Control_RunDLL mmsys.cpl,,sounds"); }));
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("-"));
            TrayIcon.ContextMenu.MenuItems.Add(new MenuItem("Volume control options", (o, e) => { Process.Start(SystemDir + "sndvol.exe", "-p"); }));

            SingleClickWindow = new Timer();
            SingleClickWindow.Interval = SystemInformation.DoubleClickTime;
            SingleClickWindow.Tick += (o, e) =>
                {
                    SingleClickWindow.Stop();
                    StartVolControl();
                };

            Application.Run();
        }
Esempio n. 4
0
		public Dummy(AIType iAI, FightMode iFightMode, int iRangePerception, int iRangeFight, double dActiveSpeed, double dPassiveSpeed) : base(iAI, iFightMode, iRangePerception, iRangeFight, dActiveSpeed, dPassiveSpeed)
		{
			Body = 400 + Utility.Random(2);
			Hue = Utility.RandomSkinHue();

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

			Team = Utility.Random(3);

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

			Utility.AssignRandomHair( this, iHue );

			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();
		}
Esempio n. 5
0
File: Bot.cs Progetto: lythm/orb3d
            public Bot(BotManager manager,BotDescriptor BotDesc, int BotId)
            {
                FBotId = BotId;
                FManager = manager;
                FBotDesc = BotDesc;
                FBufferManager = new BufferManager();
                FBufferManager.Initialize(100, 100);

                FPacketSpliter = new PacketSpliter();

                FPacketSpliter.OnPacket += OnPacket;

                FConnArg = new SocketAsyncEventArgs();
                FConnArg.Completed += new EventHandler<SocketAsyncEventArgs>(IO_Completed);
                FConnArg.UserToken = this;
                FConnArg.RemoteEndPoint = FBotDesc.Host;

                FDisconnArg = new SocketAsyncEventArgs();
                FDisconnArg.Completed += new EventHandler<SocketAsyncEventArgs>(IO_Completed);
                FDisconnArg.UserToken = this;
                FDisconnArg.DisconnectReuseSocket = true;

                FSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

                FTimer = new Timer(OnTimer);
            }
Esempio n. 6
0
        public CStatusControl()
        {
            _neverinitiated = true;

            _max = 100;
            _min = 0;
            _val = 0;

            _smax = 100;
            _smin = 0;
            _sval = 0;

            _leftMargin = 32;
            _rightMargin = 32;
            _barHeight = 32;

            _shSub = false;

            ResizeRedraw = true;
            DoubleBuffered = true;

            _timer = new Timer();
            _timer.Enabled = false;
            _timer.Tick += ehFrame;
            _timer.Interval = 1000 / 25;

            _mainCaption = "Main caption";
            _subCaption = "This is a sub caption";
        }
Esempio n. 7
0
 private void ChatClient_OnGotInfo(object sender, InfoEventArgs e)
 {
     _timer = new Timer(x => SendHeartBeat(), null, 0, 5000);
     Console.WriteLine("Got info!");
     _logOnToken.TheTask.SetResult(new LogOnRequestResult(ErrorKind.Ok, e.Info, e.OnlineUsers));
     //_logOnToken = null;
 }
Esempio n. 8
0
 public WaitDialog()
 {
     InitializeComponent();
     timer = new Timer();
     timer.Tick += new EventHandler((obj, e) => {progressBar1.Value = (progressBar1.Value + 10) % 100; });
     timer.Interval = 100;
 }
Esempio n. 9
0
        public MapViewControl(frmMain Owner)
        {
            _Owner = Owner;

            InitializeComponent();

            ListSelect = new ContextMenuStrip();
            ListSelect.ItemClicked += ListSelect_Click;
            ListSelect.Closed += ListSelect_Close;
            UndoMessageTimer = new Timer();
            UndoMessageTimer.Tick += RemoveUndoMessage;

            OpenGLControl = Program.OpenGL1;
            pnlDraw.Controls.Add(OpenGLControl);

            GLInitializeDelayTimer = new Timer();
            GLInitializeDelayTimer.Interval = 50;
            GLInitializeDelayTimer.Tick += GLInitialize;
            GLInitializeDelayTimer.Enabled = true;

            tmrDraw = new Timer();
            tmrDraw.Tick += tmrDraw_Tick;
            tmrDraw.Interval = 1;

            tmrDrawDelay = new Timer();
            tmrDrawDelay.Tick += tmrDrawDelay_Tick;
            tmrDrawDelay.Interval = 30;

            UndoMessageTimer.Interval = 4000;
        }
Esempio n. 10
0
		public BaseAI(BaseCreature m)
		{
			m_Mobile = m;

			m_Timer = new AITimer(this);

			bool activate;

			if (!m.PlayerRangeSensitive)
			{
				activate = true;
			}
			else if (World.Loading)
			{
				activate = false;
			}
			else if (m.Map == null || m.Map == Map.Internal || !m.Map.GetSector(m).Active)
			{
				activate = false;
			}
			else
			{
				activate = true;
			}

			if (activate)
			{
				m_Timer.Start();
			}

			Action = ActionType.Wander;
		}
 public ChocHelper(MediaBrowser.Library.Item Item)
 {
     this.OverviewTimer = new Timer();
     this.CurrentItem = Item;
     this.setupHelper();
     Instance = this;
 }
Esempio n. 12
0
File: test.cs Progetto: mono/gert
	void MainForm_Load (object sender, EventArgs e)
	{
		_timer = new Timer ();
		_timer.Interval = 200;
		_timer.Enabled = true;
		_timer.Tick += new EventHandler (Timer_Tick);
	}
		public PlayerListBox()
		{
			DrawMode = DrawMode.OwnerDrawVariable;
            this.BackColor = Color.DimGray;
			SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true);
		    realItems = new ObservableCollection<PlayerListItem>();
            realItems.CollectionChanged += RealItemsOnCollectionChanged;

		    timer = new Timer() { Interval = stagingMs, };
		    timer.Tick += (sender, args) =>
		        {
		            try {
		                BeginUpdate();
		                int currentScroll = base.TopIndex;

		                base.Items.Clear();
		                base.Items.AddRange(realItems.ToArray());

		                base.TopIndex = currentScroll;
		                EndUpdate();

		                timer.Stop();
		            } catch (Exception ex) {
		                Trace.TraceError("Error updating list: {0}",ex);
		            }
		        };
		    IntegralHeight = false; //so that the playerlistBox completely fill the edge (not snap to some item size)
		}
Esempio n. 14
0
	// Use this for initialization
	void Start () {
		 circles = GetComponentsInChildren<Circle>();
		 inputField = GameObject.Find("Canvas/InputField").GetComponent<InputField>();
		 stressBar = GameObject.Find("Canvas/Stress").GetComponent<Slider>();
		 audios = GetComponents<AudioSource>();

		 blackBackground = GameObject.Find("Canvas/BlackBackground");
		 gameOver = GameObject.Find("Canvas/BlackBackground/GameOver");
		 pressEnter = GameObject.Find("Canvas/BlackBackground/PressEnter");
		 gameStart = GameObject.Find("Canvas/BlackBackground/GameStart");
		 healthIndicator = GameObject.Find("Canvas/HealthIndicator").GetComponent<HealthIndicator>();

		 gameOver.SetActive(false);
		 isGameOver = true;
		 healthIndicator.SetTransparency(0f);

		 currentDay = 0;
		 taskIndex = 0;
		 dayTimer = new Timer(30f);
		 endOfDayTimer = new Timer(4f);
		 dayTimer.Reset();
		 taskTimer = new Timer(StepTimeBasedOnDay);
		 prevRandTask = 0;

		 daysData = CSVParser.Parse("Data/days");
	}
Esempio n. 15
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				return;
			}

			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				//to prevent exploiting for pvp
				from.SendLocalizedMessage( 1075857 ); // You can not use that while paralyzed.
				return;
			} 

			if ( m_Timer == null )
			{
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), new TimerCallback( OnFirebombTimerTick ) );
				m_LitBy = from;
				from.SendLocalizedMessage( 1060581 ); //You light the firebomb! Throw it now!
			}
			else
				from.SendLocalizedMessage( 1060582 ); //You've already lit it! Better throw it now!

			from.BeginTarget( 12, true, TargetFlags.None, new TargetCallback( OnFirebombTarget ) );
		}
Esempio n. 16
0
        public frmSplash()
        {
            InitializeComponent();
            label1.Parent = pictureBox1;
            label1.BackColor = Color.Transparent;
            label2.Parent = pictureBox1;
            label2.BackColor = Color.Transparent;
            label3.Parent = pictureBox1;
            label3.BackColor = Color.Transparent;
            label4.Parent = pictureBox1;
            label4.BackColor = Color.Transparent;
            label5.Parent = pictureBox1;
            label5.BackColor = Color.Transparent;

            version.Parent = pictureBox1;
            version.BackColor = Color.Transparent;
            lblbuilddate.Parent = pictureBox1;
            lblbuilddate.BackColor = Color.Transparent;

            version.Text = "Version " + Application.ProductVersion;
            lblbuilddate.Text = "Build Date: " + Utility.RetrieveLinkerTimestamp().ToString();

            LoadPluginSplash();
            m_timer = new Timer();
            m_timer.Interval = 20;
            m_timer.Tick += new EventHandler(m_timer_Tick);
            m_timer.Start();

            Opacity = 0.0;
        }
        public FountainOfLife(int charges)
            : base(0x2AC0)
        {
            this.m_Charges = charges;

            this.m_Timer = Timer.DelayCall(this.RechargeTime, this.RechargeTime, new TimerCallback(Recharge));
        }
Esempio n. 18
0
 private void Initialize(EventHandler<EventArgs> method, int maxWaitTime,string waitMessage,bool cancelEnable, bool timerVisable)
 {
     InitializeComponent();
     //initialize form
     this.FormBorderStyle = FormBorderStyle.None;
     this.StartPosition = FormStartPosition.CenterParent;
     this.ShowInTaskbar = false;
     Color[] c = GetRandColor();
     //this.panel1.BackColor = c[0];
     //this.BackColor = c[1];
     this.labMessage.Text = waitMessage;
     _Timer = new Timer();
     _Timer.Interval = _EffectTime/_EffectCount;
     _Timer.Tick += _Timer_Tick;
     this.Opacity = 0;
     FormEffectEnable = false;
     //para
     TimeSpan = 500;
     Message = string.Empty;
     _CancelEnable = cancelEnable;
     _MaxWaitTime = maxWaitTime;
     _WaitTime = 0;
     _Method = method;
     this.pictureBoxCancel.Visible = _CancelEnable;
     this.labTimer.Visible = timerVisable;
     this.timer1.Interval = TimeSpan;
     this.timer1.Start();
 }
Esempio n. 19
0
 /// <summary>
 /// Starts the timer.
 /// </summary>
 public void StartTimer()
 {
     timer = new Timer();
     timer.Interval = 250;
     timer.Tick += new EventHandler(Timer_Tick);
     timer.Start();
 }
        void QuickFillScreen3_Opened(System.Object sender, System.EventArgs e)
        {
            IsFinished = false;

            HoldCount = 0;
            std_value = 100;

            tmrPressMonitor = new Timer();
            tmrPressMonitor.Interval = 1000;
            tmrPressMonitor.Enabled = true;
            tmrPressMonitor.Tick += MONITOR_TICK;

            tmrSTDMonitor = new Timer();
            tmrSTDMonitor.Interval = 60000;
            tmrSTDMonitor.Enabled = false;
            tmrSTDMonitor.Tick += STDMonitor_TICK;

            Globals.Comm.PressSensors[1].ClearPressureData();

            tmrAutoClose = new Timer();
            tmrAutoClose.Interval = 60000;
            tmrAutoClose.Tick += AUTOCLOSE_TICK;
            tmrAutoClose.Enabled = false;
            lblQuickFill.Text = "Quick Filling in Progress...";
        }
 public RotatingColor()
 {
     timer = new Timer();
     timer.Tick += new EventHandler(this.Tick);
     timer.Interval = 50;
     hslcolor = new HSLColor(0.0, 240.0, 120.0);
 }
Esempio n. 22
0
        public DasmPanel()
        {
            TabStop = true;
            //         BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.Font = new Font("Courier", 13, System.Drawing.FontStyle.Regular, GraphicsUnit.Pixel);
            Size = new System.Drawing.Size(424, 148);
            ControlStyles styles = ControlStyles.Selectable |
                                   ControlStyles.UserPaint |
                                   ControlStyles.ResizeRedraw |
                                   ControlStyles.StandardClick |           // csClickEvents
                                   ControlStyles.UserMouse |               // csCaptureMouse
                                   ControlStyles.ContainerControl |        // csAcceptsControls?
                                   ControlStyles.StandardDoubleClick |     // csDoubleClicks
                //                                ControlStyles.Opaque  |                 // csOpaque
                                   0;
            base.SetStyle(styles, true);

            mouseTimer = new Timer();
            mouseTimer.Enabled = false;
            mouseTimer.Interval = 50;
            mouseTimer.Tick += OnMouseTimer;

            fLineHeight = 1;
            fVisibleLineCount = 0;
            fTopAddress = 0;
            fActiveLine = 0;
            fBreakColor = Color.Red;
            fBreakForeColor = Color.Black;
            UpdateLines();
        }
Esempio n. 23
0
        public TreeStump(int itemID)
            : base()
        {
            this.AddComponent(new AddonComponent(itemID), 0, 0, 0);

            this.m_Timer = Timer.DelayCall(TimeSpan.FromDays(1), TimeSpan.FromDays(1), new TimerCallback(GiveLogs));
        }
 void QuickFillScreen2_Opened(System.Object sender, System.EventArgs e)
 {
     tmrPressMonitor = new Timer();
     tmrPressMonitor.Interval = 500;
     tmrPressMonitor.Enabled = true;
     tmrPressMonitor.Tick += MONITOR_TICK;
 }
Esempio n. 25
0
 /// <summary>
 /// フォームのロード時
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MainForm_Load(object sender, EventArgs e)
 {
     m_timer = new Timer();
     m_timer.Tick += this.timerTickHandler;
     m_timer.Interval = this.calcInterval();
     m_timer.Start();
 }
 protected override void OnInitialise()
 {
     base.OnInitialise();
     _tickTimer = _timeTrigger;
     r_singleShot = _singleShot;
     _hasTicked = false;
 }
Esempio n. 27
0
        public GraphicsDeviceControl()
        {
            // Don't initialize the graphics device if we are running in the designer.
            if (!DesignMode)
            {
                graphicsDeviceService = GraphicsDeviceService.AddRef(Handle,
                                                                     ClientSize.Width,
                                                                     ClientSize.Height);

                // Register the service, so components like ContentManager can find it.
                services.AddService<IGraphicsDeviceService>(graphicsDeviceService);

                // We used to just invalidate on idle, which ate up the CPU.
                // Instead, I'm going to put it on a 30 fps timer
                //Application.Idle += delegate { Invalidate(); };
                mTimer = new Timer();
                // If the user hasn't set DesiredFramesPerSecond
                // this will just set it to 30 and it will set the
                // interval.  If the user has, then this will use the
                // custom value set.
                DesiredFramesPerSecond = mDesiredFramesPerSecond;
                mTimer.Tick += delegate { Invalidate(); };
                mTimer.Start();

                // Give derived classes a chance to initialize themselves.
                Initialize();
            }
        }
Esempio n. 28
0
        public Form1()
        {
            InitializeComponent();
            ControlledProcess = new Process();
            Temperature = new TemperatureWorker(1000);      //refresh time = 1000ms
            TimerInt =  new Timer();
            TimerInt.Interval = 1000;
            TimerInt.Tick += new EventHandler(timer_tick);
            TimerInt.Start();

            statusStrip1.Text = "statusStrip1";
            statusStrip1.Items.Add("Core 1:");
            statusStrip1.Items[0].AutoSize = false;
            statusStrip1.Items[0].Size = new Size(statusStrip1.Width / 5, 1);

            statusStrip1.Items.Add("Core 2:");
            statusStrip1.Items[1].AutoSize = false;
            statusStrip1.Items[1].Size = new Size(statusStrip1.Width / 5, 1);

            statusStrip1.Items.Add("Core 3:");
            statusStrip1.Items[2].AutoSize = false;
            statusStrip1.Items[2].Size = new Size(statusStrip1.Width / 5, 1);

            statusStrip1.Items.Add("Core 4:");
            statusStrip1.Items[3].AutoSize = false;
            statusStrip1.Items[3].Size = new Size(statusStrip1.Width / 5, 1);
        }
 public RouletteTable(int maxChipsOnTable, RandomNumberGenerator generator, Timer timer, WalletService walletService)
 {
     this.maxChipsOnTable = maxChipsOnTable;
     this.rng = generator;
     this.timer = timer;
     this.walletService = walletService;
 }
Esempio n. 30
0
        public Main()
        {
            InitializeComponent();

            _random = new Random();

            Icon = Resources.Clock;
            Opacity = 0.90;

            _timer = new Timer();
            _timer.Tick += new EventHandler(Timer_Tick);

            Icon = Resources.Clock;

            NotifyIcon.Icon = Resources.Clock;
            NotifyIcon.Text = Resources.StoppedLabel;

            _notification = new Notification
            {
                StartPosition = FormStartPosition.Manual
            };

            _notification.Location = new Point(Screen.PrimaryScreen.WorkingArea.Right - _notification.Width - 10,
                                 Screen.PrimaryScreen.WorkingArea.Bottom - _notification.Height - 10);

            _notification.ResetButton.Click += NotificationResetButton_Click;
        }
Esempio n. 31
0
 private void StopTimerInternal()
 {
     _timer?.Dispose();
     _timer = null !;
 }
Esempio n. 32
0
        public void OnTarget(Mobile from, object obj)
        {
            if (Deleted || m_InUse)
            {
                return;
            }

            IPoint3D p3D = obj as IPoint3D;

            if (p3D == null)
            {
                return;
            }

            Map map = from.Map;

            if (map == null || map == Map.Internal)
            {
                return;
            }

            int x = p3D.X, y = p3D.Y, z = map.GetAverageZ(x, y);               // OSI just takes the targeted Z

            if (!from.InRange(p3D, 6))
            {
                from.SendLocalizedMessage(500976);                   // You need to be closer to the water to fish!
            }
            else if (!from.InLOS(obj))
            {
                from.SendLocalizedMessage(500979);                   // You cannot see that location.
            }
            else if (RequireDeepWater ? FullValidation(map, x, y) : (ValidateDeepWater(map, x, y) || ValidateUndeepWater(map, obj, ref z)))
            {
                Point3D p = new Point3D(x, y, z);

                if (GetType() == typeof(SpecialFishingNet))
                {
                    for (int i = 1; i < Amount; ++i)                       // these were stackable before, doh
                    {
                        from.AddToBackpack(new SpecialFishingNet());
                    }
                }

                m_InUse = true;
                Movable = false;
                MoveToWorld(p, map);

                SpellHelper.Turn(from, p);
                from.Animate(12, 5, 1, true, false, 0);

                Effects.SendLocationEffect(p, map, 0x352D, 16, 4);
                Effects.PlaySound(p, map, 0x364);

                Timer.DelayCall <EffectInfo>(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.25), 14, new TimerStateCallback <EffectInfo>(DoEffect), new EffectInfo(p, from));

                from.SendLocalizedMessage(RequireDeepWater ? 1010487 : 1074492);                   // You plunge the net into the sea... / You plunge the net into the water...
            }
            else
            {
                from.SendLocalizedMessage(RequireDeepWater ? 1010485 : 1074491);                   // You can only use this net in deep water! / You can only use this net in water!
            }
        }
Esempio n. 33
0
 public RealTimeTimer()
 {
     timer       = new Timer();
     timer.Tick += OnTick;
 }
		static void Main ()
		{
			// Use something from System so that the entire reference isn't linked away
			var system = new Timer ();
		}
Esempio n. 35
0
 void Start()
 {
     lifeTimer = new Timer(lifeTime);
     lifeTimer.Start();
 }
Esempio n. 36
0
 /// <summary>
 /// Release all resources (called by Dispose and Finalizer)
 /// </summary>
 private void FreeResources()
 {
     if (_timerDuration != null)
     {
         _timerDuration.Stop(); _timerDuration.Close(); _timerDuration.Dispose(); _timerDuration = null;
     }
     if (_timerSnapshot != null)
     {
         _timerSnapshot.Stop(); _timerSnapshot.Close(); _timerSnapshot.Dispose(); _timerSnapshot = null;
     }
     if (_waitEvent != null)
     {
         _waitEvent.Close();
         _waitEvent = null;
         if (_frames != null)
         {
             foreach (Bitmap bitmap in _frames)
             {
                 bitmap.Dispose();
             }
             _frames.Clear();
             _frames = null;
         }
     }
 }
Esempio n. 37
0
 public void Start()
 {
     timerFileSize          = new Timer(1000);
     timerFileSize.Elapsed += timerFileSize_Elapsed;
     timerFileSize.Start();
 }
Esempio n. 38
0
 public EventTimerRegulator(int msec)
 {
     timer1 = new Timer(OutputEvent, null, 0, msec);
 }
Esempio n. 39
0
 public FEITClickableScreen(ref Canvas canvas, clickableAreaReaction _reaction, ref Timer t)
 {
     mt         = t;
     mfReaction = _reaction;
     addClickableArea(ref canvas);
 }
Esempio n. 40
0
        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(UCMessageWindow));

            this.groupControlMessageForm = new GroupControl();
            this.gridControlMessage      = new GridControl();
            this.gridViewMessage         = new GridView();
            this.gc_typeid      = new GridColumn();
            this.gc_typename    = new GridColumn();
            this.gc_content     = new GridColumn();
            this.pictureBoxExit = new PictureBox();
            this.timerMoving    = new Timer(this.components);
            ((ISupportInitialize)this.groupControlMessageForm).BeginInit();
            this.groupControlMessageForm.SuspendLayout();
            ((ISupportInitialize)this.gridControlMessage).BeginInit();
            ((ISupportInitialize)this.gridViewMessage).BeginInit();
            ((ISupportInitialize)this.pictureBoxExit).BeginInit();
            base.SuspendLayout();
            this.groupControlMessageForm.AppearanceCaption.Font                 = new Font("宋体", 10.5f, FontStyle.Bold, GraphicsUnit.Point, 134);
            this.groupControlMessageForm.AppearanceCaption.ForeColor            = Color.FromArgb(192, 0, 0);
            this.groupControlMessageForm.AppearanceCaption.Options.UseFont      = true;
            this.groupControlMessageForm.AppearanceCaption.Options.UseForeColor = true;
            this.groupControlMessageForm.Controls.Add(this.gridControlMessage);
            this.groupControlMessageForm.Controls.Add(this.pictureBoxExit);
            this.groupControlMessageForm.Dock        = DockStyle.Fill;
            this.groupControlMessageForm.Location    = new Point(0, 0);
            this.groupControlMessageForm.Name        = "groupControlMessageForm";
            this.groupControlMessageForm.Size        = new Size(313, 184);
            this.groupControlMessageForm.TabIndex    = 1;
            this.groupControlMessageForm.Text        = "系统提示";
            this.groupControlMessageForm.Paint      += new PaintEventHandler(this.groupControlMessageForm_Paint);
            this.groupControlMessageForm.MouseEnter += new EventHandler(this.groupControlMessageForm_MouseEnter);
            this.groupControlMessageForm.MouseLeave += new EventHandler(this.groupControlMessageForm_MouseLeave);
            this.gridControlMessage.Dock             = DockStyle.Fill;
            this.gridControlMessage.Location         = new Point(2, 24);
            this.gridControlMessage.MainView         = this.gridViewMessage;
            this.gridControlMessage.Name             = "gridControlMessage";
            this.gridControlMessage.Size             = new Size(309, 158);
            this.gridControlMessage.TabIndex         = 1;
            this.gridControlMessage.ViewCollection.AddRange(new BaseView[]
            {
                this.gridViewMessage
            });
            this.gridViewMessage.Columns.AddRange(new GridColumn[]
            {
                this.gc_typeid,
                this.gc_typename,
                this.gc_content
            });
            this.gridViewMessage.FocusRectStyle           = DrawFocusRectStyle.RowFocus;
            this.gridViewMessage.GridControl              = this.gridControlMessage;
            this.gridViewMessage.Name                     = "gridViewMessage";
            this.gridViewMessage.OptionsBehavior.Editable = false;
            this.gridViewMessage.OptionsFilter.AllowColumnMRUFilterList       = false;
            this.gridViewMessage.OptionsFilter.AllowFilterEditor              = false;
            this.gridViewMessage.OptionsFilter.AllowMRUFilterList             = false;
            this.gridViewMessage.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridViewMessage.OptionsView.ShowColumnHeaders = false;
            this.gridViewMessage.OptionsView.ShowGroupPanel    = false;
            this.gridViewMessage.OptionsView.ShowIndicator     = false;
            this.gridViewMessage.CustomDrawCell += new RowCellCustomDrawEventHandler(this.gridViewMessage_CustomDrawCell);
            this.gc_typeid.Caption                    = "类型ID";
            this.gc_typeid.FieldName                  = "TYPEID";
            this.gc_typeid.Name                       = "gc_typeid";
            this.gc_typename.Caption                  = "类型名称";
            this.gc_typename.FieldName                = "TYPENAME";
            this.gc_typename.Name                     = "gc_typename";
            this.gc_typename.Visible                  = true;
            this.gc_typename.VisibleIndex             = 0;
            this.gc_typename.Width                    = 60;
            this.gc_content.Caption                   = "内容";
            this.gc_content.FieldName                 = "CONTENT";
            this.gc_content.Name                      = "gc_content";
            this.gc_content.Visible                   = true;
            this.gc_content.VisibleIndex              = 1;
            this.gc_content.Width                     = 249;
            this.pictureBoxExit.BackgroundImage       = (Image)resources.GetObject("pictureBoxExit.BackgroundImage");
            this.pictureBoxExit.BackgroundImageLayout = ImageLayout.Stretch;
            this.pictureBoxExit.Cursor                = Cursors.Hand;
            this.pictureBoxExit.Location              = new Point(289, 3);
            this.pictureBoxExit.Name                  = "pictureBoxExit";
            this.pictureBoxExit.Size                  = new Size(18, 18);
            this.pictureBoxExit.TabIndex              = 0;
            this.pictureBoxExit.TabStop               = false;
            this.pictureBoxExit.Click                += new EventHandler(this.pictureBoxExit_Click);
            this.timerMoving.Interval                 = 10;
            this.timerMoving.Tick                    += new EventHandler(this.timerMoving_Tick);
            base.AutoScaleDimensions                  = new SizeF(7f, 14f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.Controls.Add(this.groupControlMessageForm);
            base.Name = "UCMessageWindow";
            base.Size = new Size(313, 184);
            ((ISupportInitialize)this.groupControlMessageForm).EndInit();
            this.groupControlMessageForm.ResumeLayout(false);
            ((ISupportInitialize)this.gridControlMessage).EndInit();
            ((ISupportInitialize)this.gridViewMessage).EndInit();
            ((ISupportInitialize)this.pictureBoxExit).EndInit();
            base.ResumeLayout(false);
        }
Esempio n. 41
0
 /// <summary>
 ///     The start timer.
 /// </summary>
 /// <param name="t">
 ///     The t.
 /// </param>
 /// <param name="cb">
 ///     The cb.
 /// </param>
 /// <param name="d">
 ///     The d.
 /// </param>
 /// <param name="p">
 ///     The p.
 /// </param>
 public void StartTimer(ref Timer t, TimerCallback cb, int d, int p)
 {
     MakeTimer(ref t, cb, d, p);
     StartTimer(ref t);
 }
        public void Start()
        {
            Database.Notifications.OnTransformerChange += OnTransformerChange;

            timer = Database.TimerManager.NewTimer(x => Execute(), TimeSpan.Zero, replicationFrequency);
        }
Esempio n. 43
0
	void Awake()
	{
        text = this.GetComponentStrict<Text>();
        overallTimer = new Timer(duration);
	}
Esempio n. 44
0
 //se ejecuta cuando se monta la aplicacion o se sube
 public Task StartAsync(CancellationToken cancellationToken)
 {
     WriteToFile("WriteToFileHostedService: Process Started");
     timer = new Timer(DoWork, null, TimeSpan.Zero, TimeSpan.FromSeconds(5));
     return(Task.CompletedTask);
 }
Esempio n. 45
0
        private void actualizarListaCMD( )
        {
            var t = new Timer(x => this.ActualizarLista( ));

            t.Change(TimeSpan.FromSeconds(1), Timeout.InfiniteTimeSpan);
        }
Esempio n. 46
0
 public TimedValue(float value, float time)
 {
     this.value = value;
     timer      = new Timer(time, true);
 }
Esempio n. 47
0
		private void Tastudio_Load(object sender, EventArgs e)
		{
			if (!InitializeOnLoad())
			{
				Close();
				DialogResult = DialogResult.Cancel;
				return;
			}

			SetColumnsFromCurrentStickies();

			if (VersionInfo.DeveloperBuild)
			{
				RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems().ToArray());

				RightClickMenu.Items
				.OfType<ToolStripMenuItem>()
				.First(t => t.Name == "RotateMenuItem")
				.Click += (o, ov) =>
				{
					CurrentTasMovie.FlagChanges();
				};
			}

			TasView.InputPaintingMode = Settings.DrawInput;
			TasView.ScrollSpeed = Settings.ScrollSpeed;
			TasView.AlwaysScroll = Settings.FollowCursorAlwaysScroll;
			TasView.ScrollMethod = Settings.FollowCursorScrollMethod;
			TasView.SeekingCutoffInterval = Settings.SeekingCutoffInterval;
			BookMarkControl.HoverInterval = Settings.BranchCellHoverInterval;

			_autosaveTimer = new Timer(components);
			_autosaveTimer.Tick += AutosaveTimerEventProcessor;
			if (Settings.AutosaveInterval > 0)
			{
				_autosaveTimer.Interval = (int)Settings.AutosaveInterval;
				_autosaveTimer.Start();
			}

			// Remembering Split container logic
			int defaultMainSplitDistance = MainVertialSplit.SplitterDistance;
			int defaultBranchMarkerSplitDistance = BranchesMarkersSplit.SplitterDistance;

			ToolStripMenuItem restoreDefaults = TASMenu.Items
				.OfType<ToolStripMenuItem>()
				.Single(t => t.Name == "SettingsSubMenu")
				.DropDownItems
				.OfType<ToolStripMenuItem>()
				.Single(t => t.Text == "Restore &Defaults");

			restoreDefaults.Click += (o, ev) =>
			{
				MainVertialSplit.SplitterDistance = defaultMainSplitDistance;
				BranchesMarkersSplit.SplitterDistance = defaultBranchMarkerSplitDistance;
			};

			if (Settings.MainVerticalSplitDistance > 0)
			{
				MainVertialSplit.SplitterDistance = Settings.MainVerticalSplitDistance;
			}

			if (Settings.BranchMarkerSplitDistance > 0)
			{
				BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance;
			}

			RefreshDialog();
			_initialized = true;
		}
 public CutSceneProjectile(CutSceneToad aAIController) : base(aAIController)
 {
     m_ProjectileAttackTimer = Services.TimerManager.CreateTimer("TutorialProjectile", Constants.ProjectileAttackTimer, false);
 }
Esempio n. 49
0
 /// <summary>
 ///     The make timer.
 /// </summary>
 /// <param name="t">
 ///     The t.
 /// </param>
 /// <param name="cb">
 ///     The cb.
 /// </param>
 /// <param name="state">
 ///     The state.
 /// </param>
 /// <param name="d">
 ///     The d.
 /// </param>
 /// <param name="p">
 ///     The p.
 /// </param>
 public void MakeTimer(ref Timer t, TimerCallback cb, object state, int d, int p)
 {
     t = new Timer(cb, state, Timeout.Infinite, Timeout.Infinite);
     heardof.Add(t, new TimerStuff(cb, d, p));
 }
Esempio n. 50
0
        private void editarNuevoCMD( )
        {
            var t = new Timer(x => this.Aceptar( ));

            t.Change(TimeSpan.FromSeconds(1), Timeout.InfiniteTimeSpan);
        }
Esempio n. 51
0
 void Awake()
 {
     singleton = this;
 }
Esempio n. 52
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();
 }
Esempio n. 53
0
 protected override void OnResume()
 {
     base.OnResume();
     startTime          = DateTime.UtcNow;
     MQTT_Receive_Timer = new Timer(HandleTimerCallback, startTime, 0, 100);
 }
Esempio n. 54
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DataGenerator" /> class that generates the data to be used for interoperability testing.
 /// </summary>
 public DataGenerator()
 {
     m_Timer = new Timer(TimerCallback, null, 1000, 1000);
 }
Esempio n. 55
0
 private ServerGameCenter()
 {
     _serverGames.Clear();
     _timer = new Timer(UpdateServerGames, null, _updateInterval, _updateInterval);
 }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            this.m_MobFactionArea = new Rectangle3D[0];

            switch (version)
            {
            case 1:
            {
                this.m_EjectLocation = reader.ReadPoint3D();
                string ejectmap = reader.ReadString();
                try
                {
                    this.m_EjectMap = Map.Parse(ejectmap);
                }
                catch
                {
                }

                string factiontype = reader.ReadString();
                try
                {
                    this.m_FactionType = (XmlMobFactions.GroupTypes)Enum.Parse(typeof(XmlMobFactions.GroupTypes), factiontype);
                }
                catch
                {
                }
                this.m_FactionLevel = reader.ReadInt();

                goto case 0;
            }

            case 0:
            {
                this.m_Music = (MusicName)reader.ReadInt();
                this.m_MobFactionPriority = reader.ReadInt();
                if (version < 1)
                {
                    // old region area
                    reader.ReadRect2D();
                }
                this.m_MobFactionRegionName = reader.ReadString();
                string mapname = reader.ReadString();
                try
                {
                    this.m_MobFactionMap = Map.Parse(mapname);
                }
                catch
                {
                }
                this.m_CopiedRegion = reader.ReadString();
                // do the coord list
                int count = reader.ReadInt();
                if (count > 0)
                {
                    // the old version used 2D rectangles for the region area.  The new version uses 3D
                    if (version < 1)
                    {
                        Rectangle2D[] area = new Rectangle2D[count];
                        for (int i = 0; i < count; i++)
                        {
                            area[i] = reader.ReadRect2D();
                        }
                        this.m_MobFactionArea = Region.ConvertTo3D(area);
                    }
                    else
                    {
                        this.m_MobFactionArea = new Rectangle3D[count];
                        for (int i = 0; i < count; i++)
                        {
                            this.m_MobFactionArea[i] = new Rectangle3D(reader.ReadPoint3D(), reader.ReadPoint3D());
                        }
                    }
                }

                break;
            }
            }

            // refresh the region
            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(RefreshRegions));
        }
Esempio n. 57
0
        public VvVBattle(GenericReader reader, ViceVsVirtueSystem system)
        {
            int version = reader.ReadInt();

            System = system;

            Altars       = new List <VvVAltar>();
            KillCooldown = new Dictionary <Mobile, DateTime>();
            Messages     = new List <string>();
            Traps        = new List <VvVTrap>();
            Warned       = new List <Mobile>();
            Turrets      = new List <CannonTurret>();
            Teams        = new List <BattleTeam>();

            OnGoing = reader.ReadBool();

            if (reader.ReadInt() == 0)
            {
                StartTime           = reader.ReadDateTime();
                CooldownEnds        = reader.ReadDateTime();
                LastOccupationCheck = reader.ReadDateTime();
                NextSigilSpawn      = reader.ReadDateTime();
                NextAnnouncement    = reader.ReadDateTime();
                NextAltarActivate   = reader.ReadDateTime();
                City         = (VvVCity)reader.ReadInt();
                Sigil        = reader.ReadItem() as VvVSigil;
                VicePriest   = reader.ReadMobile() as VvVPriest;
                VirtuePriest = reader.ReadMobile() as VvVPriest;

                if (Sigil != null)
                {
                    Sigil.Battle = this;
                }

                if (VicePriest != null)
                {
                    VicePriest.Battle = this;
                }

                if (VirtuePriest != null)
                {
                    VirtuePriest.Battle = this;
                }

                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    VvVAltar altar = reader.ReadItem() as VvVAltar;
                    if (altar != null)
                    {
                        altar.Battle = this;
                        Altars.Add(altar);
                    }
                }

                if (version == 1)
                {
                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        BattleTeam team = new BattleTeam(reader);
                        Teams.Add(team);
                    }
                }
                else
                {
                    count = reader.ReadInt();
                    for (int i = 0; i < count; i++)
                    {
                        Guild g = reader.ReadGuild() as Guild;
                        VvVGuildBattleStats stats = new VvVGuildBattleStats(reader, g);
                    }
                }

                count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    VvVTrap t = reader.ReadItem() as VvVTrap;

                    if (t != null)
                    {
                        Traps.Add(t);
                    }
                }

                Timer.DelayCall(TimeSpan.FromSeconds(10), () =>
                {
                    if (Region is GuardedRegion)
                    {
                        GuardedRegion.Disable((GuardedRegion)Region);
                    }

                    BeginTimer();

                    ActivateArrows();
                });
            }
        }
 public void Start()
 {
     _timer = new Timer(o => TimerCallbackHandler(), state: null, dueTime: 0, period: _producerCycleS);
 }
Esempio n. 59
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Properties.Settings.Default.Upgrade();

            //Inititalize OpenHardwareMonitorLib
            computer.Open();

            //Setup timer
            tmr = new Timer {
                Interval = Properties.Settings.Default.Refresh * 1000,
                Enabled  = true
            };

            tmr.Tick += tmr_tick;

            //Setup context menu
            contextMenu = new ContextMenu();
            contextMenu.MenuItems.AddRange(new MenuItem[] {
                new MenuItem {
                    Text    = "TrayTemperature",
                    Enabled = false
                },
                new MenuItem {
                    Text    = "www.fergonez.net",
                    Enabled = false
                },
                new MenuItem {
                    Text = "-",
                },
                new MenuItem {
                    Name    = "menCel",
                    Text    = "Celsius",
                    Checked = true,
                },
                new MenuItem {
                    Name = "menFah",
                    Text = "Fahrenheit"
                },
                new MenuItem {
                    Text = "-",
                },
                new MenuItem {
                    Name = "menRefresh",
                    Text = "Refresh",
                },
                new MenuItem {
                    Name = "menLog",
                    Text = "Log"
                },
                new MenuItem {
                    Name = "menReset",
                    Text = "Reset statistics"
                },
                new MenuItem {
                    Text = "-",
                },
                new MenuItem {
                    Name = "menExit",
                    Text = "Exit"
                },
            });

            //Refresh rate context sub-menus
            MenuItem refreshMenu = contextMenu.MenuItems.Find("menRefresh", false).First();

            refreshMenu.MenuItems.AddRange(new MenuItem[] {
                new MenuItem {
                    Name = "1", Text = "1s"
                },
                new MenuItem {
                    Name = "2", Text = "2s"
                },
                new MenuItem {
                    Name = "5", Text = "5s"
                },
                new MenuItem {
                    Name = "10", Text = "10s"
                },
                new MenuItem {
                    Name = "15", Text = "15s"
                },
                new MenuItem {
                    Name = "30", Text = "30s"
                },
                new MenuItem {
                    Name = "60", Text = "60s"
                }
            });

            //Check the correct refresh rate MenuItem based on saved settings
            refreshMenu.MenuItems.Find(Properties.Settings.Default.Refresh.ToString(), false).First().Checked = true;

            //Add event listeners to the menus
            foreach (MenuItem menuItem in contextMenu.MenuItems)
            {
                menuItem.Click += menu_Click;
            }

            foreach (MenuItem menuItem in refreshMenu.MenuItems)
            {
                menuItem.Click += menuRefresh_Click;
            }
            ;

            //Check either Celsius or Fahrenheit based on saved settings
            if (Properties.Settings.Default.Celsius)
            {
                contextMenu.MenuItems.Find("menCel", false).First().Checked = true;
                contextMenu.MenuItems.Find("menFah", false).First().Checked = false;
            }
            else
            {
                contextMenu.MenuItems.Find("menCel", false).First().Checked = false;
                contextMenu.MenuItems.Find("menFah", false).First().Checked = true;
            }

            //Setup tray icon
            ni = new NotifyIcon {
                Visible     = true,
                ContextMenu = contextMenu
            };

            //Enforce first tick as soon as possible
            tmr_tick(null, null);

            Application.Run();

            //Save settings when exiting
            Properties.Settings.Default.Save();

            ni.Visible = false;
        }
Esempio n. 60
0
 /// <summary>
 ///     The make timer.
 /// </summary>
 /// <param name="t">
 ///     The t.
 /// </param>
 /// <param name="cb">
 ///     The cb.
 /// </param>
 /// <param name="d">
 ///     The d.
 /// </param>
 /// <param name="p">
 ///     The p.
 /// </param>
 public void MakeTimer(ref Timer t, TimerCallback cb, int d, int p)
 {
     MakeTimer(ref t, cb, null, d, p);
 }