From eea7dd9fe4bf422fa4ce7e1578e4170d383d1712 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Wed, 24 Feb 2016 10:52:28 -0800 Subject: [PATCH] Remove DataStorage qualifier, add using statements --- AboutPage/AboutWidget.cs | 4 ++-- AboutPage/UpdateControlData.cs | 9 +++++---- ActionBar/ActionBarBaseControls.cs | 3 ++- History/PrintHistoryDataView.cs | 2 +- History/PrintHistoryListItem.cs | 2 +- Library/Provider/LibraryProviderFileSystem.cs | 2 +- MatterControlApplication.cs | 4 ++-- PrinterControls/PrinterConnections/PrinterSetupStatus.cs | 6 +++--- Queue/OptionsMenu/ExportToFolderProcess.cs | 2 +- Queue/PrintItemWrapper.cs | 6 +++--- SlicerConfiguration/SliceSettingsWidget.cs | 2 +- 11 files changed, 22 insertions(+), 20 deletions(-) diff --git a/AboutPage/AboutWidget.cs b/AboutPage/AboutWidget.cs index 399bccee3..f1e3d48d2 100644 --- a/AboutPage/AboutWidget.cs +++ b/AboutPage/AboutWidget.cs @@ -122,9 +122,9 @@ namespace MatterHackers.MatterControl // start cleaning out unused data // MatterControl\data\gcode - RemoveDirectory(DataStorage.ApplicationDataStorage.Instance.GCodeOutputPath); + RemoveDirectory(ApplicationDataStorage.Instance.GCodeOutputPath); - string userDataPath = DataStorage.ApplicationDataStorage.ApplicationUserDataPath; + string userDataPath = ApplicationDataStorage.ApplicationUserDataPath; RemoveDirectory(Path.Combine(userDataPath, "updates")); HashSet referencedPrintItemsFilePaths = new HashSet(); diff --git a/AboutPage/UpdateControlData.cs b/AboutPage/UpdateControlData.cs index 8c2ef70be..9643f75f7 100644 --- a/AboutPage/UpdateControlData.cs +++ b/AboutPage/UpdateControlData.cs @@ -31,6 +31,7 @@ using MatterHackers.Agg; using MatterHackers.Agg.PlatformAbstract; using MatterHackers.Agg.UI; using MatterHackers.Localizations; +using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.SettingsManagement; using MatterHackers.MatterControl.VersionManagement; using System; @@ -73,9 +74,9 @@ namespace MatterHackers.MatterControl public RootedObjectEventHandler UpdateStatusChanged = new RootedObjectEventHandler(); #if __ANDROID__ - static string updateFileLocation = Path.Combine(DataStorage.ApplicationDataStorage.Instance.PublicDataStoragePath, "updates"); + static string updateFileLocation = Path.Combine(ApplicationDataStorage.Instance.PublicDataStoragePath, "updates"); #else - private static string applicationDataPath = DataStorage.ApplicationDataStorage.ApplicationUserDataPath; + private static string applicationDataPath = ApplicationDataStorage.ApplicationUserDataPath; private static string updateFileLocation = Path.Combine(applicationDataPath, "updates"); #endif @@ -368,8 +369,8 @@ namespace MatterHackers.MatterControl } else { - DataStorage.ApplicationSession firstSession; - firstSession = DataStorage.Datastore.Instance.dbSQLite.Table().OrderBy(v => v.SessionStart).Take(1).FirstOrDefault(); + ApplicationSession firstSession; + firstSession = Datastore.Instance.dbSQLite.Table().OrderBy(v => v.SessionStart).Take(1).FirstOrDefault(); if (firstSession != null && DateTime.Compare(firstSession.SessionStart.AddDays(7), DateTime.Now) < 0) { diff --git a/ActionBar/ActionBarBaseControls.cs b/ActionBar/ActionBarBaseControls.cs index fdf19a6d0..3a6f96d88 100644 --- a/ActionBar/ActionBarBaseControls.cs +++ b/ActionBar/ActionBarBaseControls.cs @@ -2,6 +2,7 @@ using MatterHackers.Agg.UI; using MatterHackers.Agg.VertexSource; using MatterHackers.Localizations; +using MatterHackers.MatterControl.DataStorage; using MatterHackers.MatterControl.PrinterCommunication; using MatterHackers.VectorMath; using System; @@ -170,7 +171,7 @@ namespace MatterHackers.MatterControl.ActionBar private int GetPrinterRecordCount() { - return DataStorage.Datastore.Instance.RecordCount("Printer"); + return Datastore.Instance.RecordCount("Printer"); } private void SetButtonText() diff --git a/History/PrintHistoryDataView.cs b/History/PrintHistoryDataView.cs index f01a77489..36ca9311d 100644 --- a/History/PrintHistoryDataView.cs +++ b/History/PrintHistoryDataView.cs @@ -85,7 +85,7 @@ namespace MatterHackers.MatterControl.PrintHistory } RemoveListItems(); - IEnumerable partFiles = PrintHistoryData.Instance.GetHistoryItems(NumItemsToLoad); + IEnumerable partFiles = PrintHistoryData.Instance.GetHistoryItems(NumItemsToLoad); if (partFiles != null) { foreach (PrintTask part in partFiles) diff --git a/History/PrintHistoryListItem.cs b/History/PrintHistoryListItem.cs index 8aa90ccba..da9d91f51 100644 --- a/History/PrintHistoryListItem.cs +++ b/History/PrintHistoryListItem.cs @@ -305,7 +305,7 @@ namespace MatterHackers.MatterControl.PrintHistory private void ViewButton_Click(object sender, EventArgs e) { this.rightButtonOverlay.SlideOut(); - PrintItem printItem = DataStorage.Datastore.Instance.dbSQLite.Table().Where(v => v.Id == this.printTask.PrintItemId).Take(1).FirstOrDefault(); + PrintItem printItem = Datastore.Instance.dbSQLite.Table().Where(v => v.Id == this.printTask.PrintItemId).Take(1).FirstOrDefault(); if (printItem != null) { diff --git a/Library/Provider/LibraryProviderFileSystem.cs b/Library/Provider/LibraryProviderFileSystem.cs index 49cb371c8..8ad781629 100644 --- a/Library/Provider/LibraryProviderFileSystem.cs +++ b/Library/Provider/LibraryProviderFileSystem.cs @@ -230,7 +230,7 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider { string fileName = currentDirectoryFiles[itemIndex]; - var printItemWrapper = new PrintItemWrapper(new DataStorage.PrintItem(GetPrintItemName(itemIndex), fileName), this.GetProviderLocator()) + var printItemWrapper = new PrintItemWrapper(new PrintItem(GetPrintItemName(itemIndex), fileName), this.GetProviderLocator()) { UseIncrementedNameDuringTypeChange = true }; diff --git a/MatterControlApplication.cs b/MatterControlApplication.cs index ffbc9579e..b1a601e92 100644 --- a/MatterControlApplication.cs +++ b/MatterControlApplication.cs @@ -598,7 +598,7 @@ namespace MatterHackers.MatterControl if (argExtension.Length > 1 && MeshFileIo.ValidFileExtensions().Contains(argExtension)) { - QueueData.Instance.AddItem(new PrintItemWrapper(new DataStorage.PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg)))); + QueueData.Instance.AddItem(new PrintItemWrapper(new PrintItem(Path.GetFileName(arg), Path.GetFullPath(arg)))); } } @@ -713,7 +713,7 @@ namespace MatterHackers.MatterControl #endif if (!Directory.Exists(pluginDirectory)) { - string dataPath = DataStorage.ApplicationDataStorage.Instance.ApplicationUserDataPath; + string dataPath = ApplicationDataStorage.Instance.ApplicationUserDataPath; pluginDirectory = Path.Combine(dataPath, "Plugins"); } // TODO: this should look in a plugin folder rather than just the application directory (we probably want it in the user folder). diff --git a/PrinterControls/PrinterConnections/PrinterSetupStatus.cs b/PrinterControls/PrinterConnections/PrinterSetupStatus.cs index 036559447..f691ca15a 100644 --- a/PrinterControls/PrinterConnections/PrinterSetupStatus.cs +++ b/PrinterControls/PrinterConnections/PrinterSetupStatus.cs @@ -247,7 +247,7 @@ namespace MatterHackers.MatterControl if (settingsDict.Count > 0) { - collection = new DataStorage.SliceSettingsCollection(); + collection = new SliceSettingsCollection(); collection.Name = this.ActivePrinter.Name; collection.Commit(); @@ -267,7 +267,7 @@ namespace MatterHackers.MatterControl if (settingsDict.Count > 0) { - collection = new DataStorage.SliceSettingsCollection(); + collection = new SliceSettingsCollection(); collection.Name = Path.GetFileNameWithoutExtension(filePath); collection.PrinterId = ActivePrinter.Id; collection.Tag = tag; @@ -292,7 +292,7 @@ namespace MatterHackers.MatterControl { foreach (KeyValuePair item in settingsDict) { - DataStorage.SliceSetting sliceSetting = new DataStorage.SliceSetting(); + SliceSetting sliceSetting = new SliceSetting(); sliceSetting.Name = item.Key; sliceSetting.Value = item.Value; sliceSetting.SettingsCollectionId = collectionId; diff --git a/Queue/OptionsMenu/ExportToFolderProcess.cs b/Queue/OptionsMenu/ExportToFolderProcess.cs index ca63009e0..e5a275550 100644 --- a/Queue/OptionsMenu/ExportToFolderProcess.cs +++ b/Queue/OptionsMenu/ExportToFolderProcess.cs @@ -83,7 +83,7 @@ namespace MatterHackers.MatterControl.PrintQueue } } - public ExportToFolderProcess(List list, string exportPath) + public ExportToFolderProcess(List list, string exportPath) { this.allFilesToExport = list; this.exportPath = exportPath; diff --git a/Queue/PrintItemWrapper.cs b/Queue/PrintItemWrapper.cs index 58b5c66c8..be6825cce 100644 --- a/Queue/PrintItemWrapper.cs +++ b/Queue/PrintItemWrapper.cs @@ -62,7 +62,7 @@ namespace MatterHackers.MatterControl.PrintQueue private long writeTime = 0; - public PrintItemWrapper(DataStorage.PrintItem printItem, List sourceLibraryProviderLocator = null) + public PrintItemWrapper(PrintItem printItem, List sourceLibraryProviderLocator = null) { this.PrintItem = printItem; @@ -76,7 +76,7 @@ namespace MatterHackers.MatterControl.PrintQueue public PrintItemWrapper(int printItemId) { - this.PrintItem = DataStorage.Datastore.Instance.dbSQLite.Table().Where(v => v.Id == printItemId).Take(1).FirstOrDefault(); + this.PrintItem = Datastore.Instance.dbSQLite.Table().Where(v => v.Id == printItemId).Take(1).FirstOrDefault(); try { this.fileType = Path.GetExtension(this.FileLocation).ToUpper(); @@ -271,7 +271,7 @@ namespace MatterHackers.MatterControl.PrintQueue string engineString = ((int)ActivePrinterProfile.Instance.ActiveSliceEngineType).ToString(); string gcodeFileName = this.FileHashCode.ToString() + "_" + engineString + "_" + ActiveSliceSettings.Instance.GetHashCode().ToString(); - string gcodePathAndFileName = Path.Combine(DataStorage.ApplicationDataStorage.Instance.GCodeOutputPath, gcodeFileName + ".gcode"); + string gcodePathAndFileName = Path.Combine(ApplicationDataStorage.Instance.GCodeOutputPath, gcodeFileName + ".gcode"); return gcodePathAndFileName; } else diff --git a/SlicerConfiguration/SliceSettingsWidget.cs b/SlicerConfiguration/SliceSettingsWidget.cs index 2a9c0b528..ca510aa45 100644 --- a/SlicerConfiguration/SliceSettingsWidget.cs +++ b/SlicerConfiguration/SliceSettingsWidget.cs @@ -686,7 +686,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration FlowLayoutWidget topToBottomSettings = new FlowLayoutWidget(FlowDirection.TopToBottom); topToBottomSettings.HAnchor = Agg.UI.HAnchor.Max_FitToChildren_ParentWidth; - foreach (KeyValuePair item in ActiveSliceSettings.Instance.DefaultSettings) + foreach (KeyValuePair item in ActiveSliceSettings.Instance.DefaultSettings) { if (!SliceSettingsOrganizer.Instance.Contains(UserLevel, item.Key)) {