Esempio n. 1
0
    private void buttonRescanCache_Click(object sender, EventArgs e)
    {
        ModCache.RescanModCacheFolder();

        olvModList.Refresh();
        RefreshTreeView();
        RefreshListView();
    }
Esempio n. 2
0
    private void Form1_Shown(object sender, EventArgs e)
    {
        ModCache.RescanModCacheFolder();
        RefreshListView();

        GetSelectedMod();
        olvModList.Focus();
    }
Esempio n. 3
0
    private void Form1_Shown(object sender, EventArgs e)
    {
        ModCache.RescanModCacheFolder();
        RefreshListView();

        GetSelectedMod();
        olvModList.Focus();
        Language Language = new Language();

        if (!this.DesignMode)
        {
            Language.InitLanguage(this);
        }
    }
Esempio n. 4
0
    private void olvModList_DragDrop(object sender, DragEventArgs e)
    {
        string modCacheFolder = Serializer.GetModsCacheFolder();

        Directory.CreateDirectory(modCacheFolder);

        var files = e.Data.GetData(DataFormats.FileDrop) as string[];

        if (files.Length == 0)
        {
            return;
        }

        string[] modFiles  = Directory.GetFiles(modCacheFolder, "*", SearchOption.AllDirectories);
        string   lastAdded = null;


        foreach (string file in files)
        {
            bool   isDir    = Directory.Exists(file);
            string fileName = Path.GetFileName(file);

            if (isDir)
            {
                FileSystem.MoveDirectory(file, modCacheFolder + fileName, UIOption.OnlyErrorDialogs, UICancelOption.DoNothing);
            }
            else
            {
                if (!modFiles.Contains(file) && !File.Exists(modCacheFolder + fileName) && File.Exists(file))
                {
                    File.Move(file, modCacheFolder + fileName);
                }
                lastAdded = modCacheFolder + fileName;
            }
        }

        ModCache.RescanModCacheFolder();

        if (lastAdded != null)
        {
            olvModList.SelectedObject = modsData.modInfos.FindLast(x => x.modPath.ToLower() == lastAdded.ToLower());
            olvModList.EnsureModelVisible(olvModList.SelectedObject);
        }
    }