Example #1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ofd.Title  = "Open";
            ofd.Filter = "UCS Locate File|*.ucs";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                if (pendingChanges != null && pendingChanges.Count > 0)
                {
                    saveToolStripMenuItem_Click(null, null);
                }

                ucs = new UCSFile(ofd.FileName);
                if (ucs.Process())
                {
                    lsvLocateInfo.Items.Clear();

                    saveToolStripMenuItem.Enabled       = true;
                    saveAsToolStripMenuItem.Enabled     = true;
                    addNewLineToolStripMenuItem.Enabled = true;

                    foreach (var kpl in ucs.UCSData)
                    {
                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = kpl.Key;
                        lvi.SubItems.Add(kpl.Value);
                        lsvLocateInfo.Items.Add(lvi);
                    }

                    pendingChanges = new List <Tuple <UCSLine, ChangeOperation> >();
                }
            }
        }
Example #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ofd.Title  = "Open";
            ofd.Filter = "";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                ucs = new UCSFile(ofd.FileName);
                if (ucs.Process())
                {
                    lsvLocateInfo.Items.Clear();

                    saveToolStripMenuItem.Enabled       = true;
                    saveAsToolStripMenuItem.Enabled     = true;
                    addNewLineToolStripMenuItem.Enabled = true;

                    foreach (var kpl in ucs.UCSData)
                    {
                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = kpl.Key;
                        lvi.SubItems.Add(kpl.Value);
                        lsvLocateInfo.Items.Add(lvi);
                    }
                }
            }
        }