Exemplo n.º 1
0
        private void addPanel_importButton_Click(string title)
        {
            try {
                string            path = HKOpenFileDialog.selectFile(HKDialogFilter.Library);
                AttandanceLibrary lib  = FileSerilizeOpener <AttandanceLibrary> .open(path);

                AttandanceLibrary oldLib   = null;
                DJTUBinary        librarys = GlobalStation.shareInstance.librarys;
                librarys.isCustomize = false;
                if (librarys.containsLibrary(lib))
                {
                    handleOverwrite(lib, ref oldLib);
                }
                librarys.addLib(lib);
                GlobalStation.shareInstance.librarySave(delegate() {
                    initTableViewContent();
                    resize(null, null);
                }, delegate() {
                    if (oldLib != null)
                    {
                        librarys.addLib(oldLib);
                    }
                    librarys.removeLib(lib.UUID);
                });
            } catch (HKOpenFileDialog.CancelOpenFileException) { }
        }
Exemplo n.º 2
0
        private void addPanel_openButton_Click(string title)
        {
            try {
                string            path = HKOpenFileDialog.selectFile(HKDialogFilter.Library);
                AttandanceLibrary lib  = FileSerilizeOpener <AttandanceLibrary> .open(path);

                GlobalStation.shareInstance.librarys.isCustomize      = true;
                GlobalStation.shareInstance.librarys.customizeLibrary = CustomLibrary.createLibrary(lib, path);
                LibraryHallPanel hall = new LibraryHallPanel();
                hall.libraryUUID = lib.UUID;
                GlobalStation.shareInstance.entrance.showPanel(hall);
            }catch (HKOpenFileDialog.CancelOpenFileException) { }
        }