Ejemplo n.º 1
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            if (isDirty && curEditAEData != null)
            { // Ask Is Needed Saving ??
                DialogResult dialogResult = MessageBox.Show("请问是否需要保存 " + curEditAEData.fileName + "?", "确认下 (^_^)", MessageBoxButtons.YesNoCancel);
                if (dialogResult == DialogResult.Cancel)
                {
                    return;
                }
                else if (dialogResult == DialogResult.Yes)
                {
                    curEditAEData.WriteToFile(curEditAEData.fileName);
                }
            }

            AETypeForm aeTypeForm = new AETypeForm();

            aeTypeForm.ShowDialog();
            if (aeTypeForm.DialogResult == DialogResult.OK)
            {
                if (getOpenFileDialog(aeTypeForm.getType()).ShowDialog() == DialogResult.OK)
                {
                    String curfileName = getOpenFileDialog(aeTypeForm.getType()).FileName;
                    AEData aeData      = AEData.create(curfileName, table);
                    if (aeData != null)
                    {
                        setAEData(aeData);
                    }
                }
            }

            updateStatus();
        }
Ejemplo n.º 2
0
        public MainFrame(string[] args)
        {
            InitializeComponent();

            treeView1.NodeMouseClick += treeView_NodeClick;
            treeView1.KeyUp          += treeView_KeyUp;
            treeView1.ContextMenu     = nodeContextMenu;

            // init file
            init(".\\Editor\\aeditor\\aeditor.ini");
            // action template file
            table = new ActionTemplateTable(".\\Editor\\template.xml");

            MainFrame.instance = this;

            if (args.Length == 0)
            {
                setAEData(new AEData(EAeDataType.Cocos));
            }
            else
            {
                setAEData(AEData.create(args[0], table));
            }
        }