public void MoveSelectedFolderToParent()
        {
            var v_splittedPath = SelectedFolderPath.Split(new char[] { '/' }, System.StringSplitOptions.RemoveEmptyEntries);
            var v_current      = "";

            for (int i = 0; i < v_splittedPath.Length - 1; i++)
            {
                v_current += (string.IsNullOrEmpty(v_current) ? "" : "/") + v_splittedPath[i];
            }
            SelectedFolderPath = v_current;
        }
Esempio n. 2
0
        public void SetSelectedDirectory(CDirectoryEntry directory)
        {
            ActiveDirectory = directory.Path;
            SelectedFolderPath.Clear();
            CDirectoryEntry dir = directory;

            SelectedFolderPath.Add(RootDirectory);
            while (dir.ParentDirectory != null)
            {
                SelectedFolderPath.Insert(1, dir);
                dir = dir.ParentDirectory;
            }
            UpdateShownAssets();
        }
Esempio n. 3
0
        public CAssetBrowserViewModel() : base("AssetBrowser")
        {
            SetIconSourcePath("Resources/Images/Tabs/assetbrowser.png");

            Content         = new AssetBrowserView();
            m_rootDirectory = new CDirectoryEntry("", this);             // Start at the project root
            RootFolders.Add(m_rootDirectory);
            SelectedFolderPath.Add(m_rootDirectory);
            ImportCommand          = new CRelayCommand(OnImport);
            DeleteAssetCommand     = new CRelayCommand(OnDeleteAsset);
            CreateMaterialCommand  = new CRelayCommand(OnCreateMaterial);
            CreateEntityCommand    = new CRelayCommand(OnCreateEntity);
            CreateInterfaceCommand = new CRelayCommand(OnCreateInterface);
        }
        private void FocusDirectoryLevelUp()
        {
            if (SelectedFolderPath == null)
            {
                return;
            }
            if (SelectedFolderPath.IsRoot())
            {
                return;
            }
            if (HierachicalBaseWrapper.IsSpecial(SelectedFolderPath))
            {
                return;
            }

            SelectedFolderPath = SelectedFolderPath.ParentPath();
        }
Esempio n. 5
0
        private void OnSelectedFolderPathChanged()
        {
            App.Logger.TraceExt("NotesViewHierarchical",
                                "OnSelectedFolderPathChanged",
                                Tuple.Create("SelectedFolderPath", SelectedFolderPath?.Formatted));

            if (SelectedFolderPath == null)
            {
                return;
            }
            if (DisplayItems == null)
            {
                return;
            }

            var f = DisplayItems.Find(SelectedFolderPath, true);

            if (f != null)
            {
                if (!f.IsSelected)
                {
                    App.Logger.TraceExt("NotesViewHierarchical",
                                        "OnSelectedFolderPathChanged (1)",
                                        Tuple.Create("f.IsSelected", "true"));

                    f.IsSelected = true;
                }
            }
            else
            {
                if (AllNotes == null && !SelectedFolderPath.IsRoot() && !SelectedFolderPath.EqualsIgnoreCase(SelectedFolder?.GetInternalPath()))
                {
                    App.Logger.TraceExt("NotesViewHierarchical", "OnSelectedFolderPathChanged (2)",
                                        Tuple.Create("SelectedFolder", SelectedFolder?.Header));

                    _initFolderPath    = SelectedFolderPath;
                    SelectedFolderPath = SelectedFolder?.GetInternalPath() ?? DirectoryPath.Root();
                }
                else
                {
                    if (DisplayItems.AllNotesViewWrapper != null)
                    {
                        if (!DisplayItems.AllNotesViewWrapper.IsSelected)
                        {
                            App.Logger.TraceExt("NotesViewHierarchical",
                                                "OnSelectedFolderPathChanged (3)",
                                                Tuple.Create("DisplayItems.AllNotesWrapper.IsSelected", "true"));

                            DisplayItems.AllNotesViewWrapper.IsSelected = true;
                        }
                    }
                    else
                    {
                        var fod = DisplayItems.SubFolder.FirstOrDefault(p => !p.IsSpecialNode);
                        if (fod != null && !fod.IsSelected)
                        {
                            App.Logger.TraceExt("NotesViewHierarchical",
                                                "OnSelectedFolderPathChanged (4)",
                                                Tuple.Create("DisplayItems.SubFolder.FirstOrDefault().IsSelected", "true"));

                            fod.IsSelected = true;
                        }
                    }
                }
            }

            if (_isNotesInitialized)
            {
                _hierarchyCache.UpdateAndRequestSave(RepositoryAccountID, SelectedFolderPath, SelectedNote?.UniqueName);
            }
        }
        private void FocusNextDirectory()
        {
            if (SelectedFolderPath == null)
            {
                return;
            }

            var folders = Owner.NotesViewControl.ListFolder().ToList();

            var idx = folders.IndexOf(SelectedFolderPath);

            if (idx == -1)
            {
                return;
            }

            folders = folders.Skip(idx + 1).Concat(folders.Take(idx)).ToList();

            if (HierachicalBaseWrapper.IsSpecialOrRoot(SelectedFolderPath))
            {
                var found = folders.FirstOrDefault(HierachicalBaseWrapper.IsSpecialOrRoot);
                if (found != null)
                {
                    SelectedFolderPath = found;
                }
            }
            else
            {
                var found = folders.FirstOrDefault(p => !HierachicalBaseWrapper.IsSpecialOrRoot(p) && p.IsDirectSubPathOf(SelectedFolderPath.ParentPath(), true));
                if (found != null)
                {
                    SelectedFolderPath = found;
                }
            }
        }
Esempio n. 7
0
 /// <summary>
 /// SetStatus method
 /// </summary>
 private void SetStatus()
 {
     mPlayer.SetImagePathFlag      = PlayerStatus.HasSetImagePath;
     mPlayer.UriShowTextBlock.Text = (SelectedFolderPath is null || SelectedFolderPath == "") ? "No such folder has selected" : SelectedFolderPath.ToString();
 }