示例#1
0
        private void addArchiveException(object sender, ROMScanner.ExceptionEventArgs args)
        {
            var     row  = new ROMScanner.HaveRowEventArgs();
            ROMInfo info = new ROMInfo();

            row.info = info;

            try {
                info.addInfo("Filename", args.path.Name);
            } catch (Exception ex) {
                info.addInfo("Filename", "Exception: " + ex.ToString());
            }
            try {
                info.addInfo("Folder", args.path.DirectoryName);
            } catch (Exception ex) {
                //F**k you .NET these methods should not throw exceptions at all, let alone because a path dares to be longer than
                //260 characters. No seriously f**k you, that's f*****g stupid, f**k you and your stupid f*****g asinine operating
                //system and its f*****g idiotic limitations. F**k off I am not going to make all my users upgrade to Windows 10 and
                //tweak some group policy just so they can do things. F**k you, things clearly work with a f*****g network drive that
                //has paths that long so clearly Windows works with that shit anyway and you just f****d everything up because you're
                //a f*****g incompetent fuckload of assclowns and I hate you
                info.addInfo("Folder", "Exception: " + ex.ToString());
            }
            info.addInfo("Exception", args.ex);

            addRow(this, row);
        }
示例#2
0
        private void addRow(object sender, ROMScanner.HaveRowEventArgs args)
        {
            if (table.InvokeRequired)
            {
                table.Invoke(new Action <object, ROMScanner.HaveRowEventArgs>(addRow), sender, args);
                return;
            }

            int newRow = table.Rows.Add();
            var info   = args.info.info;           //Sorry for this line

            foreach (var kv in info)
            {
                if (bool.TryParse(SettingsManager.readSetting("show_extra"), out bool result))
                {
                    if (kv.Value.extra && !result)
                    {
                        continue;
                    }
                }
                else
                {
                    continue;
                }


                object value = kv.Value.value;

                if (!table.Columns.Contains(kv.Key))
                {
                    int index = table.Columns.Add(kv.Key, kv.Key);
                    table.Columns[index].FillWeight = 1;
                }

                if (value is System.Drawing.Image image && !MainProgram.isMono)
                {
                    //FIXME: Mono doesn't like displaying images, it offsets all cells after that by one cell to the right, and I have no idea why
                    var cell = new DataGridViewImageCell();
                    table[kv.Key, newRow] = cell;
                    cell.ReadOnly         = true;
                    cell.Value            = image;
                }