예제 #1
0
        static void Main(string[] args)
        {
            //args = "-parse -path /Users/mask/Downloads/playlists/parse/".Split(' ');
            //args = "-check".Split(' ');
            args = "-export -path /Users/mask/Downloads/playlists/out_playlist.m3u".Split(' ');

            if (args == null || args.Length == 0)
            {
                return;
            }

            // get app mode
            AppMode mode = null;

            if (args.Contains("-parse"))
            {
                mode = new ParserMode(args);
            }
            else if (args.Contains("-groups"))
            {
                mode = new GroupsMode(args);
            }
            else if (args.Contains("-check"))
            {
                mode = new CheckMode(args);
            }
            else if (args.Contains("-export"))
            {
                mode = new ExportMode(args);
            }

            mode?.Run();
        }
예제 #2
0
파일: groups.cs 프로젝트: wateras/winforms
    void UpdateView(View view)
    {
        if (view == View.Details)
        {
            if (columns == null)
            {
                columns = new ColumnHeader [] {
                    new ColumnHeader("Title"),
                    new ColumnHeader("Author")
                }
            }
            ;

            lv.Columns.AddRange(columns);
            lv.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
        }
        else
        {
            lv.Columns.Clear();
        }

        lv.View = view;
    }

    void ColumnClicked(object o, ColumnClickEventArgs args)
    {
        if (args.Column == 0)
        {
            groups_mode = GroupsMode.Title;
        }
        else
        {
            groups_mode = GroupsMode.Author;
        }

        ascendent = !ascendent;

        SetGroups();
    }

    void ViewCBSelectedIndexChanged(object o, EventArgs args)
    {
        UpdateView((View)view_cb.SelectedItem);
    }

    void SortingCBSelectedIndexChanged(object o, EventArgs args)
    {
        lv.Sorting = (SortOrder)sorting_cb.SelectedItem;
    }

    void LoadListViewImages()
    {
        if (!Directory.Exists(ImagesPath))
        {
            Console.WriteLine("Images path " + ImagesPath + " does not exist.");
            return;
        }

        foreach (string image_file in Images)
        {
            if (File.Exists(ImagesPath + image_file))
            {
                Image img = Image.FromFile(ImagesPath + image_file);
                lv.SmallImageList.Images.Add(img);
                lv.LargeImageList.Images.Add(img);
            }
        }
    }
}