Ejemplo n.º 1
0
        private void about_Load(object sender, EventArgs e)
        {
            label1.Text = @"这是一个开源项目\n
项目地址:https://github.com/DuyunLi/ZX.Data.Mod \n
当前程序版本:" + resourcesHelper.GetSystem("about.version")
                          + "\n特别感谢zhyzcl贡献在git的zx工具代码促成了这个项目";
            label2.Text = resourcesHelper.GetSystem("about.desc");
        }
Ejemplo n.º 2
0
        public void RefreshPackage()
        {
            saveFlag = true;
            if (packageHelper.packageFile == null)
            {
                MessageBox.Show("load package fail!");
                saveFlag = false;
                return;
            }
            if (packageHelper.packageFile.items == null)
            {
                saveFlag = false;
                return;
            }
            view.Items.Clear();
            IEnumerable <PackageItem> items = packageHelper.packageFile.items;

            if (!allToolStripMenuItem.Checked)
            {
                if (activeToolStripMenuItem.Checked)
                {
                    items = items.Where(s => s.active);
                }
                else
                {
                    items = items.Where(s => !s.active);
                }
            }
            if (!allToolStripMenuItem1.Checked)
            {
                if (localToolStripMenuItem.Checked)
                {
                    items = items.Where(s => s.type == PackageType.local);
                }
                else
                {
                    items = items.Where(s => s.type != PackageType.local);
                }
            }
            foreach (var item in items)
            {
                var li = new ListViewItem(item.name);
                li.SubItems.Add(item.version?.ToString());
                var sub = li.SubItems.Add(resourcesHelper.GetSystem($"main.view.active.{item.type}"));
                sub.Tag      = item.type;
                li.Checked   = item.active;
                li.ForeColor = li.Checked ? Color.Black : Color.FromArgb(0, 88, 88, 88);
                view.Items.Add(li);
            }
            saveFlag = false;
        }
Ejemplo n.º 3
0
 public MainView(ResourcesHelper resourcesHelper, PackageHelper packageHelper, LogHelper logHelper)
 {
     InitializeComponent();
     this.packageHelper = packageHelper;
     this.Text          = resourcesHelper.GetSystem("main.name");
     this.fileToolStripMenuItem.Text           = resourcesHelper.GetSystem("main.menu.open");
     this.refreshToolStripMenuItem.Text        = resourcesHelper.GetSystem("main.menu.refresh");
     this.aboutToolStripMenuItem.Text          = resourcesHelper.GetSystem("main.menu.about");
     this.openFileToolStripMenuItem.Text       = resourcesHelper.GetSystem("main.menu.open.file");
     this.openFolderToolStripMenuItem.Text     = resourcesHelper.GetSystem("main.menu.open.folder");
     this.searchToolStripMenuItem.Text         = resourcesHelper.GetSystem("main.menu.open.internet");
     this.openFileToolStripMenuItem1.Text      = resourcesHelper.GetSystem("main.menu.open.file");
     this.openFlolerToolStripMenuItem.Text     = resourcesHelper.GetSystem("main.menu.open.folder");
     this.searchInternetToolStripMenuItem.Text = resourcesHelper.GetSystem("main.menu.open.internet");
     this.upItemToolStripMenuItem.Text         = resourcesHelper.GetSystem("main.menu.up");
     this.downItemToolStripMenuItem.Text       = resourcesHelper.GetSystem("main.menu.down");
     this.updateItemToolStripMenuItem.Text     = resourcesHelper.GetSystem("main.menu.update");
     this.refreshListToolStripMenuItem.Text    = resourcesHelper.GetSystem("main.menu.refreshList");
     this.allToolStripMenuItem.Text            = resourcesHelper.GetSystem("main.menu.all");
     this.activeToolStripMenuItem.Text         = resourcesHelper.GetSystem("main.menu.active");
     this.inactiveToolStripMenuItem.Text       = resourcesHelper.GetSystem("main.menu.inactive");
     this.allToolStripMenuItem1.Text           = resourcesHelper.GetSystem("main.menu.all");
     this.localToolStripMenuItem.Text          = resourcesHelper.GetSystem("main.view.active.local");
     this.internetToolStripMenuItem.Text       = resourcesHelper.GetSystem("main.view.active.internet");
     this.filterToolStripMenuItem.Text         = resourcesHelper.GetSystem("main.menu.filter");
     this.buildToolStripMenuItem.Text          = resourcesHelper.GetSystem("main.menu.build");
     this.buildToolStripMenuItem1.Text         = resourcesHelper.GetSystem("main.menu.build");
     this.resourcesHelper = resourcesHelper;
     this.logHelper       = logHelper;
     RefreshPackage();
 }