Exemple #1
0
        public async void ShowMoveFileDialog(TreeNode treeNodeToMove)
        {
            Console.WriteLine("Bestand om te verplaatsen: " + treeNodeToMove.Name);
            homeActivity.ShowProgressDialog(null);
            try {
                Android.App.FragmentTransaction fragmentTransaction;
                fragmentTransaction = homeActivity.FragmentManager.BeginTransaction();

                List <TreeNode> foundDirectoryTreeNodes = new List <TreeNode>();
                TreeNode        rootTreeNode            = await DataLayer.Instance.GetFolder("/");

                foreach (TreeNode foundTreeNode in rootTreeNode.Children)
                {
                    if (foundTreeNode.IsDirectory)
                    {
                        foundDirectoryTreeNodes.Add(foundTreeNode);
                    }
                }
                MoveFileFragment moveFileFragment = new MoveFileFragment(foundDirectoryTreeNodes, treeNodeToMove, homeActivity);
                homeActivity.dialogFragmentMoveFile = moveFileFragment;

                homeActivity.HideProgressDialog();

                if (foundDirectoryTreeNodes.Count > 0)
                {
                    homeActivity.dialogFragmentMoveFile.Show(fragmentTransaction, "movefiledialog");
                }
                else
                {
                    homeActivity.ShowToast("Geen mappen gevonden om bestand naar te verplaatsen");
                }
            } catch (Exception ex) {
                Insights.Report(ex);
                homeActivity.HideProgressDialog();
                homeActivity.ShowToast("Er is iets fout gegaan bij het ophalen van mappen. \nProbeer het a.u.b. opnieuw");
            }
        }
		public async void ShowMoveFileDialog(TreeNode treeNodeToMove)
		{
			Console.WriteLine ("Bestand om te verplaatsen: " + treeNodeToMove.Name);
			homeActivity.ShowProgressDialog (null);
			try {
				Android.App.FragmentTransaction fragmentTransaction;
				fragmentTransaction = homeActivity.FragmentManager.BeginTransaction ();

				List<TreeNode>foundDirectoryTreeNodes 	= new List<TreeNode>();
				TreeNode rootTreeNode = await DataLayer.Instance.GetFolder ("/");

				foreach(TreeNode foundTreeNode in rootTreeNode.Children)
				{
					if(foundTreeNode.IsDirectory)
					{
						foundDirectoryTreeNodes.Add(foundTreeNode);
					}
				}
				MoveFileFragment moveFileFragment = new MoveFileFragment(foundDirectoryTreeNodes, treeNodeToMove, homeActivity);
				homeActivity.dialogFragmentMoveFile = moveFileFragment;

				homeActivity.HideProgressDialog ();

				if (foundDirectoryTreeNodes.Count > 0) {
					homeActivity.dialogFragmentMoveFile.Show (fragmentTransaction, "movefiledialog");
				} else {
					homeActivity.ShowToast("Geen mappen gevonden om bestand naar te verplaatsen");
				}
			} catch (Exception ex){
				Insights.Report(ex);
				homeActivity.HideProgressDialog ();
				homeActivity.ShowToast ("Er is iets fout gegaan bij het ophalen van mappen. \nProbeer het a.u.b. opnieuw");
			}
		}