Ejemplo n.º 1
0
        private void Init()
        {
            CheckUpdate.Auto();
            HiyobiTags.LoadTags();
            this.MinWidth     = 300;
            Global.MainWindow = this;
            string[] args     = Environment.GetCommandLineArgs();
            bool     relative = false;

            for (int i = 0; i < args.Length; i++)
            {
                string arg = args[i];
                if (arg == "/p" && args.Length - 1 > i)
                {
                    if (relative)
                    {
                        path = Path.Combine(rootDir, args[i + 1]);
                    }
                    else
                    {
                        path = args[i + 1];
                    }
                }
                if (arg == "/r")
                {
                    relative = true;
                }
            }
            if (path == string.Empty)
            {
                path = Path.Combine(rootDir, "hitomi_downloaded");
            }
            else
            {
                if (relative)
                {
                    path = Path.Combine(rootDir, path);
                }
            }
            if (!Directory.Exists(path))
            {
                Console.WriteLine("Invaild Path");
                path = Path.Combine(rootDir, "hitomi_downloaded");
            }
            SearchMode1.SelectedIndex = 0;
            SetFolderSort(FolderSorts.Name);
            if (Global.Password == null)
            {
                Encrypt.Visibility = Visibility.Collapsed;
                Decrypt.Visibility = Visibility.Collapsed;
            }
        }