public void Save()
        {
            SavedCommandItems file = new SavedCommandItems()
            {
                Version = 2
            };
            List <SavedCommandItem> fileItems = new List <SavedCommandItem>();

            foreach (SavedCommandItem item in _items.OrderByDescending(c => c.LastSent).Take(50))
            {
                if (!item.FileName.IsValid())
                {
                    item.FileName = GetAvailableFileName();
                }

                fileItems.Add(item);

                if (item.IsNew)
                {
                    JsonFile.Write(item.FileName, item.SentCommand);
                }
            }

            file.Items = fileItems.ToArray();

            JsonFile.Write(_itemsFile, file);
        }
        public void Save()
        {
            SavedCommandItems file = new SavedCommandItems() { Version = 2 };
              List<SavedCommandItem> fileItems = new List<SavedCommandItem>();

              foreach( SavedCommandItem item in _items.OrderByDescending(c => c.LastSent).Take(50) ) {
            if( !item.FileName.IsValid() )
              item.FileName = GetAvailableFileName();

            fileItems.Add(item);

            if( item.IsNew )
              JsonFile.Write(item.FileName, item.SentCommand);
              }

              file.Items = fileItems.ToArray();

              JsonFile.Write(_itemsFile, file);
        }