コード例 #1
0
        public void Store(TabsCollectionView tabs, ActionBarView actionBar)
        {
            var userFolder = new UserFolderPath();

            var contents = new List <IPath>();
            var queries  = new List <IQuery>();

            foreach (var tab in tabs.OpenedCustomTabs)
            {
                if (tab.Data is IQuery query)
                {
                    queries.Add(query);
                }

                if (tab.Data is IContent content)
                {
                    var path = new PartsPath(content.Source.Parts.SkipWhile(x => x.PlainText != userFolder.Name.PlainText).Skip(1));

                    contents.Add(path);
                }
            }

            var file = new SessionFile(queries.Select(x => x.PlainText), contents, new UserInterfaceSettings()
            {
                IsSideBarHidden = actionBar.IsPanelHidden
            }, new UserFolderPath());

            file.Save();
        }
コード例 #2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Saves the current session file info.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 private void SaveCurrentSessionFileInfo()
 {
     if (_currSessionFile != null)
     {
         _infoPanel.Save(_currSessionFile.Fields);
         _currSessionFile.Notes = _fileInfoNotes.Text.Trim();
         _currSessionFile.Save();
         //_currSessionFile = null;
     }
 }