public void Recycle()
 {
     this.id        = 0;
     this.Selected  = false;
     this.BackColor = idleBackColor;
     StaticObjectPool.Push(this);
 }
        public static AutotrackerRuleItem Make(long id, string term, string project)
        {
            var item = StaticObjectPool.PopOrNew <AutotrackerRuleItem>();

            item.id               = id;
            item.termText.Text    = term;
            item.projectText.Text = project;

            return(item);
        }
        public static MessageBoxResult Show(Window owner, string messageText,
                                            string title        = "Toggl Desktop", MessageBoxButton buttons = MessageBoxButton.OK,
                                            string okButtonText = "OK")
        {
            var box = StaticObjectPool.PopOrDefault <MessageBox>()
                      ?? new MessageBox();

            var result = box.showDialog(owner, messageText, title, buttons, okButtonText);

            StaticObjectPool.Push(box);

            return(result);
        }
 public void Recycle()
 {
     this.id         = 0;
     this.IsSelected = false;
     StaticObjectPool.Push(this);
 }