private void SetupGrid()
        {
            var blank = new SoundEventTag(VocalizedEvent.CommonError, string.Empty);

            grid.Columns.Add(new FastColumn(blank.Property(p => p.EventName), Localizer.GetString("TitleEvent"))
            {
                ColumnMinWidth = 80,
                SortOrder      = FastColumnSort.Ascending
            });
            grid.Columns.Add(new FastColumn(blank.Property(p => p.FileName), Localizer.GetString("TitleFile"))
            {
                ColumnMinWidth         = 60,
                IsHyperlinkStyleColumn = true,
                HyperlinkFontActive    = new Font(Font, FontStyle.Bold),
                HyperlinkActiveCursor  = Cursors.Hand
            });
            grid.Columns.Add(new FastColumn(blank.Property(p => p.ImageIndex), Localizer.GetString("TitlePlay"))
            {
                ColumnWidth            = 40,
                ImageList              = imageList,
                IsHyperlinkStyleColumn = true,
                HyperlinkActiveCursor  = Cursors.Hand
            });
            grid.CalcSetTableMinWidth();
        }
        private void LoadSounds()
        {
            cbMute.Checked = UserSettings.Instance.Mute;

            var tags = new List <SoundEventTag>();

            foreach (var sets in UserSettings.Instance.VocalEvents)
            {
                var tag  = new SoundEventTag(sets.EventName, sets.FileName);
                var path = EventSoundPlayer.MakeSoundFilePath(sets.FileName);
                if (!File.Exists(path))
                {
                    tag.FileName = "";
                }
                tags.Add(tag);
            }
            grid.DataBind(tags);

            // заполнить выпадающее меню со звуками
            var emptyItem = menuSound.Items.Add(Localizer.GetString("TitleNoSoundSmall"));

            emptyItem.Tag    = false;
            emptyItem.Click += MenuItemClick;
            var soundDir = EventSoundPlayer.MakeSoundFilePath("");

            if (!Directory.Exists(soundDir))
            {
                return;
            }

            foreach (var file in Directory.GetFiles(soundDir))
            {
                var fileName = Path.GetFileName(file);
                var menuItem = menuSound.Items.Add(fileName);
                menuItem.Click += MenuItemClick;
            }
        }
        private void LoadSounds()
        {
            cbMute.Checked = UserSettings.Instance.Mute;

            var tags = new List<SoundEventTag>();
            foreach (var sets in UserSettings.Instance.VocalEvents)
            {
                var tag = new SoundEventTag(sets.EventName, sets.FileName);
                var path = EventSoundPlayer.MakeSoundFilePath(sets.FileName);
                if (!File.Exists(path)) tag.FileName = "";
                tags.Add(tag);
            }
            grid.DataBind(tags);

            // заполнить выпадающее меню со звуками
            var emptyItem = menuSound.Items.Add(Localizer.GetString("TitleNoSoundSmall"));
            emptyItem.Tag = false;
            emptyItem.Click += MenuItemClick;
            var soundDir = EventSoundPlayer.MakeSoundFilePath("");
            if (!Directory.Exists(soundDir)) return;

            foreach (var file in Directory.GetFiles(soundDir))
            {
                var fileName = Path.GetFileName(file);
                var menuItem = menuSound.Items.Add(fileName);
                menuItem.Click += MenuItemClick;
            }
        }
 private void SetupGrid()
 {
     var blank = new SoundEventTag(VocalizedEvent.CommonError, string.Empty);
     grid.Columns.Add(new FastColumn(blank.Property(p => p.EventName), Localizer.GetString("TitleEvent"))
         {
             ColumnMinWidth = 80,
             SortOrder = FastColumnSort.Ascending
         });
     grid.Columns.Add(new FastColumn(blank.Property(p => p.FileName), Localizer.GetString("TitleFile"))
         {
             ColumnMinWidth = 60,
             IsHyperlinkStyleColumn = true,
             HyperlinkFontActive = new Font(Font, FontStyle.Bold),
             HyperlinkActiveCursor = Cursors.Hand
         });
     grid.Columns.Add(new FastColumn(blank.Property(p => p.ImageIndex), Localizer.GetString("TitlePlay"))
         {
             ColumnWidth = 40,
             ImageList = imageList,
             IsHyperlinkStyleColumn = true,
             HyperlinkActiveCursor = Cursors.Hand
         });
     grid.CalcSetTableMinWidth();
 }