Ejemplo n.º 1
0
        private void OnActivated()
        {
            if (ExplorerFileSource.Count == 0)
            {
                IAsyncAction act = ThreadPool.RunAsync(async handler =>
                {
                    if (currentFolderInfo == null)
                    {
                        //보호되는 폴더목록 로드
                        protectedFolderList = folderDAO.GetProtectedRootFolderList();
                        //마지막 폴더 로드
                        currentFolderInfo = folderDAO.GetLastFolder();

                        if (protectedFolderList.Any(x => currentFolderInfo.Path.Contains(x.Path)))
                        {
                            ContentDialog contentDlg       = null;
                            PasswordBox pbox               = null;
                            FolderInfo protectedFolderInfo = protectedFolderList.FirstOrDefault(x => currentFolderInfo.Path.Contains(x.Path));
                            await DispatcherHelper.RunAsync(() =>
                            {
                                //메세지 창생성
                                GetPasswordConfirmDialog(protectedFolderInfo, out contentDlg, out pbox);
                                //메세지 창 출력
                                App.ContentDlgOp = contentDlg.ShowAsync();
                                //후처리기 등록
                                App.ContentDlgOp.Completed = new AsyncOperationCompletedHandler <ContentDialogResult>(async(op, status) =>
                                {
                                    var result = await op;
                                    if (result == ContentDialogResult.Primary)
                                    {
                                        if (protectedFolderInfo.Passcode == pbox.Password)
                                        {
                                            //자식 로드
                                            LoadChildFolder(currentFolderInfo);
                                        }
                                    }
                                    else
                                    {
                                        //루트 로드
                                        LoadChildFolder(null);
                                    }
                                    App.ContentDlgOp = null;
                                });
                            });
                        }
                        else
                        {
                            //자식 로드
                            LoadChildFolder(currentFolderInfo);
                        }
                    }
                });
//                System.Diagnostics.Debug.WriteLine("폴더 조회 요청 완료");
            }
        }