コード例 #1
0
        private void loadProjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (var ofd = new OpenFileDialog())
            {
                ofd.Filter = FILTERPROJECT;
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    Project = OIDProject.Load(ofd.FileName);
                    RefreshNodes();
                    RefreshOid();

                    if (lbOidCodes.Items != null && lbOidCodes.Items.Count > 0)
                    {
                        lbOidCodes.SelectedIndex = 0;
                    }
                }
            }
        }
コード例 #2
0
        private void RefreshRecentItems()
        {
            MenuRecent.DropDownItems.Clear();
            foreach (var item in TTGRegistry.GetRecentProjectPath())
            {
                var mi = new ToolStripMenuItem(item);
                mi.Click += (_, __) =>
                {
                    Project = OIDProject.Load(item);
                    RefreshNodes();
                    RefreshOid();

                    if (lbOidCodes.Items != null && lbOidCodes.Items.Count > 0)
                    {
                        lbOidCodes.SelectedIndex = 0;
                    }
                };
                MenuRecent.DropDownItems.Add(mi);
            }
        }