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 C ONSEQUENTIAL 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 ;
2017-07-14 13:55:02 -07:00
using System.Threading ;
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
using System.Threading.Tasks ;
using MatterHackers.Agg.UI ;
using MatterHackers.DataConverters3D ;
using MatterHackers.Localizations ;
using MatterHackers.MatterControl.DataStorage ;
2017-06-03 09:03:02 -07:00
using MatterHackers.MatterControl.PrinterCommunication ;
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
using MatterHackers.PolygonMesh ;
using MatterHackers.PolygonMesh.Processors ;
2017-06-03 09:03:02 -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
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
}
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 SqliteLibraryContainer : WritableContainer
{
protected List < PrintItemCollection > childCollections = new List < PrintItemCollection > ( ) ;
public SqliteLibraryContainer ( int collectionID )
{
this . ChildContainers = new List < ILibraryContainerLink > ( ) ;
this . Items = new List < ILibraryItem > ( ) ;
this . Name = "Local Library" . Localize ( ) ;
this . CollectionID = collectionID ;
//PrintHistoryData.Instance.ItemAdded.RegisterEvent((sender, e) => OnDataReloaded(null), ref unregisterEvent);
// ItemAdded.RegisterEvent(DatabaseFileChange, ref unregisterEvents);
this . ReloadContainer ( ) ;
}
public int CollectionID { get ; private set ; }
public override string KeywordFilter
{
get
{
return base . KeywordFilter ;
}
set
{
if ( base . KeywordFilter ! = value )
{
base . KeywordFilter = value ;
this . ReloadContainer ( ) ;
}
}
}
private void ReloadContainer ( )
{
Task . Run ( ( ) = >
{
childCollections = GetChildCollections ( ) ;
this . ChildContainers = childCollections . Select ( c = > new SqliteLibraryContainerLink ( )
{
ContainerID = c . Id , Name = c . Name } ) . ToList < ILibraryContainerLink > ( ) ; //
// PrintItems projected onto FileSystemFileItem
2017-06-03 13:29:36 -07:00
Items = GetLibraryItems ( KeywordFilter ) . Select < PrintItem , ILibraryItem > ( printItem = >
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 ( 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-06-03 13:29:36 -07:00
return new SqliteFileItem ( printItem ) ;
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
}
else
{
2017-06-03 13:29:36 -07:00
return new MessageItem ( $"{printItem.Name} (Missing)" ) ;
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 new MissingFileItem() // Needs to return a content specific icon with a missing overlay - needs to lack all print operations
}
2017-06-03 13:29:36 -07:00
} ) . 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
UiThread . RunOnIdle ( this . OnReloaded ) ;
} ) ;
}
public override async void Add ( IEnumerable < ILibraryItem > items )
{
await Task . Run ( async ( ) = >
{
2017-06-03 15:11:12 -07:00
if ( items . FirstOrDefault ( ) is ILibraryContainerLink containerInfo )
{
var newCollection = new PrintItemCollection ( containerInfo . Name , "" ) ;
newCollection . ParentCollectionID = this . CollectionID ;
newCollection . Commit ( ) ;
}
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-06-03 15:11:12 -07:00
foreach ( var item in items . OfType < ILibraryContentStream > ( ) )
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 15:11:12 -07:00
string filePath ;
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 15:11:12 -07:00
if ( item is FileSystemFileItem )
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 15:11:12 -07:00
// Get existing file path
var fileItem = item as FileSystemFileItem ;
filePath = fileItem . Path ;
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 15:11:12 -07:00
else
{
// Copy stream to library path
filePath = ApplicationDataStorage . Instance . GetNewLibraryFilePath ( "." + item . ContentType ) ;
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 15:11:12 -07:00
using ( var outputStream = File . OpenWrite ( filePath ) )
using ( var streamInteface = await item . GetContentStream ( null ) )
{
streamInteface . Stream . CopyTo ( outputStream ) ;
}
}
if ( ! string . IsNullOrEmpty ( filePath ) & & File . Exists ( filePath ) )
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 15:11:12 -07:00
if ( Path . GetExtension ( filePath ) . ToUpper ( ) = = ".ZIP" )
2017-06-03 09:46:02 -07:00
{
2017-06-03 15:11:12 -07:00
List < PrintItem > partFiles = ProjectFileHandler . ImportFromProjectArchive ( filePath ) ;
if ( partFiles ! = null )
2017-06-03 09:46:02 -07:00
{
2017-06-03 15:11:12 -07:00
foreach ( PrintItem part in partFiles )
2017-06-03 09:46:02 -07:00
{
2017-06-03 15:11:12 -07:00
string childFilePath = part . FileLocation ;
using ( var fileStream = File . OpenRead ( part . FileLocation ) )
{
2017-07-12 14:40:25 -07:00
AddItem ( fileStream , Path . GetExtension ( childFilePath ) , PrintItemWrapperExtensionMethods . GetFriendlyName ( Path . GetFileNameWithoutExtension ( childFilePath ) ) ) ;
2017-06-03 15:11:12 -07:00
}
2017-06-03 09:46:02 -07:00
}
}
}
2017-06-03 15:11:12 -07:00
else
2017-06-03 09:46:02 -07:00
{
2017-06-03 15:11:12 -07:00
using ( var stream = File . OpenRead ( filePath ) )
{
2017-06-05 23:34:33 -07:00
// If the passed in item name equals the fileName, perform friendly name conversion, otherwise use supplied value
string itemName = item . Name ;
if ( itemName = = Path . GetFileName ( filePath ) )
{
itemName = PrintItemWrapperExtensionMethods . GetFriendlyName ( Path . GetFileNameWithoutExtension ( filePath ) ) ;
}
2017-07-12 14:40:25 -07:00
AddItem ( stream , Path . GetExtension ( filePath ) , itemName ) ;
2017-06-03 15:11:12 -07:00
}
2017-06-03 09:46:02 -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
}
}
}
2017-06-03 15:11:12 -07:00
this . ReloadContainer ( ) ;
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 . OnReloaded ( ) ;
} ) ;
}
public List < PrintItem > GetLibraryItems ( string keyphrase = null )
{
// TODO: String concatenation to build sql statements is the root of all sql injection attacts. This needs to be changed to use parameter objects as would be expected
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
}
2017-06-03 13:29:36 -07:00
this . Items . Remove ( 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
}
this . OnReloaded ( ) ;
}
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
{
2017-06-03 15:11:12 -07:00
string sql = $"SELECT * FROM PrintItemCollection WHERE ID = {containerLink.ContainerID}" ;
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
}
this . ReloadContainer ( ) ;
}
/// <summary>
/// Creates a database PrintItem entity, if forceAMF is set, converts to AMF otherwise just copies
/// the source file to a new library path and updates the PrintItem to point at the new target
/// </summary>
private void AddItem ( Stream stream , string extension , string displayName , bool forceAMF = true )
{
// Create a new entity for the database
var printItem = new PrintItem ( )
{
Name = displayName ,
PrintItemCollectionID = this . CollectionID
} ;
// Special load processing for mesh data, simple copy below for non-mesh
if ( forceAMF
& & ( extension ! = "" & & MeshFileIo . ValidFileExtensions ( ) . Contains ( extension . ToUpper ( ) ) ) )
{
try
{
// Load mesh
2017-07-14 13:55:02 -07:00
IObject3D loadedItem = MeshFileIo . Load ( stream , extension , CancellationToken . None ) ;
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 PrintItemWrapper
if ( ! printItem . FileLocation . Contains ( ApplicationDataStorage . Instance . ApplicationLibraryDataPath ) )
{
string [ ] metaData = { "Created By" , "MatterControl" } ;
if ( false ) //AbsolutePositioned
{
metaData = new string [ ] { "Created By" , "MatterControl" , "BedPosition" , "Absolute" } ;
}
// save a copy to the library and update this to point at it
printItem . FileLocation = ApplicationDataStorage . Instance . GetNewLibraryFilePath ( ".amf" ) ;
MeshFileIo . Save (
new List < MeshGroup > { loadedItem . Flatten ( ) } ,
printItem . FileLocation ,
new MeshOutputSettings ( MeshOutputSettings . OutputType . Binary , metaData ) ) ;
printItem . Commit ( ) ;
}
}
catch ( UnauthorizedAccessException )
{
UiThread . RunOnIdle ( ( ) = >
{
//Do something special when unauthorized?
StyledMessageBox . ShowMessageBox ( null , "Oops! Unable to save changes, unauthorized access" , "Unable to save" ) ;
} ) ;
}
catch
{
UiThread . RunOnIdle ( ( ) = >
{
StyledMessageBox . ShowMessageBox ( null , "Oops! Unable to save changes." , "Unable to save" ) ;
} ) ;
}
}
else // it is not a mesh so just add it
{
// Non-mesh content - copy stream to new Library path
printItem . FileLocation = ApplicationDataStorage . Instance . GetNewLibraryFilePath ( extension ) ;
using ( var outStream = File . Create ( printItem . FileLocation ) )
{
stream . CopyTo ( outStream ) ;
}
}
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 ( )
{
}
public class SqliteLibraryContainerLink : ILibraryContainerLink
{
public string ID { get ; } = Guid . NewGuid ( ) . ToString ( ) ;
public int ContainerID { get ; set ; }
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 ;
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 ;
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 > (
new SqliteLibraryContainer ( this . ContainerID )
{
Name = this . Name ,
} ) ;
}
}
}
}