예제 #1
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string inFile;
            int    i = Program.OpenFile(InFilter, out inFile);

            if (i != 0)
            {
                if (i == 32)
                {
                    FileMap      map  = FileMap.FromFile(inFile, FileMapProtect.Read);
                    FileScanNode node = new FileScanNode();
                    Program.Scan(map, node);
                    if (node.Children.Count == 0)
                    {
                        MessageBox.Show("No formats recognized.");
                    }
                    else
                    {
                        Program._rootNode = node;
                        Program._rootPath = inFile;
                        node._list        = node._children;
                        node.Initialize(null, new DataSource(map));
                        Reset();
                    }
                }
                else if (Program.Open(inFile))
                {
                    RecentFileHandler.AddFile(inFile);
                }
            }
        }
예제 #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string inFile;
            int    i = Program.OpenFile(SupportedFilesHandler.CompleteFilterEditableOnly, out inFile);

            if (i != 0 && Program.Open(inFile))
            {
                RecentFileHandler.AddFile(inFile);
            }
        }