Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
/ *
Copyright ( c ) 2017 , John Lewin
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are met :
1. Redistributions of source code must retain the above copyright notice , this
list of conditions and the following disclaimer .
2. Redistributions in binary form must reproduce the above copyright notice ,
this list of conditions and the following disclaimer in the documentation
and / or other materials provided with the distribution .
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ;
LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies ,
either expressed or implied , of the FreeBSD Project .
* /
using System ;
using System.Collections.Generic ;
using System.IO ;
using System.Linq ;
using System.Threading.Tasks ;
using MatterHackers.Localizations ;
using MatterHackers.MatterControl.DataStorage ;
2017-09-17 12:01:18 -07:00
using MatterHackers.MatterControl.PrintQueue ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
namespace MatterHackers.MatterControl.Library
{
2017-06-03 13:29:36 -07:00
public class SqliteFileItem : FileSystemFileItem
2017-06-03 09:03:02 -07:00
{
2017-06-03 13:29:36 -07:00
public PrintItem PrintItem { get ; }
public SqliteFileItem ( PrintItem printItem )
: base ( printItem . FileLocation )
2017-06-03 09:03:02 -07:00
{
2017-06-03 13:29:36 -07:00
this . PrintItem = printItem ;
2017-06-03 09:03:02 -07:00
}
2017-06-03 13:29:36 -07:00
public override string Name { get = > this . PrintItem . Name ; set = > this . PrintItem . Name = value ; }
2017-06-03 09:03:02 -07:00
}
2018-12-24 12:39:01 -08:00
public class SqliteLibraryContainer : WritableContainer , ICustomSearch
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2018-12-24 12:39:01 -08:00
private string keywordFilter = "" ;
2018-02-01 14:09:22 -08:00
// Use default rootCollectionID - normally this constructor isn't used but exists to validate behavior in tests
2017-10-09 13:20:56 -07:00
public SqliteLibraryContainer ( )
2018-02-01 09:03:56 -08:00
: this ( Datastore . Instance . dbSQLite . Table < PrintItemCollection > ( ) . Where ( v = > v . Name = = "_library" ) . Take ( 1 ) . FirstOrDefault ( ) ? . Id ? ? 0 )
2018-12-24 12:39:01 -08:00
{
}
2017-10-09 13:20:56 -07:00
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
public SqliteLibraryContainer ( int collectionID )
{
2018-12-24 12:39:01 -08:00
this . CustomSearch = this ;
2019-01-25 07:56:34 -08:00
this . ID = "SqliteContainer" + collectionID ;
2018-02-06 21:28:47 -08:00
this . IsProtected = false ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
this . ChildContainers = new List < ILibraryContainerLink > ( ) ;
this . Items = new List < ILibraryItem > ( ) ;
this . Name = "Local Library" . Localize ( ) ;
this . CollectionID = collectionID ;
}
public int CollectionID { get ; private set ; }
2018-12-24 12:39:01 -08:00
public override ICustomSearch CustomSearch { get ; }
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
2017-10-09 13:20:56 -07:00
public override void Load ( )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2018-02-10 00:12:48 -08:00
var childCollections = this . GetChildCollections ( ) ;
2018-12-21 18:35:59 -08:00
var allFiles = this . GetLibraryItems ( keywordFilter ) ;
2018-02-10 00:12:48 -08:00
var zipFiles = allFiles . Where ( f = > string . Equals ( Path . GetExtension ( f . FileLocation ) , ".zip" , StringComparison . OrdinalIgnoreCase ) ) ;
2017-10-09 08:22:18 -07:00
2018-02-10 00:12:48 -08:00
var nonZipFiles = allFiles . Except ( zipFiles ) ;
IEnumerable < ILibraryContainerLink > childContainers = childCollections . Select ( c = > new SqliteLibraryContainerLink ( )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2019-01-25 07:56:34 -08:00
CollectionID = c . Id ,
2018-02-10 00:12:48 -08:00
Name = c . Name
} ) ;
this . ChildContainers = childContainers . Concat (
2018-09-05 08:33:56 -07:00
zipFiles . Select ( f = > new LocalLibraryZipContainerLink ( f . Id , f . FileLocation , f . Name ) ) ) . OrderBy ( d = > d . Name ) . ToList ( ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
2017-10-09 08:22:18 -07:00
// PrintItems projected onto FileSystemFileItem
2018-02-10 00:12:48 -08:00
this . Items = nonZipFiles . Select < PrintItem , ILibraryItem > ( printItem = >
2017-10-09 08:22:18 -07:00
{
if ( File . Exists ( printItem . FileLocation ) )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-10-09 08:22:18 -07:00
return new SqliteFileItem ( printItem ) ;
}
else
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-10-09 08:22:18 -07:00
return new MessageItem ( $"{printItem.Name} (Missing)" ) ;
//return new MissingFileItem() // Needs to return a content specific icon with a missing overlay - needs to lack all print operations
}
} ) . ToList ( ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
public override async void Add ( IEnumerable < ILibraryItem > items )
{
await Task . Run ( async ( ) = >
{
2017-09-28 11:22:45 -07:00
foreach ( var item in items )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-09-28 11:22:45 -07:00
switch ( item )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-09-28 11:22:45 -07:00
case CreateFolderItem newFolder :
var newFolderCollection = new PrintItemCollection ( newFolder . Name , "" ) ;
newFolderCollection . ParentCollectionID = this . CollectionID ;
newFolderCollection . Commit ( ) ;
break ;
case ILibraryContainerLink containerInfo :
var newCollection = new PrintItemCollection ( containerInfo . Name , "" ) ;
newCollection . ParentCollectionID = this . CollectionID ;
newCollection . Commit ( ) ;
break ;
2018-02-12 13:55:31 -08:00
case ILibraryAssetStream streamItem :
2017-09-28 11:22:45 -07:00
2018-02-27 17:38:47 -08:00
var fileName = ( streamItem as ILibraryAssetStream ) ? . FileName ;
2017-09-28 11:22:45 -07:00
2018-02-12 14:32:18 -08:00
using ( var streamInfo = await streamItem . GetStream ( null ) )
2017-06-03 15:11:12 -07:00
{
2018-02-07 18:01:49 -08:00
// If the passed in item name equals the fileName, perform friendly name conversion, otherwise use supplied value
string name = streamItem . Name ;
if ( name = = fileName )
2017-09-28 11:22:45 -07:00
{
2018-02-07 18:01:49 -08:00
name = PrintItemWrapperExtensionMethods . GetFriendlyName ( Path . GetFileNameWithoutExtension ( fileName ) ) ;
2017-09-28 11:22:45 -07:00
}
2018-02-07 18:01:49 -08:00
AddItem ( streamInfo . Stream , streamItem . ContentType , name ) ;
2017-06-03 09:46:02 -07:00
}
2018-02-07 18:01:49 -08:00
2017-09-28 11:22:45 -07:00
break ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
}
2018-02-01 09:01:57 -08:00
this . ReloadContent ( ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
} ) ;
}
2018-12-24 12:39:01 -08:00
private List < PrintItem > GetLibraryItems ( string keyphrase = null )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2018-02-10 00:12:48 -08:00
// TODO: String concatenation to build sql statements is the root of all sql injection attacks. This needs to be changed to use parameter objects as would be expected
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
string query ;
if ( string . IsNullOrEmpty ( keyphrase ) )
{
query = $"SELECT * FROM PrintItem WHERE PrintItemCollectionID = {CollectionID} ORDER BY Name ASC;" ;
}
else
{
query = $"SELECT * FROM PrintItem WHERE PrintItemCollectionID = {CollectionID} AND Name LIKE '%{keyphrase}%' ORDER BY Name ASC;" ;
}
return Datastore . Instance . dbSQLite . Query < PrintItem > ( query ) . ToList ( ) ;
}
public override void Remove ( IEnumerable < ILibraryItem > items )
{
2017-06-03 13:29:36 -07:00
// TODO: Handle Containers
foreach ( var item in items )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-06-03 13:29:36 -07:00
if ( item is SqliteFileItem sqlItem )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-06-03 13:29:36 -07:00
sqlItem . PrintItem . Delete ( ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
2018-09-05 08:33:56 -07:00
else if ( item is LocalLibraryZipContainerLink link )
{
string sql = $"SELECT * FROM PrintItem WHERE ID = @id" ;
var container = Datastore . Instance . dbSQLite . Query < PrintItem > ( sql , link . RowID ) . FirstOrDefault ( ) ;
container ? . Delete ( ) ;
}
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
2018-02-01 09:01:57 -08:00
this . ReloadContent ( ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
public override void Rename ( ILibraryItem selectedItem , string revisedName )
{
2017-06-03 13:29:36 -07:00
if ( selectedItem is SqliteFileItem sqliteItem )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2017-06-03 13:29:36 -07:00
sqliteItem . PrintItem . Name = revisedName ;
sqliteItem . PrintItem . Commit ( ) ;
}
2017-06-03 15:11:12 -07:00
else if ( selectedItem is SqliteLibraryContainerLink containerLink )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2019-01-25 07:56:34 -08:00
string sql = $"SELECT * FROM PrintItemCollection WHERE ID = {containerLink.CollectionID}" ;
2017-06-03 15:11:12 -07:00
var container = Datastore . Instance . dbSQLite . Query < PrintItemCollection > ( sql ) . FirstOrDefault ( ) ;
if ( container ! = null )
{
container . Name = revisedName ;
container . Commit ( ) ;
}
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
2018-02-01 09:01:57 -08:00
this . ReloadContent ( ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
/// <summary>
2018-02-27 17:38:47 -08:00
/// Creates a database PrintItem entity, copies the source file to a new library
2018-02-06 21:27:43 -08:00
/// path and updates the PrintItem to point at the new target
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
/// </summary>
2018-02-06 21:27:43 -08:00
private void AddItem ( Stream stream , string extension , string displayName )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
// Create a new entity for the database
var printItem = new PrintItem ( )
{
Name = displayName ,
2018-02-06 21:27:43 -08:00
PrintItemCollectionID = this . CollectionID ,
FileLocation = ApplicationDataStorage . Instance . GetNewLibraryFilePath ( extension )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
} ;
2018-02-06 21:27:43 -08:00
using ( var outStream = File . Create ( printItem . FileLocation ) )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
2018-02-06 21:27:43 -08:00
stream . CopyTo ( outStream ) ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
}
printItem . Commit ( ) ;
}
protected List < PrintItemCollection > GetChildCollections ( )
{
return Datastore . Instance . dbSQLite . Query < PrintItemCollection > (
$"SELECT * FROM PrintItemCollection WHERE ParentCollectionID = {CollectionID} ORDER BY Name ASC;" ) . ToList ( ) ;
}
public override void Dispose ( )
{
}
2018-12-24 12:39:01 -08:00
public void ApplyFilter ( string filter , ILibraryContext libraryContext )
{
keywordFilter = filter ;
this . Load ( ) ;
this . OnContentChanged ( ) ;
}
public void ClearFilter ( )
{
keywordFilter = null ;
this . Load ( ) ;
this . OnContentChanged ( ) ;
}
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
public class SqliteLibraryContainerLink : ILibraryContainerLink
{
2019-01-25 07:56:34 -08:00
public string ID = > "SqliteContainer" + this . CollectionID ;
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
2019-01-25 07:56:34 -08:00
public int CollectionID { get ; set ; }
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
public string Name { get ; set ; }
public bool IsProtected { get ; set ; } = false ;
2017-07-31 22:16:15 -07:00
public bool IsReadOnly { get ; set ; } = false ;
2017-10-08 19:35:49 -07:00
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
public bool IsVisible { get ; set ; } = true ;
2018-02-27 17:38:47 -08:00
public DateTime DateCreated { get ; } = DateTime . Now ;
public DateTime DateModified { get ; } = DateTime . Now ;
2017-07-18 18:15:10 -07:00
public Task < ILibraryContainer > GetContainer ( Action < double , string > reportProgress )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
return Task . FromResult < ILibraryContainer > (
2019-01-25 07:56:34 -08:00
new SqliteLibraryContainer ( this . CollectionID )
Move to new library model and view
- Add new listview control for library content
- Migrate library providers to containers
- Cloud, Sqlite, Directories, Queue, History
- Migrate SideBar components to containers
- Primatives, Text, Braille, ImageConverter
- Create new library container types
- Zip files, Calibration parts, Printer SDCards
- Reduce leftnav to Library, Settings, Controls, Options
- Add DragDrop support for image content
2017-05-19 22:33:55 -07:00
{
Name = this . Name ,
} ) ;
}
}
}
}