Exemplo n.º 1
0
 public TimeArea()
 {
     m_Settings = new DirectorControlSettings();
     float[] tickModulos = new float[]
     {
         0.0005f,
         0.001f,
         0.005f,
         0.01f,
         0.05f,
         0.1f,
         0.5f,
         1f,
         5f,
         10f,
         50f,
         100f,
         500f,
         1000f,
         5000f,
         10000f
     };
     hTicks = new TickHandler();
     hTicks.SetTickModulos(tickModulos);
 }
Exemplo n.º 2
0
 public Schedule(SyncTaskImpl task, ZPushAccount account, TickHandler scheduleTick, TimeSpan period)
 {
     this.Task    = task;
     this.Account = account;
     this._tick   = scheduleTick;
     this._period = period;
 }
Exemplo n.º 3
0
 public EmployeeClass(int id, string name, DateTime dob, TickHandler action)
 {
     this.id =id;
     this.Name = name;
     this.dob = dob;
     tick = action;
 }
Exemplo n.º 4
0
        public ProfilerTimelineGUI(IProfilerWindowController window)
        {
            m_Window = window;
            // Configure default groups
            groups = new List <GroupInfo>(new GroupInfo[]
            {
                new GroupInfo()
                {
                    name = "", height = 0, expanded = true, threads = new List <ThreadInfo>()
                },
                new GroupInfo()
                {
                    name = "Unity Job System", height = kGroupHeight, expanded = SessionState.GetBool("Unity Job System", false), threads = new List <ThreadInfo>()
                },
                new GroupInfo()
                {
                    name = "Loading", height = kGroupHeight, expanded = SessionState.GetBool("Loading", false), threads = new List <ThreadInfo>()
                },
            });

            m_LocalizedString_Total     = LocalizationDatabase.GetLocalizedString("Total");
            m_LocalizedString_Instances = LocalizationDatabase.GetLocalizedString("Instances");

            m_HTicks = new TickHandler();
            m_HTicks.SetTickModulos(k_TickModulos);
        }
Exemplo n.º 5
0
 public ProfilerTimelineGUI(IProfilerWindowController window)
 {
     this.m_Window = window;
     this.groups   = new List <ProfilerTimelineGUI.GroupInfo>(new ProfilerTimelineGUI.GroupInfo[]
     {
         new ProfilerTimelineGUI.GroupInfo
         {
             name     = "",
             height   = 0f,
             expanded = true,
             threads  = new List <ProfilerTimelineGUI.ThreadInfo>()
         },
         new ProfilerTimelineGUI.GroupInfo
         {
             name     = "Unity Job System",
             height   = 20f,
             expanded = SessionState.GetBool("Unity Job System", false),
             threads  = new List <ProfilerTimelineGUI.ThreadInfo>()
         },
         new ProfilerTimelineGUI.GroupInfo
         {
             name     = "Loading",
             height   = 20f,
             expanded = SessionState.GetBool("Loading", false),
             threads  = new List <ProfilerTimelineGUI.ThreadInfo>()
         }
     });
     this.m_LocalizedString_Total     = LocalizationDatabase.GetLocalizedString("Total");
     this.m_LocalizedString_Instances = LocalizationDatabase.GetLocalizedString("Instances");
     this.m_HTicks = new TickHandler();
     this.m_HTicks.SetTickModulos(ProfilerTimelineGUI.k_TickModulos);
 }
Exemplo n.º 6
0
 public Clock()
 {
     this.hour   = 0;
     this.minute = 0;
     this.second = 0;
     OnTick     += new TickHandler(timeReporter);
     OnAlarm    += Ring;
 }
Exemplo n.º 7
0
 public Clock(int hour, int minute, int second)
 {
     this.hour   = hour;
     this.minute = minute;
     this.second = second;
     OnTick     += new TickHandler(timeReporter);
     OnAlarm    += Ring;
 }
 public BaseActorState(Node2D node)
 {
     this.node        = node;
     tickHandler      = new TickHandler();
     statusHandler    = new StatusHandler(node as ISufferStatusEffects);
     elevationHandler = new ElevationHandler(node as IElevatable, (node as IHaveRuntime).runtime);
     (node as BaseActorNode).state = this;
 }
Exemplo n.º 9
0
        private void OnTick(object sender, TickEventArgs e)
        {
            TickHandler handler = this.Tick;

            if (null != handler)
            {
                handler(sender, e);
            }
        }
Exemplo n.º 10
0
 //-------------------------------------------------
 #region Constructor's Region
 public Worker(TickHandler <Trigger> _tick, uint _index = 0)
 {
     _trigger = new Trigger(true)
     {
         Index = _index,
     };
     _trigger.Tick -= _tick;
     _trigger.Tick += _tick;
 }
 public IsMouseActiveHooker()
 {
     this.mouseMoveTimer = new System.Timers.Timer();
     this.mouseMoveTimer.Elapsed += new System.Timers.ElapsedEventHandler(mouseMoveTimer_Elapsed);
     this.mouseMoveTimer.Interval = 5000;
     this.mouseMoveTimer.AutoReset = false;
     _mouseHookID = SetMouseHook(_proc);
     _kbHookID = SetKBHook(_proc);
     Tick += new TickHandler(IsMouseActiveHooker_Tick);
 }
Exemplo n.º 12
0
 public IsMouseActiveHooker()
 {
     this.mouseMoveTimer           = new System.Timers.Timer();
     this.mouseMoveTimer.Elapsed  += new System.Timers.ElapsedEventHandler(mouseMoveTimer_Elapsed);
     this.mouseMoveTimer.Interval  = 5000;
     this.mouseMoveTimer.AutoReset = false;
     _mouseHookID = SetMouseHook(_proc);
     _kbHookID    = SetKBHook(_proc);
     Tick        += new TickHandler(IsMouseActiveHooker_Tick);
 }
Exemplo n.º 13
0
        public TickThread(Server server, TickHandler tickHandler, int period = 1000)
        {
            m_server = server;
            //m_eventExit = new AutoResetEvent(false);
            m_eventCompletion = new AutoResetEvent(false);

            m_delegateTickHandler += tickHandler;
            m_nPeriod              = period;

            m_thread = new Thread(Run);
            m_thread.Start();
        }
Exemplo n.º 14
0
        public void DelayCallback(int id, float delay, LuaFunction luaFunc, bool ignoreTimeScale = false)
        {
            TickHandler handler = Pop();

            handler.id              = id;
            handler.luaFunc         = luaFunc;
            handler.startTime       = getCurrentTime(ignoreTimeScale);
            handler.delay           = delay;
            handler.delete          = false;
            handler.ignoreTimeScale = ignoreTimeScale;
            luaHandlerList.Add(handler);
        }
Exemplo n.º 15
0
        public MenuManager()
        {
            TickHandler.Attach <MenuManager>(this.Render);

            Client.Instance.OnCharacterLoaded += (sender, args) =>
            {
                this.CharacterMenu.WalkingStyleMenu.Index = this.CharacterMenu.WalkingStyles.FindIndex(s => s.Value == Client.Instance.User?.Character?.WalkingStyle);
            };

            this.Pool.Add(this.CharacterMenu);
            this.Pool.RefreshIndex();
        }
Exemplo n.º 16
0
        private void Form1_Load(object sender, EventArgs e)
        {
            screen = new Rectangle(0, 0, this.Width, this.Height);

            polygons.Add(Polygons.Cube(1, new Vector(0, 0, 5)));
            polygons.Add(Polygons.Cube(5, new Vector(5, 0, 5)));


            Cursor.Position = new Point(500, 500);
            FrameTick.Start();
            WorldTickHandler = new TickHandler(WorldTick);
        }
Exemplo n.º 17
0
        /// <summary>
        /// Starts the thread in asynchronous mode from the background worker.
        /// </summary>
        /// <param name="sender">Object calling this function</param>
        /// <param name="e">Parameters that are needed (if any) for this function</param>
        /// <remarks>From the parent caller you may start also your own asynchronous call.
        /// Refer to the Start() function.
        /// </remarks>
        public void StartAsync(object sender, EventArgs e)
        {
            //Lets the softwawre know the stream is on.
            StreamStatus = true;

            //Create the event handler
            m_Handler += new TickHandler(CollectFunction);

            //Call the handler, this will be a loop but we
            // do not care because the startasync() is already
            // in a background worker thread.
            m_Handler(this, e);
        }
Exemplo n.º 18
0
 public void Start()
 {
     while (true)
     {
         System.Threading.Thread.Sleep(3000);
         TickHandler ticker = Tick;
         if (ticker != null)
         {
             TickArgs t = new TickArgs();
             t.Time = DateTime.Now;
             ticker(this, t);
         }
     }
 }
Exemplo n.º 19
0
        public void Init(Timeline timeline, PanManipulator panManipulator, ZoomManipulator zoomManipulator)
        {
            m_TimelineWidget = new TimelineWidget();

            m_PanManipulator  = panManipulator;
            m_ZoomManipulator = zoomManipulator;
            m_TimeArea        = timeline.m_TimelineScrollableArea;

            m_IMGUIContainer = new IMGUIContainer(() =>
            {
                GUILayout.Space(0);
                var lastRect = GUILayoutUtility.GetLastRect();
                Rect rt      = GUILayoutUtility.GetRect(lastRect.width, 22);

                GUI.BeginGroup(rt);

                Rect rect = new Rect(0, 0, rt.width, rt.height);

                if (rect.width > 0 && rect.height > 0)
                {
                    if (!FloatComparer.s_ComparerWithDefaultTolerance.Equals(m_DrawInfo.layout.startTime, m_TimelineWidget.RangeStart) ||
                        !FloatComparer.s_ComparerWithDefaultTolerance.Equals(m_DrawInfo.layout.Duration, m_TimelineWidget.RangeWidth))
                    {
                        m_DrawInfo.layout.startTime = m_TimelineWidget.RangeStart;
                        m_DrawInfo.layout.endTime   = m_TimelineWidget.RangeEnd;
                    }
                    else
                    {
                        DrawRuler(m_IMGUIContainer.layout, m_SampleRate, timeline.TimelineUnits);
                    }

                    ForwardEvents(rect);
                }

                GUI.EndGroup();
            });

            Add(m_IMGUIContainer);

            m_TickHandler = new TickHandler();
            float[] modulos =
            {
                0.0000001f, 0.0000005f, 0.000001f, 0.000005f, 0.00001f, 0.00005f, 0.0001f, 0.0005f,
                0.001f,         0.005f,     0.01f,     0.05f,     0.1f,     0.5f,       1,       5,10, 50, 100, 500,
                1000,             5000,     10000,     50000,   100000,   500000, 1000000, 5000000, 10000000
            };
            m_TickHandler.SetTickModulos(modulos);
        }
Exemplo n.º 20
0
 public void Start()
 {
     while (true)
     {
         System.Threading.Thread.Sleep(3000);
         // Thread safety introduced
         TickHandler ticker = Tick;
         if (ticker != null)
         {
             // Object initialiser added
             TickArgs t = new TickArgs {
                 Time = DateTime.Now;
             }
             ticker(this, t);
         }
     }
 }
Exemplo n.º 21
0
        public SlideShow()
        {
            fEnumerator.IncludeExtensions = sIncludeExtensions;

            BeginInit();

            fFormerPanel       = new TextPanel();
            fActivePanel       = new TextPanel();
            fNextPanel         = new TextPanel();
            fNextPanel.Opacity = 0;
            Children.Add(fFormerPanel);
            Children.Add(fActivePanel);
            Children.Add(fNextPanel);

            fTickHandler = new TickHandler(Tick);
            fTimer       = new System.Threading.Timer(RawTick, null, 500, 500);

            EndInit();
        }
Exemplo n.º 22
0
        public static void SetupCredits()
        {
            Engine.SetLocation(new Location(new Description2D(0, 0, ScreenWidth, ScreenHeight)));

            int         time = Program.ScreenHeight / 2 + 8;
            TickHandler t    = null;

            CreditsFinished = false;

            t = (s, o) =>
            {
                if (time-- <= 0)
                {
                    Engine.TickEnd -= t;
                    CreditsFinished = true;
                }
            };

            Engine.TickEnd += t;

            Action <Location, Entity> scroll = (loc, ent) =>
            {
                Description2D entd = ent.Description as Description2D;

                if (time > 0)
                {
                    entd.ChangeCoordsDelta(0, -1);
                }
            };

            int y = Program.ScreenHeight / 2;

            Engine.AddEntity(Text.Create("Credits", new Font("Arial", 32, FontStyle.Underline), ScreenWidth / 2, y + 16).AddTickAction(scroll));

            Engine.AddEntity(Text.Create("Developed by", new Font("Arial", 16, FontStyle.Underline), ScreenWidth / 2, y + 64).AddTickAction(scroll));
            Engine.AddEntity(Text.Create("Nicholas Denaro", new Font("Arial", 12), ScreenWidth / 2, y + 96).AddTickAction(scroll));

            Engine.AddEntity(Text.Create("Art by", new Font("Arial", 16, FontStyle.Underline), ScreenWidth / 2, y + 128).AddTickAction(scroll));
            Engine.AddEntity(Text.Create("System.Drawing.Common", new Font("Arial", 12), ScreenWidth / 2, y + 160).AddTickAction(scroll));

            Engine.AddEntity(Text.Create("Special thanks to", new Font("Arial", 16, FontStyle.Underline), ScreenWidth / 2, y + 192).AddTickAction(scroll));
            Engine.AddEntity(Text.Create("My faithful Twitch chat <3", new Font("Arial", 10), ScreenWidth / 2, y + 224).AddTickAction(scroll));
        }
Exemplo n.º 23
0
        private void PlayerInit()
        {
            MultimediaFactory factory;
            Widget            playerWidget;

            factory = new MultimediaFactory();
            player  = factory.getPlayer(320, 280);

            tickHandler         = new TickHandler(OnTick);
            player.Tick        += tickHandler;
            player.StateChange += new StateChangeHandler(OnStateChanged);
            player.Eos         += new EventHandler(OnEndOfStream);
            player.Error       += new ErrorHandler(OnError);
            player.ReadyToSeek += new EventHandler(OnReadyToSeek);

            playerWidget = (Widget)player;
            playerWidget.ButtonPressEvent += OnVideoboxButtonPressEvent;
            playerWidget.ScrollEvent      += OnVideoboxScrollEvent;
            playerWidget.Show();
            videobox.Add(playerWidget);
        }
Exemplo n.º 24
0
        private void PlayerInit()
        {
            MultimediaFactory factory;
            Widget playerWidget;

            factory= new MultimediaFactory();
            player = factory.getPlayer(320,280);

            tickHandler = new TickHandler(OnTick);
            player.Tick += tickHandler;
            player.StateChange += new StateChangeHandler(OnStateChanged);
            player.Eos += new EventHandler (OnEndOfStream);
            player.Error += new ErrorHandler (OnError);
            player.ReadyToSeek += new EventHandler(OnReadyToSeek);

            playerWidget = (Widget)player;
            playerWidget.ButtonPressEvent += OnVideoboxButtonPressEvent;
            playerWidget.ScrollEvent += OnVideoboxScrollEvent;
            playerWidget.Show();
            videobox.Add(playerWidget);
        }
Exemplo n.º 25
0
 /// <summary>
 /// Convienance function to add an ITickable object into the tick
 /// manager.
 /// </summary>
 public void Add(ITickable tickable)
 {
     TickEvent += new TickHandler(tickable.OnTick);
 }
 protected sealed override void RemoveTickHandler(TickHandler handler)
 {
     Game.TickPlayerInputManagers -= handler;
 }
 protected sealed override void AddTickHandler(TickHandler handler)
 {
     Game.TickPlayerInputManagers += handler;
 }
Exemplo n.º 28
0
 public static void RemoveListener(TickHandler callback)
 {
     Instance.Tick -= callback;
 }
Exemplo n.º 29
0
 public static void AddListener(TickHandler callback)
 {
     Instance.Tick += callback;
 }
Exemplo n.º 30
0
 /// <summary>
 /// 【线程安全】增加定时回调方法
 /// </summary>
 /// <param name="intervalMS"></param>
 /// <param name="handler"></param>
 public TimeTaskMS AddTimePeriodicMS(int intervalMS, TickHandler handler)
 {
     return(timer_tasks.AddTimePeriodicMS(intervalMS, handler));
 }
Exemplo n.º 31
0
 /// <summary>
 /// 【线程安全】增加延时回调方法
 /// </summary>
 /// <param name="delayMS"></param>
 /// <param name="handler"></param>
 public TimeTaskMS AddTimeDelayMS(int delayMS, TickHandler handler)
 {
     return(timer_tasks.AddTimeDelayMS(delayMS, handler));
 }
Exemplo n.º 32
0
 /// <summary>
 /// 【线程安全】增加时间任务
 /// </summary>
 /// <param name="intervalMS"></param>
 /// <param name="delayMS"></param>
 /// <param name="repeat"></param>
 /// <param name="handler"></param>
 public TimeTaskMS AddTimeTask(int intervalMS, int delayMS, int repeat, TickHandler handler)
 {
     return(timer_tasks.AddTimeTask(intervalMS, delayMS, repeat, handler));
 }
Exemplo n.º 33
0
 public void SubscribeToTickHandler(TickHandler tickHandler)
 {
     tickHandler += new TickHandler(Tick);
 }