public MainWindow() { if (!File.Exists(UAgent.workPath + "\\filemgr-win64.exe")) { MessageBox.Show("未找到 filemgr-win64.exe \n将文件放到 " + UAgent.workPath + " 目录下"); Application.Current.Shutdown(); } cloudFileTree = new FolderTree(); localFileTree = new FolderTree(); localFileTree.root = new FolderTreeNode("addRoot"); InitializeComponent(); // 绑定log更新 uilog.onGetNewLog = (newLog) => { //logBox.Text = newLog; logBtn.Header = newLog; }; //读档 bucketData = savedata.getInstance().bucketdata; //refreshProject(); //退出时存档 Application.Current.Exit += (object sender, ExitEventArgs e) => { savedata.getInstance().bucketdata.serialization(); }; //保存实例给state State.mainWindow = this; }
public static BucketData getInstance() { if (_instance == null) { _instance = new BucketData(); } return(_instance); }