Exemplo n.º 1
0
        public static void DelayRaise(this INotifyPropertyChanged obj, string propertyName, int milliseconds, Func <PropertyChangedEventHandler> funcGetHandler)
        {
            var timer = new OneTimeTimer(milliseconds);

            timer.Start(() =>
            {
                var propertyChangedDelegate = funcGetHandler();

                if (propertyChangedDelegate != null)
                {
                    propertyChangedDelegate(obj, new PropertyChangedEventArgs(propertyName));
                }
            });
        }
Exemplo n.º 2
0
        public static void Run(Action action, int timeSpan)
        {
            var timer = new OneTimeTimer(timeSpan);

            timer.Start(action);
        }