Esempio n. 1
0
 /**
  * deep copy for the normal copy constructor doesn't co-work with json serializer
  */
 public void CopyTo(ref VisualNovel vn)
 {
     vn.VNName       = VNName;
     vn.Language     = Language;
     vn.ProcEncoding = ProcEncoding;
     vn.ModuleName   = ModuleName;
     vn.Hookers      = new List <Hooker>(Hookers.ToArray());
     vn.WordsFilter  = new List <string>(WordsFilter.ToArray());
 }
Esempio n. 2
0
        private void Down_Click(object sender, EventArgs e)
        {
            int i = VNTable.SelectedRows[0].Index;

            VisualNovel temp = bVNList[i + 1];

            bVNList[i + 1] = bVNList[i];
            bVNList[i]     = temp;

            VNTable.Rows[i + 1].Selected = true;
        }
Esempio n. 3
0
        private void VNTable_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 1)
            {
                VisualNovel vn = new VisualNovel();
                VNList[e.RowIndex].CopyTo(ref vn);

                VNSettingsForm VNSet = new VNSettingsForm(vn);

                DialogResult res = VNSet.ShowDialog();
                if (res == DialogResult.OK)
                {
                    VNList[e.RowIndex] = vn;
                    VNTable.Refresh();
                }
            }
        }
Esempio n. 4
0
        public static void StartExtText(VisualNovel vn)
        {
            Program.vn = vn;

            pHookers = Marshal.AllocHGlobal(Marshal.SizeOf(vn.Hookers[0]) * vn.Hookers.Count);

            for (int i = 0; i < vn.Hookers.Count; i++)
            {
                Marshal.StructureToPtr(vn.Hookers[i], pHookers + Marshal.SizeOf(vn.Hookers[0]) * i, false);
            }

            int Mtid = GetCurrentThreadId();

            pExtBuffer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(byte)) * EXT_BYTES_MAX_SIZE);
            for (int i = 0; i < EXT_BYTES_MAX_SIZE; i++)
            {
                Marshal.WriteByte(pExtBuffer, i, 0);
            }

            pStopExtText = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(bool)));
            Marshal.WriteByte(pStopExtText, 0);

            ExtTextThread = new Thread(() =>
                                       ExtText(
                                           vn.ModuleName,
                                           pHookers,
                                           vn.Hookers.Count,
                                           Mtid,
                                           pExtBuffer,
                                           EXT_BYTES_MAX_SIZE,
                                           pStopExtText
                                           ));
            ExtTextThread.IsBackground = true;
            ExtTextThread.Start();

            form1 = new Form1();
            form1.Show();
            form1.StatusLabel.Text = "正在等待程序开启...";
        }
Esempio n. 5
0
 public VNSettingsForm(VisualNovel vn)
 {
     InitializeComponent();
     this.vn = vn;
 }