xtd 0.2.0
animation_update_event_args.hpp
Go to the documentation of this file.
1
4#pragma once
5#include <xtd/event_args>
6#include <xtd/time_span>
7
9namespace xtd {
11 namespace forms {
22 class animation_updated_event_args : public event_args {
23 public:
25
27 animation_updated_event_args(int32 frame_counter, int64 elapsed_nanoseconds) : frame_counter_(frame_counter), elapsed_nanoseconds_(elapsed_nanoseconds) {}
29
31
35 time_span elapsed() const {return time_span {std::chrono::duration_cast<xtd::ticks>(std::chrono::nanoseconds {elapsed_nanoseconds_}).count()};}
38 int64 elapsed_milliseconds() const {return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::nanoseconds {elapsed_nanoseconds_}).count();}
41 int64 elapsed_nanoseconds() const {return elapsed_nanoseconds_;}
42
45 int32 frame_counter() const {return frame_counter_;}
47
48 private:
49 int32 frame_counter_ = 0;
50 int64 elapsed_nanoseconds_ {0};
51 };
52 }
53}
event_args()=default
Initializes a new instance of the event_args class.
int64 elapsed_nanoseconds() const
Gets elepased time in nanoseconds.
Definition animation_update_event_args.hpp:41
int64 elapsed_milliseconds() const
Gets elepased time in milliseconds.
Definition animation_update_event_args.hpp:38
int32 frame_counter() const
Gets frame counter.
Definition animation_update_event_args.hpp:45
time_span elapsed() const
Gets elepased time in nanoseconds.
Definition animation_update_event_args.hpp:35
Represents a time interval.
Definition time_span.hpp:29
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
int64_t int64
Represents a 64-bit signed integer.
Definition int64.hpp:23
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8