Ejemplo n.º 1
0
 private void GetFilesInfo()
 {
     foreach (var i in file)
     {
         FileInfo x = new FileInfo(i);
         Reader   = new MP3Reader(i);
         Tag      = Reader.getTag();
         Tag.Name = x.Name;
         Tag.Size = x.Length.ToString("#,#");
         FirstList.Add(Tag);
     }
 }
Ejemplo n.º 2
0
        //private void Name_Object_Matcher(int FirstNumber, int SecondNumber)
        //{

        //    for (int i = FirstNumber; i < SecondNumber; i++)
        //    {
        //        for (int k = 0; k < file.Length; k++)
        //        {
        //            FileInfo x = new FileInfo(file[k]);
        //            if (FirstList[i].Name == x.Name)
        //            {
        //                Reader = new MP3Reader(file[k]);
        //                Reader.WriteCommentsOrder(SecondNumber - i);
        //                break;
        //            }
        //        }

        //    }
        //}

        private void WriteComment(int FirstNumber, int SecondNumber)
        {
            for (int i = FirstNumber; i < SecondNumber; i++)
            {
                //   FileInfo x = new FileInfo(Find_Path(FirstList[i]));


                Reader = new MP3Reader(Find_Path(FirstList[i]));
                // Console.WriteLine(Find_Path(FirstList[i]));
                Reader.WriteCommentsOrder(SecondNumber - i);
            }
            // Console.ReadLine();
        }
Ejemplo n.º 3
0
        private void Choice()
        {
            string FolderName = "";
            string path       = @"C:\Users\hp\Desktop\MuSic-SoRteR\MuSic SoRteR\Lab10\Sorted Music File\";

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Copy Range Of Files press 1 \n Another Sort press 2 \n  Copy All Files press 3\n");


            string choice = Console.ReadLine();

            while (true)
            {
                int value;

                if (!int.TryParse(FolderName, out value))
                {
                    break;
                }
                else
                {
                    Console.WriteLine("enter a number not letters :");
                    choice = Console.ReadLine();
                    continue;
                }
            }



            while (true)
            {
                if (choice == "1" || choice == "3")
                {
                    int value;
                    Console.Write("Pleas Enter Folder Name : ");
                    FolderName = Console.ReadLine();
                    if (int.TryParse(FolderName, out value))
                    {
                        Console.WriteLine("please enter a name not a number");
                        continue;
                    }
                    if (FolderExist(path, FolderName) == true)
                    {
                        Console.WriteLine("The Folder Name Is Exist Please Enter Another One. ");
                        continue;
                    }
                }



                if (choice == "1")
                {
                    Console.Write("Start Number Of Range : ");
                    string FirstNumber  = Console.ReadLine();
                    int    FirstConvert = Convert.ToInt32(FirstNumber);

                    Console.Write("End Number Of Number : ");
                    string SecondNumber = Console.ReadLine();

                    int SecondConvert = Convert.ToInt32(SecondNumber);

                    if ((FirstConvert < 0) || (SecondConvert < 0) || (FirstConvert > FirstList.Count) || (SecondConvert > FirstList.Count) || (FirstConvert == SecondConvert))
                    {
                        Console.WriteLine("Wrong Values >>> Please Enter Correct Numbers");
                        continue;
                    }



                    show(FirstConvert, SecondConvert + 1);
                    WriteComment(FirstConvert, SecondConvert + 1);
                    CopyFunc(FirstConvert, SecondConvert + 1, path, FolderName);

                    break;
                }
                else if (choice == "2")
                {
                    break;
                }
                else if (choice == "3")
                {
                    WriteComment(0, FirstList.Count);
                    //  Name_Object_Matcher(0, FirstList.Count);
                    CopyFunc(0, FirstList.Count, path, FolderName);
                    break;
                }
                else if (choice != "1" && choice != "2" && choice != "3")
                {
                    Console.WriteLine("Please Enter Correct Number .");
                    choice = Console.ReadLine();
                    continue;
                }
            }

            foreach (var i in file)
            {
                Reader = new MP3Reader(i);
                Reader.RemoveComment();
            }
            //  file = Directory.GetFiles(@"E:\Projects\MuSic SoRteR\Lab10\Sorted");
        }