Ejemplo n.º 1
0
        //根据菜单代码获取子窗体
        /// <summary>
        /// 根据菜单代码获取子窗体
        /// </summary>
        /// <param name="viewRight"></param>
        /// <returns></returns>
        internal static Form GetMenuForm(ViewRight viewRight)
        {
            switch (viewRight.FunctionCode.ToUpper())
            {
            case "FRMSYSTEMUSER": return(FrmSystemUser.Window);

            case "FRMSYSTEMUSERGROUP": return(FrmSystemUserGroup.Window);

            case "FRMSYSTEMFUNC": return(FrmSystemFunc.Window);

            case "FRMSYSTEMFUNCGROUP": return(FrmSystemFuncGroup.Window);

            case "FRMSYSTEMUSERASSIGNGROUP": return(FrmSystemUserAssignGroup.Window);

            case "FRMSYSTEMFUNCASSIGNGROUP": return(FrmSystemFuncAssignGroup.Window);

            case "FRMSYSTEMFUNCCOMMAND": return(FrmSystemFuncCommand.Window);

            case "FRMASSIGNRIGHT": return(FrmAssignRight.Window);

            case "FRMDICTIONARYITEM": return(FrmDictionaryItem.Window);

                //  case "FRMAUTOMATIONMAIN": return FrmAutomationMain.Window;
                // case "FRMAUTOMATIONM03": return FrmAutomationM03.Window;
            }
            return(null);
        }
Ejemplo n.º 2
0
        public async Task addLocation()
        {
            try
            {
                var folderPicker = new Windows.Storage.Pickers.FolderPicker();
                folderPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.Desktop;
                folderPicker.FileTypeFilter.Add("*");

                Windows.Storage.StorageFolder folder = await folderPicker.PickSingleFolderAsync();

                if (folder != null)
                {
                    // Application now has read/write access to all contents in the picked folder
                    // (including other sub-folder contents)
                    StorageApplicationPermissions.FutureAccessList.AddOrReplace(folder.DisplayName, folder);
                }
                else
                {
                }
                fileAndFolderViewer.ListCol.Clear();


                ViewLeft.InitializeTreeView();
                ViewRight.InitializeTreeView();


                InitializeDataGridView();
            }
            catch (Exception ex)
            {
                await new MessageDialog(ex.Message).ShowAsync();
            }
        }
Ejemplo n.º 3
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            var  resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
            bool tryOk          = false;

            try
            {
                StorageFolder documentFolder = KnownFolders.DocumentsLibrary;
                tryOk = true;
                // ViewRight.iniz("R");
            }
            catch (UnauthorizedAccessException ex)
            {
                //resourceLoader.GetString("MessageTiletDostup");
                // MessageDialog messageDialog = new MessageDialog(resourceLoader.GetString("MessageContentDostup"), resourceLoader.GetString("MessageTiletDostup"));
                // await messageDialog.ShowAsync();
                ContentDialogDostup contentDialogDostup = new ContentDialogDostup()
                {
                    Title = resourceLoader.GetString("MessageTiletDostup")
                };
                contentDialogDostup.TextD(resourceLoader.GetString("MessageContentDostup"));
                await contentDialogDostup.ShowAsync();

                App.Current.Exit();
            }



            if (tryOk)
            {
                ViewRight.iniz("R");
                InitializeDataGridView();
            }
            try
            {
                ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

                String localValue = localSettings.Values["ViewSet"] as string;

                if (localValue == "Max")
                {
                    FileAndFolderViewer.Type = "Maximum";
                }
                if (localValue == "Min")
                {
                    FileAndFolderViewer.Type = "Middle";
                }
            }
            catch (Exception ex)
            {
                await new MessageDialog(ex.Message).ShowAsync();
            }
            try
            {
                InitializeLicense();
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 4
0
 private void AppBarButton_Click_3(object sender, RoutedEventArgs e)
 {
     try
     {
         //Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.Remove(listDop.SelectedItem.ToString());
         Upgreid();
         ViewLeft.InitializeTreeView();
         ViewRight.InitializeTreeView();
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 5
0
        private void ViewLeft_GotFocus(object sender, RoutedEventArgs e)
        {
            FileFolderView fileFolderView = (FileFolderView)sender;

            viewFocusTag = fileFolderView;
            viewFocusTag.Focs(true);
            if (viewFocusTag.Name == ViewFocusName.ViewLeft)
            {
                ViewRight.Focs(false);
            }
            else
            {
                ViewLeft.Focs(false);
            }
        }
Ejemplo n.º 6
0
        public async void newUsB()
        {
            try
            {
                StorageFolder Folder = KnownFolders.RemovableDevices;

                IReadOnlyList <StorageFolder> folderList = await Folder.GetFoldersAsync();

                if (ViewLeft.fileAndFolderViewer.ListUSB.Count > 0)
                {
                    try
                    {
                        foreach (var FlFolder1 in ViewLeft.fileAndFolderViewer.ListUSB)
                        {
                            var f = (from d in folderList where d.DisplayName == FlFolder1.DisplayName select d).Count();
                            if (f == 0)
                            {
                                ViewLeft.fileAndFolderViewer.ListUSB.Remove(FlFolder1);
                                await Dispatcher.RunAsync(CoreDispatcherPriority.High,
                                                          async() =>
                                {
                                    if (ViewLeft.fileAndFolderViewer.Path == String.Empty)
                                    {
                                        //InitializeDataGridView1();
                                        ViewLeft.fileAndFolderViewer.InitializeDataGridView();
                                    }
                                    if (ViewRight.fileAndFolderViewer.Path == String.Empty)
                                    {
                                        ViewRight.fileAndFolderViewer.InitializeDataGridView();
                                    }


                                    ViewRight.InitializeTreeView();
                                    ViewLeft.InitializeTreeView();
                                });
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        await new MessageDialog(ex.Message).ShowAsync();
                    }
                }
                foreach (StorageFolder FlFolder1 in folderList)
                {
                    var f = (from d in ViewLeft.fileAndFolderViewer.ListUSB where d.DisplayName == FlFolder1.DisplayName select d).Count();
                    if (f == 0)
                    {
                        await Dispatcher.RunAsync(CoreDispatcherPriority.High,
                                                  async() =>
                        {
                            if (ViewLeft.fileAndFolderViewer.Path == String.Empty)
                            {
                                // var thumbnail1 = await FlFolder1.GetThumbnailAsync(ThumbnailMode.SingleItem, 100);
                                ViewLeft.fileAndFolderViewer.ListCol.Add(new ClassListStroce(FlFolder1.Path, FlFolder1.DisplayName, true, FlFolder1.DisplayType, FlFolder1.DateCreated.ToString(), FileAndFolderViewer.Type)
                                {
                                    ick = true
                                });                                                                                                                                                                                                    // { StorageFolder = FlFolder1, FlagFolde = true, ThumbnailMode = thumbnail1, Type = FileAndFolderViewer.Type });
                            }
                            if (ViewRight.fileAndFolderViewer.Path == String.Empty)
                            {
                                // var thumbnail1 = await FlFolder1.GetThumbnailAsync(ThumbnailMode.SingleItem, 100);
                                ViewRight.fileAndFolderViewer.ListCol.Add(new ClassListStroce(FlFolder1.Path, FlFolder1.DisplayName, true, FlFolder1.DisplayType, FlFolder1.DateCreated.ToString(), FileAndFolderViewer.Type)
                                {
                                    ick = true
                                });                                                                                                                                                                                                  // { StorageFolder = FlFolder1, FlagFolde = true, ThumbnailMode = thumbnail1, Type = FileAndFolderViewer.Type });
                            }
                            ViewLeft.fileAndFolderViewer.ListUSB.Add(FlFolder1);
                            ViewRight.InitializeTreeView();
                            ViewLeft.InitializeTreeView();
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                //await new MessageDialog(ex.Message).ShowAsync();
            }
        }