This commit is contained in:
larsbrubaker 2020-11-28 09:53:45 -08:00
commit 99ee0f9aa2
145 changed files with 13693 additions and 372 deletions

View file

@ -135,8 +135,11 @@ namespace MatterHackers.MatterControl.Extensibility
public class MatterControlPluginItem
{
public string Name { get; set; }
public string Url { get; set; }
public string Version { get; set; }
public DateTime ReleaseDate { get; set; }
}
}

View file

@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Collections.Generic;
using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
namespace MatterHackers.MatterControl.SlicerConfiguration
@ -63,7 +64,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
Category categoryToAddTo = null;
Group groupToAddTo = null;
foreach (string line in AggContext.StaticData.ReadAllLines(Path.Combine("SliceSettings", "Layouts.txt")))
foreach (string line in StaticData.Instance.ReadAllLines(Path.Combine("SliceSettings", "Layouts.txt")))
{
if (line.Length > 0)
{

View file

@ -75,6 +75,10 @@
<Project>{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}</Project>
<Name>Agg</Name>
</ProjectReference>
<ProjectReference Include="..\Submodules\agg-sharp\DataConverters2D\DataConverters2D.csproj">
<Project>{94838988-523c-4b11-ad82-8b9b76f23a31}</Project>
<Name>DataConverters2D</Name>
</ProjectReference>
<ProjectReference Include="..\Submodules\agg-sharp\DataConverters3D\DataConverters3D.csproj">
<Project>{04667764-dc7b-4b95-aef6-b4e6c87a54e9}</Project>
<Name>DataConverters3D</Name>

View file

@ -52,7 +52,7 @@ namespace MatterHackers.MatterControl
graphics.Clear(Color.White);
graphics.DrawString("No Camera Detected", 320, 240, pointSize: 24, justification: Agg.Font.Justification.Center);
graphics.DrawString(DateTime.Now.ToString(), 320, 200, pointSize: 12, justification: Agg.Font.Justification.Center);
AggContext.ImageIO.SaveImageData(imageFileName, noCameraImage);
ImageIO.SaveImageData(imageFileName, noCameraImage);
PictureTaken?.Invoke(null, null);
}
@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl
{
if (AggContext.OperatingSystem == OSType.Windows)
{
using (var mediaStream = AggContext.StaticData.OpenStream(Path.Combine("Sounds", fileName)))
using (var mediaStream = StaticData.Instance.OpenStream(Path.Combine("Sounds", fileName)))
{
(new System.Media.SoundPlayer(mediaStream)).Play();
}
@ -124,7 +124,7 @@ namespace MatterHackers.MatterControl
public void PlatformInit(Action<string> reporter)
{
if (AggContext.OperatingSystem == OSType.Mac && AggContext.StaticData == null)
if (AggContext.OperatingSystem == OSType.Mac)
{
// Set working directory - this duplicates functionality in Main but is necessary on OSX as Main fires much later (after the constructor in this case)
// resulting in invalid paths due to path tests running before the working directory has been overridden. Setting the value before initializing StaticData
@ -132,12 +132,6 @@ namespace MatterHackers.MatterControl
Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));
}
// Initialize a standard file system backed StaticData provider
if (AggContext.StaticData == null) // it may already be initialized by tests
{
AggContext.StaticData = new FileSystemStaticData();
}
if (Clipboard.Instance == null)
{
Clipboard.SetSystemClipboard(new WindowsFormsClipboard());
@ -164,7 +158,7 @@ namespace MatterHackers.MatterControl
public void GenerateLocalizationValidationFile()
{
if (AggContext.StaticData is FileSystemStaticData fileSystemStaticData)
if (StaticData.Instance is StaticData fileSystemStaticData)
{
char currentChar = 'A';

View file

@ -119,9 +119,9 @@ namespace MatterHackers.MatterControl
Margin = new BorderDouble(bottom: 15)
};
var data = JsonConvert.DeserializeObject<List<LibraryLicense>>(AggContext.StaticData.ReadAllText(Path.Combine("License", "license.json")));
var data = JsonConvert.DeserializeObject<List<LibraryLicense>>(StaticData.Instance.ReadAllText(Path.Combine("License", "license.json")));
var linkIcon = AggContext.StaticData.LoadIcon("fa-link_16.png", 16, 16, theme.InvertIcons);
var linkIcon = StaticData.Instance.LoadIcon("fa-link_16.png", 16, 16, theme.InvertIcons);
SectionWidget section = null;
@ -205,9 +205,9 @@ namespace MatterHackers.MatterControl
public override void OnLoad(EventArgs args)
{
string filePath = Path.Combine("License", $"{sourceName}.txt");
if (AggContext.StaticData.FileExists(filePath))
if (StaticData.Instance.FileExists(filePath))
{
string content = AggContext.StaticData.ReadAllText(filePath);
string content = StaticData.Instance.ReadAllText(filePath);
this.AddChild(new WrappedTextWidget(content, theme.DefaultFontSize, textColor: theme.TextColor));
}

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl
this.AddChild(new HorizontalSpacer());
checkUpdateButton = new IconButton(AggContext.StaticData.LoadIcon("fa-refresh_14.png", 14, 14, theme.InvertIcons), theme)
checkUpdateButton = new IconButton(StaticData.Instance.LoadIcon("fa-refresh_14.png", 14, 14, theme.InvertIcons), theme)
{
ToolTipText = "Check for Update".Localize(),
BackgroundColor = theme.MinimalShade,

View file

@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.ActionBar
this.MakeScrollable = false;
this.AlignToRightEdge = true;
ImageWidget = new ImageWidget(AggContext.StaticData.LoadIcon("hotend.png", 14, 14, theme.InvertIcons))
ImageWidget = new ImageWidget(StaticData.Instance.LoadIcon("hotend.png", 14, 14, theme.InvertIcons))
{
VAnchor = VAnchor.Center,
Margin = new BorderDouble(right: 5)

View file

@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl.ActionBar
this.DisplayCurrentTemperature();
this.ToolTipText = "Bed Temperature".Localize();
this.ImageWidget.Image = AggContext.StaticData.LoadIcon("bed.png", 16, 16, theme.InvertIcons);
this.ImageWidget.Image = StaticData.Instance.LoadIcon("bed.png", 16, 16, theme.InvertIcons);
this.PopupContent = this.GetPopupContent(ApplicationController.Instance.MenuTheme);

View file

@ -119,7 +119,7 @@ namespace MatterHackers.MatterControl
string themesPath = Path.Combine("Themes", "System");
var staticData = AggContext.StaticData;
var staticData = StaticData.Instance;
// Load available themes from StaticData
if (staticData.DirectoryExists(themesPath))
@ -130,7 +130,7 @@ namespace MatterHackers.MatterControl
themes[Path.GetFileNameWithoutExtension(themeFile)] = themeFile;
}
foreach (var directoryTheme in AggContext.StaticData.GetDirectories(themesPath).Where(d => Path.GetFileName(d) != "Menus").Select(d => new DirectoryTheme(d)))
foreach (var directoryTheme in StaticData.Instance.GetDirectories(themesPath).Where(d => Path.GetFileName(d) != "Menus").Select(d => new DirectoryTheme(d)))
{
ThemeProviders.Add(directoryTheme.Name, directoryTheme);
}
@ -197,7 +197,7 @@ namespace MatterHackers.MatterControl
{
if (themes.TryGetValue(themeName, out string themePath))
{
string json = AggContext.StaticData.ReadAllText(themePath);
string json = StaticData.Instance.ReadAllText(themePath);
var themeConfig = JsonConvert.DeserializeObject<ThemeConfig>(json);
themeConfig.EnsureDefaults();

View file

@ -198,7 +198,7 @@ namespace MatterHackers.MatterControl
{
ID = "Export",
Title = "Export".Localize(),
Icon = AggContext.StaticData.LoadIcon("cube_export.png", 16, 16, menuTheme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("cube_export.png", 16, 16, menuTheme.InvertIcons),
Action = () =>
{
ApplicationController.Instance.ExportLibraryItems(
@ -586,7 +586,7 @@ namespace MatterHackers.MatterControl
new NamedAction()
{
ID = "Delete",
Icon = AggContext.StaticData.LoadIcon("remove.png", 16, 16).SetPreMultiply(),
Icon = StaticData.Instance.LoadIcon("remove.png", 16, 16).SetPreMultiply(),
Title = "Remove".Localize(),
Action = sceneContext.Scene.DeleteSelection,
IsEnabled = () => sceneContext.Scene.SelectedItem != null
@ -595,7 +595,7 @@ namespace MatterHackers.MatterControl
{
ID = "Export",
Title = "Export".Localize(),
Icon = AggContext.StaticData.LoadIcon("cube_export.png", 16, 16, invertIcons),
Icon = StaticData.Instance.LoadIcon("cube_export.png", 16, 16, invertIcons),
Action = () =>
{
ApplicationController.Instance.ExportLibraryItems(
@ -655,7 +655,7 @@ namespace MatterHackers.MatterControl
await sceneContext.Scene.AutoArrangeChildren(view3DWidget.BedCenter).ConfigureAwait(false);
},
IsEnabled = () => sceneContext.EditableScene,
Icon = AggContext.StaticData.LoadIcon("arrange_all.png", 16, 16, invertIcons),
Icon = StaticData.Instance.LoadIcon("arrange_all.png", 16, 16, invertIcons),
},
new NamedAction()
{
@ -776,8 +776,8 @@ namespace MatterHackers.MatterControl
this.Library.RegisterContainer(
new DynamicContainerLink(
() => "Downloads".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "download_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "download_icon.png")),
() => new FileSystemContainer(ApplicationDataStorage.Instance.DownloadsDirectory)
{
UseIncrementedNameDuringTypeChange = true,
@ -793,8 +793,8 @@ namespace MatterHackers.MatterControl
this.Library.RegisterContainer(
new DynamicContainerLink(
() => "Library".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "library_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "library_icon.png")),
() => this.Library.LibraryCollectionContainer));
if (File.Exists(ApplicationDataStorage.Instance.CustomLibraryFoldersPath))
@ -818,8 +818,8 @@ namespace MatterHackers.MatterControl
this.Library.RegisterContainer(
new DynamicContainerLink(
() => "History".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "history_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "history_icon.png")),
() => new RootHistoryContainer())
{
IsReadOnly = true
@ -834,8 +834,8 @@ namespace MatterHackers.MatterControl
{
new DynamicContainerLink(
() => "Printers".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "printer_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "printer_icon.png")),
() => new OpenPrintersContainer())
}
}
@ -908,11 +908,11 @@ namespace MatterHackers.MatterControl
HelpArticle helpArticle = null;
string helpPath = Path.Combine("OEMSettings", "toc.json");
if (AggContext.StaticData.FileExists(helpPath))
if (StaticData.Instance.FileExists(helpPath))
{
try
{
helpArticle = JsonConvert.DeserializeObject<HelpArticle>(AggContext.StaticData.ReadAllText(helpPath));
helpArticle = JsonConvert.DeserializeObject<HelpArticle>(StaticData.Instance.ReadAllText(helpPath));
}
catch { }
}
@ -921,7 +921,7 @@ namespace MatterHackers.MatterControl
Object3D.AssetsPath = Path.Combine(ApplicationDataStorage.Instance.ApplicationLibraryDataPath, "Assets");
using (var meshSteam = AggContext.StaticData.OpenStream(Path.Combine("Stls", "missing.stl")))
using (var meshSteam = StaticData.Instance.OpenStream(Path.Combine("Stls", "missing.stl")))
{
Object3D.FileMissingMesh = StlProcessing.Load(meshSteam, CancellationToken.None);
}
@ -1060,7 +1060,7 @@ namespace MatterHackers.MatterControl
{
[NamedTypeFace.Liberation_Sans] = LiberationSansFont.Instance,
[NamedTypeFace.Liberation_Sans_Bold] = LiberationSansBoldFont.Instance,
[NamedTypeFace.Liberation_Mono] = TypeFace.LoadFrom(AggContext.StaticData.ReadAllText(Path.Combine("Fonts", "LiberationMono.svg")))
[NamedTypeFace.Liberation_Mono] = TypeFace.LoadFrom(StaticData.Instance.ReadAllText(Path.Combine("Fonts", "LiberationMono.svg")))
};
private static object locker = new object();
@ -1073,8 +1073,8 @@ namespace MatterHackers.MatterControl
{
var typeFace = new TypeFace();
var path = Path.Combine("Fonts", $"{namedTypeFace}.ttf");
var exists = AggContext.StaticData.FileExists(path);
var stream = exists ? AggContext.StaticData.OpenStream(path) : null;
var exists = StaticData.Instance.FileExists(path);
var stream = exists ? StaticData.Instance.OpenStream(path) : null;
if (stream != null
&& typeFace.LoadTTF(stream))
{
@ -1084,8 +1084,8 @@ namespace MatterHackers.MatterControl
{
// try the svg
path = Path.Combine("Fonts", $"{namedTypeFace}.svg");
exists = AggContext.StaticData.FileExists(path);
typeFace = exists ? TypeFace.LoadFrom(AggContext.StaticData.ReadAllText(path)) : null;
exists = StaticData.Instance.FileExists(path);
typeFace = exists ? TypeFace.LoadFrom(StaticData.Instance.ReadAllText(path)) : null;
if (typeFace != null)
{
TypeFaceCache.Add(namedTypeFace, typeFace);
@ -1112,7 +1112,7 @@ namespace MatterHackers.MatterControl
{
if (titilliumTypeFace == null)
{
titilliumTypeFace = TypeFace.LoadFrom(AggContext.StaticData.ReadAllText(Path.Combine("Fonts", "TitilliumWeb-Black.svg")));
titilliumTypeFace = TypeFace.LoadFrom(StaticData.Instance.ReadAllText(Path.Combine("Fonts", "TitilliumWeb-Black.svg")));
}
return titilliumTypeFace;
@ -1144,10 +1144,10 @@ namespace MatterHackers.MatterControl
try
{
if (staticDataFallbackPath != null
&& AggContext.StaticData.FileExists(staticDataFallbackPath))
&& StaticData.Instance.FileExists(staticDataFallbackPath))
{
return Task.FromResult(
JsonConvert.DeserializeObject<T>(AggContext.StaticData.ReadAllText(staticDataFallbackPath)));
JsonConvert.DeserializeObject<T>(StaticData.Instance.ReadAllText(staticDataFallbackPath)));
}
}
catch
@ -1211,7 +1211,7 @@ namespace MatterHackers.MatterControl
try
{
#if DEBUG
AggContext.StaticData.PurgeCache();
StaticData.Instance.PurgeCache();
#endif
this.IsReloading = true;
@ -1886,7 +1886,7 @@ namespace MatterHackers.MatterControl
}
else
{
using (var stream = AggContext.StaticData.OpenStream(translationFilePath))
using (var stream = StaticData.Instance.OpenStream(translationFilePath))
using (var streamReader = new StreamReader(stream))
{
TranslationMap.ActiveTranslationMap = new TranslationMap(streamReader, UserSettings.Instance.Language);
@ -2140,7 +2140,7 @@ namespace MatterHackers.MatterControl
internal void GetViewOptionButtons(GuiWidget parent, ISceneContext sceneContext, PrinterConfig printer, ThemeConfig theme)
{
var bedButton = new RadioIconButton(AggContext.StaticData.LoadIcon("bed.png", 16, 16, theme.InvertIcons), theme)
var bedButton = new RadioIconButton(StaticData.Instance.LoadIcon("bed.png", 16, 16, theme.InvertIcons), theme)
{
Name = "Bed Button",
ToolTipText = "Show Print Bed".Localize(),
@ -2160,7 +2160,7 @@ namespace MatterHackers.MatterControl
bool BuildHeightValid() => sceneContext.BuildHeight > 0;
var printAreaButton = new RadioIconButton(AggContext.StaticData.LoadIcon("print_area.png", 16, 16, theme.InvertIcons), theme)
var printAreaButton = new RadioIconButton(StaticData.Instance.LoadIcon("print_area.png", 16, 16, theme.InvertIcons), theme)
{
Name = "Bed Button",
ToolTipText = BuildHeightValid() ? "Show Print Area".Localize() : "Define printer build height to enable",
@ -2344,7 +2344,7 @@ namespace MatterHackers.MatterControl
VAnchor = VAnchor.Stretch
};
var icon = AggContext.StaticData.LoadIcon("help_page.png", 16, 16, theme.InvertIcons);
var icon = StaticData.Instance.LoadIcon("help_page.png", 16, 16, theme.InvertIcons);
helpDocsTab = new ChromeTab("HelpDocs", "Help".Localize(), tabControl, helpTreePanel, theme, icon)
{

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl
};
this.AddChild(row);
row.AddChild(new IconButton(AggContext.StaticData.LoadIcon("mh-app-logo.png", 16, 16, theme.InvertIcons), theme)
row.AddChild(new IconButton(StaticData.Instance.LoadIcon("mh-app-logo.png", 16, 16, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Center,
Margin = theme.ButtonSpacing,
@ -87,14 +87,14 @@ namespace MatterHackers.MatterControl
MinimumSize = new Vector2(300, 0)
};
var linkIcon = AggContext.StaticData.LoadIcon("fa-link_16.png", 16, 16, menuTheme.InvertIcons);
var linkIcon = StaticData.Instance.LoadIcon("fa-link_16.png", 16, 16, menuTheme.InvertIcons);
PopupMenu.MenuItem menuItem;
menuItem = popupMenu.CreateMenuItem("Help".Localize(), AggContext.StaticData.LoadIcon("help_page.png", 16, 16, menuTheme.InvertIcons));
menuItem = popupMenu.CreateMenuItem("Help".Localize(), StaticData.Instance.LoadIcon("help_page.png", 16, 16, menuTheme.InvertIcons));
menuItem.Click += (s, e) => ApplicationController.Instance.ShowApplicationHelp();
menuItem = popupMenu.CreateMenuItem("Interface Tour".Localize(), AggContext.StaticData.LoadIcon("tour.png", 16, 16, menuTheme.InvertIcons));
menuItem = popupMenu.CreateMenuItem("Interface Tour".Localize(), StaticData.Instance.LoadIcon("tour.png", 16, 16, menuTheme.InvertIcons));
menuItem.Click += (s, e) =>
{
UiThread.RunOnIdle(() =>
@ -107,7 +107,7 @@ namespace MatterHackers.MatterControl
{
popupMenu.CreateSeparator();
menuItem = popupMenu.CreateMenuItem("Check For Update".Localize(), AggContext.StaticData.LoadIcon("update.png", 16, 16, menuTheme.InvertIcons));
menuItem = popupMenu.CreateMenuItem("Check For Update".Localize(), StaticData.Instance.LoadIcon("update.png", 16, 16, menuTheme.InvertIcons));
menuItem.Click += (s, e) => UiThread.RunOnIdle(() =>
{
UpdateControlData.Instance.CheckForUpdate();
@ -117,7 +117,7 @@ namespace MatterHackers.MatterControl
popupMenu.CreateSeparator();
menuItem = popupMenu.CreateMenuItem("Settings".Localize(), AggContext.StaticData.LoadIcon("fa-cog_16.png", 16, 16, menuTheme.InvertIcons));
menuItem = popupMenu.CreateMenuItem("Settings".Localize(), StaticData.Instance.LoadIcon("fa-cog_16.png", 16, 16, menuTheme.InvertIcons));
menuItem.Click += (s, e) => DialogWindow.Show<ApplicationSettingsPage>();
menuItem.Name = "Settings MenuItem";
@ -127,7 +127,7 @@ namespace MatterHackers.MatterControl
if (IntPtr.Size == 8)
{
indicatorIcon = AggContext.StaticData.LoadIcon("x64.png", 16, 16, menuTheme.InvertIcons);
indicatorIcon = StaticData.Instance.LoadIcon("x64.png", 16, 16, menuTheme.InvertIcons);
}
popupMenu.CreateSubMenu("Community".Localize(), menuTheme, (modifyMenu) =>
@ -146,9 +146,9 @@ namespace MatterHackers.MatterControl
modifyMenu.CreateSeparator();
menuItem = modifyMenu.CreateMenuItem("Report a Bug".Localize(), AggContext.StaticData.LoadIcon("feedback.png", 16, 16, menuTheme.InvertIcons));
menuItem = modifyMenu.CreateMenuItem("Report a Bug".Localize(), StaticData.Instance.LoadIcon("feedback.png", 16, 16, menuTheme.InvertIcons));
menuItem.Click += (s, e) => ApplicationController.LaunchBrowser("https://github.com/MatterHackers/MatterControl/issues");
}, AggContext.StaticData.LoadIcon("feedback.png", 16, 16, menuTheme.InvertIcons));
}, StaticData.Instance.LoadIcon("feedback.png", 16, 16, menuTheme.InvertIcons));
popupMenu.CreateSeparator();

View file

@ -33,6 +33,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.MatterControl.Library;
@ -60,7 +61,7 @@ namespace MatterHackers.MatterControl
{
}
public ImageBuffer DefaultThumbnail() => AggContext.StaticData.LoadIcon("cube.png", 16, 16, Theme.InvertIcons);
public ImageBuffer DefaultThumbnail() => StaticData.Instance.LoadIcon("cube.png", 16, 16, Theme.InvertIcons);
public ImageBuffer LoadCachedImage(string cacheId, int width, int height)
{
@ -81,7 +82,7 @@ namespace MatterHackers.MatterControl
cachedItem = cachedItem.CreateScaledImage(width, height);
cachedItem.SetRecieveBlender(new BlenderPreMultBGRA());
AggContext.ImageIO.SaveImageData(expectedCachePath, cachedItem);
ImageIO.SaveImageData(expectedCachePath, cachedItem);
return cachedItem;
}
@ -89,14 +90,14 @@ namespace MatterHackers.MatterControl
// could not find it in the user cache, try to load it from static data
var staticDataFilename = Path.Combine("Images", "Thumbnails", $"{cacheId}-{256}x{256}.png");
if (AggContext.StaticData.FileExists(staticDataFilename))
if (StaticData.Instance.FileExists(staticDataFilename))
{
cachedItem = AggContext.StaticData.LoadImage(staticDataFilename);
cachedItem = StaticData.Instance.LoadImage(staticDataFilename);
cachedItem.SetRecieveBlender(new BlenderPreMultBGRA());
cachedItem = cachedItem.CreateScaledImage(width, height);
AggContext.ImageIO.SaveImageData(expectedCachePath, cachedItem);
ImageIO.SaveImageData(expectedCachePath, cachedItem);
return cachedItem;
}
@ -127,7 +128,7 @@ namespace MatterHackers.MatterControl
cachedItem = cachedItem.CreateScaledImage(width, height);
cachedItem.SetRecieveBlender(new BlenderPreMultBGRA());
AggContext.ImageIO.SaveImageData(expectedCachePath, cachedItem);
ImageIO.SaveImageData(expectedCachePath, cachedItem);
return cachedItem;
}
@ -135,14 +136,14 @@ namespace MatterHackers.MatterControl
// could not find it in the user cache, try to load it from static data
var staticDataFilename = Path.Combine("Images", "Thumbnails", CacheFilename(libraryItem, 256, 256));
if (AggContext.StaticData.FileExists(staticDataFilename))
if (StaticData.Instance.FileExists(staticDataFilename))
{
cachedItem = AggContext.StaticData.LoadImage(staticDataFilename);
cachedItem = StaticData.Instance.LoadImage(staticDataFilename);
cachedItem.SetRecieveBlender(new BlenderPreMultBGRA());
cachedItem = cachedItem.CreateScaledImage(width, height);
AggContext.ImageIO.SaveImageData(expectedCachePath, cachedItem);
ImageIO.SaveImageData(expectedCachePath, cachedItem);
return cachedItem;
}
@ -241,7 +242,7 @@ namespace MatterHackers.MatterControl
{
if (File.Exists(filePath))
{
return AggContext.ImageIO.LoadImage(filePath).SetPreMultiply();
return ImageIO.LoadImage(filePath).SetPreMultiply();
}
}
catch { } // Suppress exceptions, return null on any errors

View file

@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl
Mesh logoMesh;
using (var logoStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "MH Logo.stl")))
using (var logoStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "MH Logo.stl")))
{
logoMesh = StlProcessing.Load(logoStream, CancellationToken.None);
}

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.Library;
@ -57,8 +58,8 @@ namespace MatterHackers.MatterControl
wrappedLibrary.ExtraContainers.Add(
new DynamicContainerLink(
() => printer.Settings.GetValue(SettingsKey.printer_name),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "printer_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "printer_icon.png")),
() => new PrinterContainer(printer))
{
IsReadOnly = true

View file

@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
@ -94,7 +95,7 @@ namespace MatterHackers.MatterControl
scene.SelectedItem = baseMesh;
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("add_base.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("add_base.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A path must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is IPathObject),
};
@ -241,7 +242,7 @@ namespace MatterHackers.MatterControl
&& componentObject.Finalized
&& !componentObject.ProOnly;
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("scale_32x32.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("scale_32x32.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A component must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is ImageObject3D),
};
@ -327,7 +328,7 @@ namespace MatterHackers.MatterControl
// Invalidate image to kick off rebuild of ImageConverter stack
imageObject.Invalidate(InvalidateType.Image);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("image_converter.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("image_converter.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*An image must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is ImageObject3D,
};
@ -362,7 +363,7 @@ namespace MatterHackers.MatterControl
path.Invalidate(InvalidateType.Properties);
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("image_to_path.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("image_to_path.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*An image must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is ImageObject3D,
};
@ -392,7 +393,7 @@ namespace MatterHackers.MatterControl
inflatePath.Invalidate(InvalidateType.Properties);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("inflate_path.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("inflate_path.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A path must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is IPathObject,
};
@ -426,7 +427,7 @@ namespace MatterHackers.MatterControl
extrude.Invalidate(InvalidateType.Properties);
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("linear_extrude.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("linear_extrude.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A path must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is IPathObject,
};
@ -460,7 +461,7 @@ namespace MatterHackers.MatterControl
revolve.Invalidate(InvalidateType.Properties);
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("revolve.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("revolve.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A path must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is IPathObject,
};
@ -504,7 +505,7 @@ namespace MatterHackers.MatterControl
scene.UndoBuffer.AddAndDo(new ReplaceCommand(items, new[] { component }));
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("component.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("component.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) =>
{
@ -527,7 +528,7 @@ namespace MatterHackers.MatterControl
{
new MirrorObject3D_2().WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("mirror_32x32.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("mirror_32x32.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -557,7 +558,7 @@ namespace MatterHackers.MatterControl
outlinePath.Invalidate(InvalidateType.Properties);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("outline.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("outline.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A path must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is IPathObject,
};
@ -574,7 +575,7 @@ namespace MatterHackers.MatterControl
{
new RotateObject3D_2().WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon(Path.Combine("ViewTransformControls", "rotate.png"), 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon(Path.Combine("ViewTransformControls", "rotate.png"), 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null,
};
@ -591,7 +592,7 @@ namespace MatterHackers.MatterControl
{
new ScaleObject3D().WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("scale_32x32.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("scale_32x32.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null,
};
@ -621,7 +622,7 @@ namespace MatterHackers.MatterControl
smoothPath.Invalidate(InvalidateType.Properties);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("smooth_path.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("smooth_path.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*A path must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && sceneContext.Scene.SelectedItem is IPathObject,
};
@ -638,7 +639,7 @@ namespace MatterHackers.MatterControl
{
new TranslateObject3D().WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon(Path.Combine("ViewTransformControls", "translate.png"), 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon(Path.Combine("ViewTransformControls", "translate.png"), 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null,
};
@ -659,7 +660,7 @@ namespace MatterHackers.MatterControl
};
array.AddSelectionAsChildren(sceneContext.Scene, sceneContext.Scene.SelectedItem);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("array_advanced.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("array_advanced.png", 16, 16).SetPreMultiply(),
HelpTextResolver = () => "*A single part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is SelectionGroupObject3D),
};
@ -679,7 +680,7 @@ namespace MatterHackers.MatterControl
var align = new AlignObject3D();
align.AddSelectionAsChildren(scene, selectedItem);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("align_left_dark.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("align_left_dark.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 2 parts must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem is SelectionGroupObject3D,
};
@ -699,7 +700,7 @@ namespace MatterHackers.MatterControl
{
return sceneContext.EditableScene && sceneContext.Scene.VisibleMeshes().Any();
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("arrange_all.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("arrange_all.png", 16, 16, invertIcon).SetPreMultiply(),
ShowInModifyMenu = (sceneContext) => false,
};
}
@ -911,8 +912,8 @@ namespace MatterHackers.MatterControl
// default operations
PrimaryOperations.Add(typeof(Object3D), new List<SceneOperation> { SceneOperations.ById("Scale") });
Icons.Add(typeof(ImageObject3D), (invertIcon) => AggContext.StaticData.LoadIcon("image_converter.png", 16, 16, invertIcon).SetPreMultiply());
// Icons.Add(typeof(CubeObject3D), (invertIcon) => AggContext.StaticData.LoadIcon("image_converter.png", 16, 16, invertIcon).SetPreMultiply());
Icons.Add(typeof(ImageObject3D), (invertIcon) => StaticData.Instance.LoadIcon("image_converter.png", 16, 16, invertIcon).SetPreMultiply());
// Icons.Add(typeof(CubeObject3D), (invertIcon) => StaticData.Instance.LoadIcon("image_converter.png", 16, 16, invertIcon).SetPreMultiply());
}
private static SceneOperation CombineOperation()
@ -933,7 +934,7 @@ namespace MatterHackers.MatterControl
new CombineObject3D_2().WrapSelectedItemAndSelect(sceneContext.Scene);
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("combine.png", 16, 16, !invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("combine.png", 16, 16, !invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 2 parts must be selected*".Localize(),
IsEnabled = (sceneContext) => BooleanCandidate(sceneContext.Scene.SelectedItem),
};
@ -951,7 +952,7 @@ namespace MatterHackers.MatterControl
var curve = new CurveObject3D_2();
curve.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("curve.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("curve.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -987,7 +988,7 @@ namespace MatterHackers.MatterControl
scene.UndoBuffer.AddAndDo(new TransformCommand(transformData));
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("dual_align.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("dual_align.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 2 parts must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem is SelectionGroupObject3D,
};
@ -1001,7 +1002,7 @@ namespace MatterHackers.MatterControl
Action = (sceneContext) => sceneContext.DuplicateItem(5),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null,
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("duplicate.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("duplicate.png", 16, 16).SetPreMultiply(),
};
}
@ -1024,7 +1025,7 @@ namespace MatterHackers.MatterControl
scene.UndoBuffer.AddAndDo(new ReplaceCommand(new[] { selectedItem }, new[] { fit }));
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("fit.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("fit.png", 16, 16, invertIcon),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is SelectionGroupObject3D),
};
}
@ -1048,7 +1049,7 @@ namespace MatterHackers.MatterControl
scene.UndoBuffer.AddAndDo(new ReplaceCommand(new[] { selectedItem }, new[] { fit }));
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("fit.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("fit.png", 16, 16, invertIcon),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is SelectionGroupObject3D),
};
}
@ -1095,7 +1096,7 @@ namespace MatterHackers.MatterControl
&& scene.SelectedItem != null
&& scene.SelectedItem is SelectionGroupObject3D
&& scene.SelectedItem.Children.Count > 1,
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("group.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("group.png", 16, 16).SetPreMultiply(),
};
}
@ -1111,7 +1112,7 @@ namespace MatterHackers.MatterControl
var hollowOut = new HollowOutObject3D();
hollowOut.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("hollow.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("hollow.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1135,7 +1136,7 @@ namespace MatterHackers.MatterControl
new IntersectionObject3D_2().WrapSelectedItemAndSelect(sceneContext.Scene);
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("intersect.png", 16, 16),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("intersect.png", 16, 16),
HelpTextResolver = () => "*At least 2 parts must be selected*".Localize(),
IsEnabled = (sceneContext) => BooleanCandidate(sceneContext.Scene.SelectedItem),
};
@ -1177,7 +1178,7 @@ namespace MatterHackers.MatterControl
},
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null,
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("lay_flat.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("lay_flat.png", 16, 16, invertIcon).SetPreMultiply(),
};
}
@ -1196,7 +1197,7 @@ namespace MatterHackers.MatterControl
};
array.AddSelectionAsChildren(sceneContext.Scene, sceneContext.Scene.SelectedItem);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("array_linear.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("array_linear.png", 16, 16).SetPreMultiply(),
HelpTextResolver = () => "*A single part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is SelectionGroupObject3D),
};
@ -1214,7 +1215,7 @@ namespace MatterHackers.MatterControl
var pinch = new PinchObject3D_2();
pinch.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("pinch.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("pinch.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1232,7 +1233,7 @@ namespace MatterHackers.MatterControl
var cut = new PlaneCutObject3D();
cut.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("plane_cut.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("plane_cut.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1253,7 +1254,7 @@ namespace MatterHackers.MatterControl
};
array.AddSelectionAsChildren(sceneContext.Scene, sceneContext.Scene.SelectedItem);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("array_radial.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("array_radial.png", 16, 16).SetPreMultiply(),
HelpTextResolver = () => "*A single part must be selected*".Localize(),
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null && !(sceneContext.Scene.SelectedItem is SelectionGroupObject3D),
};
@ -1271,7 +1272,7 @@ namespace MatterHackers.MatterControl
var hollowOut = new DecimateObject3D();
hollowOut.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("reduce.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("reduce.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1305,7 +1306,7 @@ namespace MatterHackers.MatterControl
{
Action = (sceneContext) => sceneContext.Scene.DeleteSelection(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("remove.png", 16, 16, !invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("remove.png", 16, 16, !invertIcon).SetPreMultiply(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
ShowInModifyMenu = (sceneContext) => false,
TitleResolver = () => "Remove".Localize(),
@ -1324,7 +1325,7 @@ namespace MatterHackers.MatterControl
var hollowOut = new RepairObject3D();
hollowOut.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("repair.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("repair.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1338,7 +1339,7 @@ namespace MatterHackers.MatterControl
ResultType = typeof(SubtractAndReplaceObject3D_2),
TitleResolver = () => "Subtract & Replace".Localize(),
Action = (sceneContext) => new SubtractAndReplaceObject3D_2().WrapSelectedItemAndSelect(sceneContext.Scene),
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("subtract_and_replace.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("subtract_and_replace.png", 16, 16).SetPreMultiply(),
HelpTextResolver = () => "*At least 2 parts must be selected*".Localize(),
IsEnabled = (sceneContext) => BooleanCandidate(sceneContext.Scene.SelectedItem, false),
};
@ -1362,7 +1363,7 @@ namespace MatterHackers.MatterControl
new SubtractObject3D_2().WrapSelectedItemAndSelect(sceneContext.Scene);
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("subtract.png", 16, 16).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("subtract.png", 16, 16).SetPreMultiply(),
HelpTextResolver = () => "*At least 2 parts must be selected*".Localize(),
IsEnabled = (sceneContext) => BooleanCandidate(sceneContext.Scene.SelectedItem),
};
@ -1392,7 +1393,7 @@ namespace MatterHackers.MatterControl
scene.UndoBuffer.AddAndDo(new SetOutputType(selectedItem, allAreSupport ? PrintOutputTypes.Default : PrintOutputTypes.Support));
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("support.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("support.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1423,7 +1424,7 @@ namespace MatterHackers.MatterControl
scene.UndoBuffer.AddAndDo(new SetOutputType(selectedItem, allAreWipeTower ? PrintOutputTypes.Default : PrintOutputTypes.WipeTower));
}
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("wipe_tower.png", 16, 16, invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("wipe_tower.png", 16, 16, invertIcon).SetPreMultiply(),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1441,7 +1442,7 @@ namespace MatterHackers.MatterControl
var twist = new TwistObject3D();
twist.WrapSelectedItemAndSelect(sceneContext.Scene);
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("twist.png", 16, 16, invertIcon),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("twist.png", 16, 16, invertIcon),
HelpTextResolver = () => "*At least 1 part must be selected*".Localize(),
IsEnabled = (sceneContext) => IsMeshObject(sceneContext.Scene.SelectedItem),
};
@ -1466,7 +1467,7 @@ namespace MatterHackers.MatterControl
return false;
},
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("ungroup.png", 16, 16, !invertIcon).SetPreMultiply(),
Icon = (invertIcon) => StaticData.Instance.LoadIcon("ungroup.png", 16, 16, !invertIcon).SetPreMultiply(),
};
}
}

View file

@ -50,7 +50,7 @@ namespace MatterHackers.MatterControl
path = directory;
this.Name = Path.GetFileName(directory);
this.ThemeNames = AggContext.StaticData.GetFiles(directory).Where(p => Path.GetExtension(p) == ".themeset").Select(p => Path.GetFileNameWithoutExtension(p)).ToArray();
this.ThemeNames = StaticData.Instance.GetFiles(directory).Where(p => Path.GetExtension(p) == ".themeset").Select(p => Path.GetFileNameWithoutExtension(p)).ToArray();
}
public string Name { get; }
@ -88,12 +88,12 @@ namespace MatterHackers.MatterControl
try
{
themeset = JsonConvert.DeserializeObject<ThemeSet>(
AggContext.StaticData.ReadAllText(Path.Combine(path, themeName + ".themeset")));
StaticData.Instance.ReadAllText(Path.Combine(path, themeName + ".themeset")));
}
catch
{
themeset = JsonConvert.DeserializeObject<ThemeSet>(
AggContext.StaticData.ReadAllText(Path.Combine(path, this.ThemeNames.First() + ".themeset")));
StaticData.Instance.ReadAllText(Path.Combine(path, this.ThemeNames.First() + ".themeset")));
}
themeset.Theme = AppContext.LoadTheme(themeset.ThemeID);

View file

@ -269,7 +269,7 @@ namespace MatterHackers.MatterControl
public GuiWidget CreateSearchButton()
{
return new IconButton(AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, this.InvertIcons), this)
return new IconButton(StaticData.Instance.LoadIcon("icon_search_24x24.png", 16, 16, this.InvertIcons), this)
{
ToolTipText = "Search".Localize(),
};
@ -295,7 +295,7 @@ namespace MatterHackers.MatterControl
restoreNormal = ColorCircle(size, (AggContext.OperatingSystem == OSType.Android) ? new Color(200, 0, 0) : Color.Transparent);
restoreHover = ColorCircle(size, new Color("#DB4437"));
this.GeneratingThumbnailIcon = AggContext.StaticData.LoadIcon("building_thumbnail_40x40.png", 40, 40, this.InvertIcons);
this.GeneratingThumbnailIcon = StaticData.Instance.LoadIcon("building_thumbnail_40x40.png", 40, 40, this.InvertIcons);
ScrollBar.DefaultThumbView.ThumbColor = new Color(this.TextColor, 30);
}

View file

@ -81,7 +81,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage
this.CreateThemeModeButtons();
}
public ImageBuffer CheckMark { get; } = AggContext.StaticData.LoadIcon("fa-check_16.png", 16, 16, invertImage: true);
public ImageBuffer CheckMark { get; } = StaticData.Instance.LoadIcon("fa-check_16.png", 16, 16, invertImage: true);
private Color accentPanelColor;

View file

@ -322,7 +322,7 @@ namespace MatterHackers.MatterControl
static CalibrationPad()
{
activeIcon = AggContext.StaticData.LoadIcon("fa-check_16.png", 16, 16, true);
activeIcon = StaticData.Instance.LoadIcon("fa-check_16.png", 16, 16, true);
inactiveIcon = new ImageBuffer(16, 16);
}

View file

@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
string imageFile = this.ControlIsPinned ? "Pushpin_16x.png" : "PushpinUnpin_16x.png";
var pinTabButton = new IconButton(AggContext.StaticData.LoadIcon(imageFile, 16, 16, theme.InvertIcons), theme)
var pinTabButton = new IconButton(StaticData.Instance.LoadIcon(imageFile, 16, 16, theme.InvertIcons), theme)
{
Name = "Pin Settings Button"
};

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.ActionArea.VAnchor = VAnchor.Stretch;
this.ActionArea.MinimumSize = new Vector2(0, titleText.Height);
var editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme)
var editButton = new IconButton(StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = editToolTipText ?? "Edit".Localize(),
Name = helpArticle.Name + " Edit"

View file

@ -41,7 +41,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
public InlineListItemEdit(string title, ThemeConfig theme, string automationName, bool boldFont = false)
: base(title, theme, automationName, boldFont)
{
var removeButton = new IconButton(AggContext.StaticData.LoadIcon("remove.png", 16, 16, theme.InvertIcons), theme)
var removeButton = new IconButton(StaticData.Instance.LoadIcon("remove.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Delete".Localize(),
Visible = true,

View file

@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.ActionArea.VAnchor = VAnchor.Stretch;
this.ActionArea.MinimumSize = new Vector2(0, titleText.Height);
saveButton = new IconButton(AggContext.StaticData.LoadIcon("fa-save_16.png", 16, 16, theme.InvertIcons), theme)
saveButton = new IconButton(StaticData.Instance.LoadIcon("fa-save_16.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Save".Localize(),
Visible = false,
@ -104,7 +104,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
rightPanel = new FlowLayoutWidget();
var icon = editable ? AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons) : new ImageBuffer(16, 16);
var icon = editable ? StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons) : new ImageBuffer(16, 16);
editButton = new IconButton(icon, theme)
{

View file

@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
this.CloseAllChildren();
var upbutton = new IconButton(AggContext.StaticData.LoadIcon(Path.Combine("Library", "upfolder_20.png"), 20, 20, theme.InvertIcons), theme)
var upbutton = new IconButton(StaticData.Instance.LoadIcon(Path.Combine("Library", "upfolder_20.png"), 20, 20, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Fit | VAnchor.Center,
Enabled = currentContainer.Parent != null,

View file

@ -505,8 +505,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
public TreeExpandWidget(ThemeConfig theme)
{
arrowRight = AggContext.StaticData.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons);
arrowDown = AggContext.StaticData.LoadIcon("fa-angle-down_12.png", 12, 12, theme.InvertIcons);
arrowRight = StaticData.Instance.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons);
arrowDown = StaticData.Instance.LoadIcon("fa-angle-down_12.png", 12, 12, theme.InvertIcons);
placeholder = new ImageBuffer(16, 16);
this.Margin = new BorderDouble(right: 4);

View file

@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl.DesignTools
[Description("Create a hook so the Braille can be hung from a necklace or keychain.")]
public bool AddHook { get; set; }
static TypeFace typeFace = TypeFace.LoadFrom(AggContext.StaticData.ReadAllText(Path.Combine("Fonts", "Braille.svg")));
static TypeFace typeFace = TypeFace.LoadFrom(StaticData.Instance.ReadAllText(Path.Combine("Fonts", "Braille.svg")));
public override async void OnInvalidate(InvalidateArgs invalidateType)
{

View file

@ -34,6 +34,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using ClipperLib;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.Transform;
using MatterHackers.Agg.VertexSource;
@ -109,7 +110,7 @@ namespace MatterHackers.MatterControl.DesignTools
using (RebuildLock())
{
var currentAssetPath = ImageObject == null ? AggContext.StaticData.ToAssetPath(Path.Combine("Images", "mh-logo.png")) : ImageObject.AssetPath;
var currentAssetPath = ImageObject == null ? StaticData.Instance.ToAssetPath(Path.Combine("Images", "mh-logo.png")) : ImageObject.AssetPath;
this.Children.Modify((list) =>
{

View file

@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project.
*/
using System.Linq;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
using MatterHackers.DataConverters3D;
@ -87,7 +88,7 @@ namespace MatterHackers.MatterControl.Plugins.Lithophane
IsEnabled = (sceneContext) => sceneContext?.Scene?.SelectedItem is ImageObject3D,
HelpTextResolver = () => "*An image must be selected*".Localize(),
ShowInModifyMenu = (sceneContext) => sceneContext?.Scene?.SelectedItem is ImageObject3D,
Icon = (invertIcon) => AggContext.StaticData.LoadIcon("lithophane.png", 16, 16, invertIcon)
Icon = (invertIcon) => StaticData.Instance.LoadIcon("lithophane.png", 16, 16, invertIcon)
},
"Image");
}

View file

@ -131,7 +131,7 @@ namespace MatterHackers.MatterControl.Library
updateButton.Click += async (s, e) =>
{
using (var meshStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "openscad_logo.stl")))
using (var meshStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "openscad_logo.stl")))
{
using (new CenterAndHeightMaintainer(this.item))
{

View file

@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.DataConverters3D;
using MatterHackers.Localizations;
@ -77,7 +78,7 @@ namespace MatterHackers.MatterControl.Library
{
if (Mesh == null)
{
using (var meshStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "openscad_logo.stl")))
using (var meshStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "openscad_logo.stl")))
{
using (new CenterAndHeightMaintainer(this))
{

View file

@ -147,7 +147,7 @@ namespace MatterHackers.MatterControl.DesignTools
try
{
assetStream = streamTask.Result;
imageBuffer = AggContext.ImageIO.LoadImage(assetStream);
imageBuffer = ImageIO.LoadImage(assetStream);
}
catch { }

View file

@ -59,7 +59,7 @@ namespace MatterHackers.MatterControl.DesignTools
if (shape == null)
{
using (Stream measureAmfStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "measure_tool.stl")))
using (Stream measureAmfStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "measure_tool.stl")))
{
shape = StlProcessing.Load(measureAmfStream, CancellationToken.None);
}

View file

@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.DesignTools
if (shape == null)
{
using (Stream measureAmfStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "CC - gaaZolee - AS.amf")))
using (Stream measureAmfStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "CC - gaaZolee - AS.amf")))
{
var amfObject = AmfDocument.Load(measureAmfStream, CancellationToken.None);
shape = amfObject.Children.First().Mesh;

View file

@ -928,7 +928,7 @@ namespace MatterHackers.MatterControl.DesignTools
public static GuiWidget GetUnlockRow(ThemeConfig theme, string url)
{
var detailsLink = new TextIconButton("Unlock".Localize(), AggContext.StaticData.LoadIcon("locked.png", 16, 16, theme.InvertIcons), theme)
var detailsLink = new TextIconButton("Unlock".Localize(), StaticData.Instance.LoadIcon("locked.png", 16, 16, theme.InvertIcons), theme)
{
Margin = 5,
ToolTipText = "Visit MatterHackers.com to Purchase".Localize()
@ -946,7 +946,7 @@ namespace MatterHackers.MatterControl.DesignTools
{
if (context.item.GetType().GetCustomAttributes(typeof(WebPageLinkAttribute), true).FirstOrDefault() is WebPageLinkAttribute unlockLink)
{
var detailsLink = new TextIconButton(unlockLink.Name.Localize(), AggContext.StaticData.LoadIcon("internet.png", 16, 16, theme.InvertIcons), theme)
var detailsLink = new TextIconButton(unlockLink.Name.Localize(), StaticData.Instance.LoadIcon("internet.png", 16, 16, theme.InvertIcons), theme)
{
BackgroundColor = theme.MinimalShade,
ToolTipText = unlockLink.Url,

View file

@ -108,7 +108,7 @@ namespace MatterControlLib
writer.DeleteAll();
// Build index from help-docs.zip
using (var file = AggContext.StaticData.OpenStream(filePath))
using (var file = StaticData.Instance.OpenStream(filePath))
using (var zip = new ZipArchive(file, ZipArchiveMode.Read))
{
var tocEntry = zip.Entries.FirstOrDefault(e => e.FullName == "toc.json");

View file

@ -114,9 +114,9 @@ namespace MatterHackers.MatterControl.PrintHistory
var size = (int)(buttonFontSize * GuiWidget.DeviceScale);
var star = AggContext.StaticData.LoadIcon("star.png", size, size, theme.InvertIcons);
var openStar = AggContext.StaticData.LoadIcon("open_star.png", size, size, theme.InvertIcons);
var failure = AggContext.StaticData.LoadIcon("failure.png", size, size, theme.InvertIcons);
var star = StaticData.Instance.LoadIcon("star.png", size, size, theme.InvertIcons);
var openStar = StaticData.Instance.LoadIcon("open_star.png", size, size, theme.InvertIcons);
var failure = StaticData.Instance.LoadIcon("failure.png", size, size, theme.InvertIcons);
content.AddChild(new GuiWidget(size, 1));

View file

@ -31,6 +31,7 @@ using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.DataConverters3D;
@ -83,7 +84,7 @@ namespace MatterHackers.MatterControl.DesignTools
using (var streamAndLength = await streamInterface.GetStream(null))
{
var imageBuffer = new ImageBuffer();
if (AggContext.ImageIO.LoadImageData(streamAndLength.Stream, imageBuffer))
if (ImageIO.LoadImageData(streamAndLength.Stream, imageBuffer))
{
imageBuffer.SetRecieveBlender(new BlenderPreMultBGRA());
return imageBuffer;
@ -104,7 +105,7 @@ namespace MatterHackers.MatterControl.DesignTools
thumbnail = LibraryProviderHelpers.ResizeImage(thumbnail, width, height);
// Cache library thumbnail
AggContext.ImageIO.SaveImageData(
ImageIO.SaveImageData(
ApplicationController.Instance.Thumbnails.CachePath(item, width, height),
thumbnail);
}
@ -113,6 +114,6 @@ namespace MatterHackers.MatterControl.DesignTools
});
}
public ImageBuffer DefaultImage => AggContext.StaticData.LoadIcon("image_converter.png", 16, 16);
public ImageBuffer DefaultImage => StaticData.Instance.LoadIcon("image_converter.png", 16, 16);
}
}

View file

@ -34,6 +34,7 @@ namespace MatterHackers.MatterControl
using System;
using System.IO;
using System.Threading;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.DataConverters3D;
@ -136,12 +137,12 @@ namespace MatterHackers.MatterControl
if (thumbnail != null)
{
// Cache content thumbnail
AggContext.ImageIO.SaveImageData(
ImageIO.SaveImageData(
ApplicationController.Instance.Thumbnails.CachePath(object3D.MeshRenderId().ToString(), width, height),
thumbnail);
// Cache library thumbnail
AggContext.ImageIO.SaveImageData(
ImageIO.SaveImageData(
ApplicationController.Instance.Thumbnails.CachePath(libraryItem, width, height),
thumbnail);
}
@ -188,7 +189,7 @@ namespace MatterHackers.MatterControl
{
theme = AppContext.Theme;
defaultIcon = AggContext.StaticData.LoadIcon("mesh.png", theme.InvertIcons); //.AnyAlphaToColor(theme.PrimaryAccentColor);
defaultIcon = StaticData.Instance.LoadIcon("mesh.png", theme.InvertIcons); //.AnyAlphaToColor(theme.PrimaryAccentColor);
}
return defaultIcon;

View file

@ -31,6 +31,7 @@ using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.DataConverters3D;
@ -48,7 +49,7 @@ namespace MatterHackers.MatterControl.Plugins
{
Mesh logomesh = null;
using (var meshStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "openscad_logo.stl")))
using (var meshStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "openscad_logo.stl")))
{
logomesh = Object3D.Load(meshStream, ".stl", CancellationToken.None).Mesh;
}
@ -66,6 +67,6 @@ namespace MatterHackers.MatterControl.Plugins
return Task.FromResult<ImageBuffer>(null);
}
public ImageBuffer DefaultImage => AggContext.StaticData.LoadIcon("image_converter.png", 16, 16);
public ImageBuffer DefaultImage => StaticData.Instance.LoadIcon("image_converter.png", 16, 16);
}
}

View file

@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.Library.Export
public string ExtensionFilter => "Save as AMF|*.amf";
public ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "amf.png"));
public ImageBuffer Icon { get; } = StaticData.Instance.LoadIcon(Path.Combine("filetypes", "amf.png"));
public void Initialize(PrinterConfig printer)
{

View file

@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.Library.Export
public string ExtensionFilter => "";
public ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "folder.png")).SetPreMultiply();
public ImageBuffer Icon { get; } = StaticData.Instance.LoadIcon(Path.Combine("filetypes", "folder.png")).SetPreMultiply();
public void Initialize(PrinterConfig printer)
{

View file

@ -68,7 +68,7 @@ namespace MatterHackers.MatterControl.Library.Export
public virtual string ExtensionFilter => "Export GCode|*.gcode";
public virtual ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "gcode.png"));
public virtual ImageBuffer Icon { get; } = StaticData.Instance.LoadIcon(Path.Combine("filetypes", "gcode.png"));
public void Initialize(PrinterConfig printer)
{

View file

@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.Library.Export
public string ExtensionFilter => "Save as STL|*.stl";
public ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "stl.png"));
public ImageBuffer Icon { get; } = StaticData.Instance.LoadIcon(Path.Combine("filetypes", "stl.png"));
public void Initialize(PrinterConfig printer)
{

View file

@ -50,7 +50,7 @@ namespace MatterHackers.MatterControl.Library.Export
public string ExtensionFilter => "Save as ZIP|*.zip";
public ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "zip.png"));
public ImageBuffer Icon { get; } = StaticData.Instance.LoadIcon(Path.Combine("filetypes", "zip.png"));
public void Initialize(PrinterConfig printer)
{

View file

@ -254,7 +254,7 @@ namespace MatterHackers.MatterControl.Library
{
return Task.FromResult(new StreamAndLength()
{
Stream = AggContext.StaticData.OpenStream(AssetPath),
Stream = StaticData.Instance.OpenStream(AssetPath),
Length = -1
});
}

View file

@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
@ -66,9 +67,9 @@ namespace MatterHackers.MatterControl.Library
{
public Dictionary<string, IContentProvider> ContentProviders = new Dictionary<string, IContentProvider>();
private static ImageBuffer defaultFolderIcon = AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")).SetPreMultiply();
private static ImageBuffer defaultFolderIcon = StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")).SetPreMultiply();
public static ImageBuffer DefaultItemIcon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("Library", "file.png"));
public static ImageBuffer DefaultItemIcon { get; } = StaticData.Instance.LoadIcon(Path.Combine("Library", "file.png"));
private ILibraryContainer activeContainer;

View file

@ -50,7 +50,7 @@ namespace MatterHackers.MatterControl.Library
public override void Load()
{
var oemParts = AggContext.StaticData.GetFiles(Path.Combine("OEMSettings", "SampleParts"));
var oemParts = StaticData.Instance.GetFiles(Path.Combine("OEMSettings", "SampleParts"));
Items = oemParts.Select(s => new StaticDataItem(s)).ToList<ILibraryItem>();
Items.Add(new GeneratorItem(
@ -127,7 +127,7 @@ namespace MatterHackers.MatterControl.Library
{
return Task.FromResult(new StreamAndLength()
{
Stream = AggContext.StaticData.OpenStream(AssetPath),
Stream = StaticData.Instance.OpenStream(AssetPath),
Length = -1
});
}

View file

@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.VertexSource;
using MatterHackers.DataConverters3D;
@ -55,16 +56,16 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Local Library".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "local_library_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "local_library_icon.png")),
() => new SqliteLibraryContainer(rootLibraryCollection.Id)));
}
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Calibration Parts".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "calibration_library_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "calibration_library_icon.png")),
() => new CalibrationPartsContainer())
{
IsReadOnly = true
@ -73,8 +74,8 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Primitives".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "primitives_library_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "primitives_library_icon.png")),
() => new PrimitivesContainer())
{
IsReadOnly = true
@ -91,8 +92,8 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Print Queue".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "queue_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "queue_icon.png")),
() => new PrintQueueContainer()));
}
@ -100,7 +101,7 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Pipe Works".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
null,
() => new PipeWorksContainer())
{
@ -112,7 +113,7 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Experimental".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
null,
() => new DynamicContainer()
{

View file

@ -31,6 +31,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.DataConverters3D;
using MatterHackers.Localizations;
@ -119,7 +120,7 @@ namespace MatterHackers.MatterControl.Library
// Construct an image
var imageObject = new ImageObject3D()
{
AssetPath = AggContext.StaticData.ToAssetPath(Path.Combine("Images", "mh-logo.png"))
AssetPath = StaticData.Instance.ToAssetPath(Path.Combine("Images", "mh-logo.png"))
};
// Construct a scene

View file

@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.DataStorage;
@ -50,8 +51,8 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Plating History".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "history_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "history_icon.png")),
() => new PlatingHistoryContainer())
{
IsReadOnly = true
@ -60,8 +61,8 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "Print History".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "history_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "history_icon.png")),
() => new PrintHistoryContainer()
{
DefaultSort = new SortBehavior()

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Localizations;
@ -40,7 +41,7 @@ namespace MatterHackers.MatterControl.Library
public MissingFileItem(string name)
: base("Missing".Localize() + "-" + name)
{
this.Thumbnail = AggContext.StaticData.LoadIcon("part_icon_transparent_40x40.png");
this.Thumbnail = StaticData.Instance.LoadIcon("part_icon_transparent_40x40.png");
}
}

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.SlicerConfiguration;
@ -54,8 +55,8 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => printer.Settings.GetValue(SettingsKey.printer_name),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "printer_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "printer_icon.png")),
() => new PrinterContainer(printer),
() =>
{

View file

@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.IO;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.SlicerConfiguration;
@ -56,8 +57,8 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => "SD Card".Localize(),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
AggContext.StaticData.LoadIcon(Path.Combine("Library", "sd_icon.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "sd_icon.png")),
() => new SDCardContainer(printer),
() =>
{
@ -77,7 +78,7 @@ namespace MatterHackers.MatterControl.Library
this.ChildContainers.Add(
new DynamicContainerLink(
() => containerName,
AggContext.StaticData.LoadIcon(Path.Combine("Library", "folder.png")),
StaticData.Instance.LoadIcon(Path.Combine("Library", "folder.png")),
() => new GitHubContainer(containerName,
"MatterHackers",
repository,

View file

@ -32,6 +32,7 @@ using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
@ -88,7 +89,7 @@ namespace MatterHackers.MatterControl.Library
public override Task<ImageBuffer> GetThumbnail(ILibraryItem item, int width, int height)
{
return Task.FromResult(
AggContext.StaticData.LoadIcon(
StaticData.Instance.LoadIcon(
Path.Combine((width > 50 || height > 50) ? "icon_sd_card_115x115.png" : "icon_sd_card_50x50.png"),
ApplicationController.Instance.Theme.InvertIcons));
}

View file

@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
using System;
using System.Linq;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
@ -42,7 +43,7 @@ namespace MatterHackers.MatterControl.Library
static LocalZipContainerLink()
{
Thumbnail = AggContext.StaticData.LoadIcon(System.IO.Path.Combine("Library", "zip_folder.png")).AlphaToPrimaryAccent().SetPreMultiply();
Thumbnail = StaticData.Instance.LoadIcon(System.IO.Path.Combine("Library", "zip_folder.png")).AlphaToPrimaryAccent().SetPreMultiply();
}
public virtual Task<ImageBuffer> GetThumbnail(ILibraryItem item, int width, int height)

View file

@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
// Must come before pathButton.Click definition
RadioButton copyAndCalibrateOption = null;
var openButton = new IconButton(AggContext.StaticData.LoadIcon("fa-folder-open_16.png", 16, 16, theme.InvertIcons), theme)
var openButton = new IconButton(StaticData.Instance.LoadIcon("fa-folder-open_16.png", 16, 16, theme.InvertIcons), theme)
{
BackgroundColor = theme.MinimalShade,
Margin = new BorderDouble(left: 8)

View file

@ -54,8 +54,8 @@ namespace MatterHackers.MatterControl.CustomWidgets
public ExpandCheckboxButton(string text, ThemeConfig theme, int pointSize = 11, bool expandable = true)
{
arrowRight = AggContext.StaticData.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons);
arrowDown = AggContext.StaticData.LoadIcon("fa-angle-down_12.png", 12, 12, theme.InvertIcons);
arrowRight = StaticData.Instance.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons);
arrowDown = StaticData.Instance.LoadIcon("fa-angle-down_12.png", 12, 12, theme.InvertIcons);
imageButton = new IconButton(arrowRight, theme)
{

View file

@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
Text = "Printers".Localize(),
HAnchor = HAnchor.Stretch,
AlwaysExpandable = true,
Image = AggContext.StaticData.LoadIcon("printer.png", 16, 16, theme.InvertIcons)
Image = StaticData.Instance.LoadIcon("printer.png", 16, 16, theme.InvertIcons)
};
printersNode.TreeView = this;
@ -74,7 +74,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
mainRow.AddChild(new HorizontalSpacer());
// add in the create printer button
var createPrinter = new IconButton(AggContext.StaticData.LoadIcon("md-add-circle_18.png", 18, 18, theme.InvertIcons), theme)
var createPrinter = new IconButton(StaticData.Instance.LoadIcon("md-add-circle_18.png", 18, 18, theme.InvertIcons), theme)
{
Name = "Create Printer",
VAnchor = VAnchor.Center,
@ -90,7 +90,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
mainRow.AddChild(createPrinter);
// add in the import printer button
var importPrinter = new IconButton(AggContext.StaticData.LoadIcon("md-import_18.png", 18, 18, theme.InvertIcons), theme)
var importPrinter = new IconButton(StaticData.Instance.LoadIcon("md-import_18.png", 18, 18, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Center,
Margin = theme.ButtonSpacing,
@ -115,7 +115,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
{
Text = "Materials".Localize(),
AlwaysExpandable = true,
Image = AggContext.StaticData.LoadIcon("filament.png", 16, 16, theme.InvertIcons)
Image = StaticData.Instance.LoadIcon("filament.png", 16, 16, theme.InvertIcons)
};
materialsNode.TreeView = this;

View file

@ -235,7 +235,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
public static GuiWidget CreateSortingMenuButton(ThemeConfig theme, LibraryListView libraryView)
{
var viewOptionsButton = new PopupMenuButton(
new ImageWidget(AggContext.StaticData.LoadIcon("fa-sort_16.png", 32, 32, theme.InvertIcons)), theme)
new ImageWidget(StaticData.Instance.LoadIcon("fa-sort_16.png", 32, 32, theme.InvertIcons)), theme)
{
AlignToRightEdge = true,
Name = "Print Library View Options",
@ -304,7 +304,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
Func<bool> containersShown)
{
var viewMenuButton = new PopupMenuButton(
new ImageWidget(AggContext.StaticData.LoadIcon("mi-view-list_10.png", 32, 32, theme.InvertIcons))
new ImageWidget(StaticData.Instance.LoadIcon("mi-view-list_10.png", 32, 32, theme.InvertIcons))
{
// VAnchor = VAnchor.Center
},
@ -645,7 +645,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
{
menuActions.Add(new LibraryAction(ActionScope.ListView)
{
Icon = AggContext.StaticData.LoadIcon("cube.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("cube.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons),
Title = "Add".Localize(),
ToolTipText = "Add an.stl, .obj, .amf, .gcode or.zip file to the Library".Localize(),
Action = (selectedLibraryItems, listView) =>
@ -673,7 +673,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
menuActions.Add(new LibraryAction(ActionScope.ListView)
{
Title = "Create Folder".Localize() + "...",
Icon = AggContext.StaticData.LoadIcon("fa-folder-new_16.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("fa-folder-new_16.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons),
Action = (selectedLibraryItems, listView) =>
{
DialogWindow.Show(
@ -705,7 +705,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
menuActions.Add(new LibraryAction(ActionScope.ListView)
{
Title = "Enter Share Code".Localize() + "...",
Icon = AggContext.StaticData.LoadIcon("enter-code.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("enter-code.png", 16, 16, theme.InvertIcons),
Action = (selectedLibraryItems, listView) =>
{
UiThread.RunOnIdle(() =>
@ -781,7 +781,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
menuActions.Add(new LibraryAction(ActionScope.ListItem)
{
Title = "Open".Localize(),
Icon = AggContext.StaticData.LoadIcon("cube.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("cube.png", 16, 16, theme.InvertIcons),
Action = (selectedLibraryItems, listView) =>
{
if (listView.SelectedItems.All(i => !(i.Model is ILibraryContainerLink)))
@ -805,7 +805,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
menuActions.Add(new LibraryAction(ActionScope.ListItem)
{
Title = "Add to Bed".Localize(),
Icon = AggContext.StaticData.LoadIcon("bed_add.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("bed_add.png", 16, 16, theme.InvertIcons),
Action = (selectedLibraryItems, listView) =>
{
var activeContext = ApplicationController.Instance.DragDropData;
@ -1014,7 +1014,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
menuActions.Add(new LibraryAction(ActionScope.ListItem)
{
Title = "Export".Localize(),
Icon = AggContext.StaticData.LoadIcon("cube_export.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("cube_export.png", 16, 16, theme.InvertIcons),
Action = (selectedLibraryItems, listView) =>
{
ApplicationController.Instance.ExportLibraryItems(libraryView.SelectedItems.Select(item => item.Model));
@ -1031,7 +1031,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
menuActions.Add(new LibraryAction(ActionScope.ListItem)
{
Title = "Share".Localize() + "...",
Icon = AggContext.StaticData.LoadIcon("share.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("share.png", 16, 16, theme.InvertIcons),
Action = (selectedLibraryItems, listView) =>
{
// Previously - shareFromLibraryButton_Click

View file

@ -264,7 +264,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
public class IconViewItem : ListViewItemBase
{
private static ImageBuffer loadingImage = AggContext.StaticData.LoadIcon("IC_32x32.png", 32, 32);
private static ImageBuffer loadingImage = StaticData.Instance.LoadIcon("IC_32x32.png", 32, 32);
internal static int ItemPadding = 0;

View file

@ -64,7 +64,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
this.thumbWidth = width;
this.thumbHeight = height;
overflowIcon = AggContext.StaticData.LoadIcon(Path.Combine("ViewTransformControls", "overflow.png"), 32, 32, theme.InvertIcons);
overflowIcon = StaticData.Instance.LoadIcon(Path.Combine("ViewTransformControls", "overflow.png"), 32, 32, theme.InvertIcons);
}
public bool HasMenu { get; set; } = false;

View file

@ -92,7 +92,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
allControls.AddChild(navBar);
theme.ApplyBottomBorder(navBar);
var toolbar = new OverflowBar(AggContext.StaticData.LoadIcon("fa-sort_16.png", 32, 32, theme.InvertIcons), theme)
var toolbar = new OverflowBar(StaticData.Instance.LoadIcon("fa-sort_16.png", 32, 32, theme.InvertIcons), theme)
{
HAnchor = HAnchor.Stretch,
VAnchor = VAnchor.Fit,

View file

@ -53,7 +53,7 @@ namespace MatterHackers.MatterControl.PrintLibrary
this.theme = theme;
this.TreeLoaded = false;
var searchIcon = AggContext.StaticData.LoadIcon("icon_search_24x24.png", 16, 16, theme.InvertIcons).AjustAlpha(0.3);
var searchIcon = StaticData.Instance.LoadIcon("icon_search_24x24.png", 16, 16, theme.InvertIcons).AjustAlpha(0.3);
searchBox = new TextEditWithInlineCancel(theme)
{

View file

@ -53,9 +53,9 @@ namespace MatterHackers.MatterControl.SettingsManagement
public static void SetMakeAndModel(string make, string model)
{
string pathToBedSettings = Path.Combine("PrinterSettings", make, model, "BedSettings.json");
if (AggContext.StaticData.FileExists(pathToBedSettings))
if (StaticData.Instance.FileExists(pathToBedSettings))
{
string content = AggContext.StaticData.ReadAllText(pathToBedSettings);
string content = StaticData.Instance.ReadAllText(pathToBedSettings);
instance = (BedSettings)Newtonsoft.Json.JsonConvert.DeserializeObject<BedSettings>(content);
}
else

View file

@ -60,7 +60,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var buttonGroup = new ObservableCollection<GuiWidget>();
speedsButton = new RadioIconButton(AggContext.StaticData.LoadIcon("speeds.png", 16, 16, theme.InvertIcons), theme)
speedsButton = new RadioIconButton(StaticData.Instance.LoadIcon("speeds.png", 16, 16, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroup,
Name = "Speeds Button",
@ -73,7 +73,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
buttonPanel.AddChild(speedsButton);
materialsButton = new RadioIconButton(AggContext.StaticData.LoadIcon("materials.png", 16, 16, theme.InvertIcons), theme)
materialsButton = new RadioIconButton(StaticData.Instance.LoadIcon("materials.png", 16, 16, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroup,
Name = "Materials Button",
@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
buttonPanel.AddChild(materialsButton);
noColorButton = new RadioIconButton(AggContext.StaticData.LoadIcon("no-color.png", 16, 16, theme.InvertIcons), theme)
noColorButton = new RadioIconButton(StaticData.Instance.LoadIcon("no-color.png", 16, 16, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroup,
Name = "No Color Button",

View file

@ -27,6 +27,7 @@ of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.MatterControl.CustomWidgets;
@ -35,7 +36,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public class HelpSearchResultRow : SettingsRow
{
public HelpSearchResultRow(HelpSearchResult searchResult, ThemeConfig theme)
: base(searchResult.Name, null, theme, AggContext.StaticData.LoadIcon("fa-text-file_16.png", 16, 16), fullRowSelect: true)
: base(searchResult.Name, null, theme, StaticData.Instance.LoadIcon("fa-text-file_16.png", 16, 16), fullRowSelect: true)
{
this.SearchResult = searchResult;

View file

@ -627,7 +627,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
themePanel.AddChild(
new ImageWidget(AggContext.StaticData.LoadIcon("theme.png", 16, 16, theme.InvertIcons), false)
new ImageWidget(StaticData.Instance.LoadIcon("theme.png", 16, 16, theme.InvertIcons), false)
{
HAnchor = HAnchor.Center | HAnchor.Absolute,
VAnchor = VAnchor.Center | VAnchor.Absolute,
@ -802,7 +802,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
tabControl,
new PartTabPage(workspace, theme, ""),
theme,
AggContext.StaticData.LoadIcon("cube.png", 16, 16, theme.InvertIcons))
StaticData.Instance.LoadIcon("cube.png", 16, 16, theme.InvertIcons))
{
Name = "newPart" + tabControl.AllTabs.Count(),
};

View file

@ -176,8 +176,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
favoritesBar.ScrollArea.VAnchor = VAnchor.Fit;
var expandedImage = AggContext.StaticData.LoadIcon("expand.png", 16, 16, theme.InvertIcons);
var collapsedImage = AggContext.StaticData.LoadIcon("collapse.png", 16, 16, theme.InvertIcons);
var expandedImage = StaticData.Instance.LoadIcon("expand.png", 16, 16, theme.InvertIcons);
var collapsedImage = StaticData.Instance.LoadIcon("collapse.png", 16, 16, theme.InvertIcons);
var expandBarButton = new IconButton(expanded ? collapsedImage : expandedImage, theme)
{

View file

@ -165,7 +165,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public CheckboxMenuItem(GuiWidget widget, ThemeConfig theme)
: base(widget, theme)
{
faChecked = AggContext.StaticData.LoadIcon("fa-check_16.png", 16, 16, theme.InvertIcons);
faChecked = StaticData.Instance.LoadIcon("fa-check_16.png", 16, 16, theme.InvertIcons);
}
public override void OnLoad(EventArgs args)

View file

@ -673,7 +673,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// add in the move up button
var babyStepAmount = .02;
var upButton = babySteppingControls.AddChild(new IconButton(AggContext.StaticData.LoadIcon("Up Arrow.png", 32, 32, theme.InvertIcons), theme)
var upButton = babySteppingControls.AddChild(new IconButton(StaticData.Instance.LoadIcon("Up Arrow.png", 32, 32, theme.InvertIcons), theme)
{
HAnchor = HAnchor.Center,
VAnchor = VAnchor.Absolute,
@ -711,7 +711,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
});
// add in the move down button
var downButton = babySteppingControls.AddChild(new IconButton(AggContext.StaticData.LoadIcon("Down Arrow.png", 32, 32, theme.InvertIcons), theme)
var downButton = babySteppingControls.AddChild(new IconButton(StaticData.Instance.LoadIcon("Down Arrow.png", 32, 32, theme.InvertIcons), theme)
{
HAnchor = HAnchor.Center,
VAnchor = VAnchor.Absolute,
@ -873,7 +873,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
timeContainer.AddChild(new ImageWidget(AggContext.StaticData.LoadIcon("fa-clock_24.png", 24, 24, theme.InvertIcons))
timeContainer.AddChild(new ImageWidget(StaticData.Instance.LoadIcon("fa-clock_24.png", 24, 24, theme.InvertIcons))
{
VAnchor = VAnchor.Center
});

View file

@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project.
*/
using System;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
using MatterHackers.MatterControl.CustomWidgets;
@ -42,7 +43,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.HAnchor = HAnchor.Fit;
this.VAnchor = VAnchor.Fit;
this.AddChild(new IconButton(AggContext.StaticData.LoadIcon("web.png", 16, 16, theme.InvertIcons), theme)
this.AddChild(new IconButton(StaticData.Instance.LoadIcon("web.png", 16, 16, theme.InvertIcons), theme)
{
Selectable = false
});

View file

@ -103,7 +103,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
IconButton resumeButton = null;
var pauseButton = new IconButton(AggContext.StaticData.LoadIcon("fa-pause_12.png", 12, 12, theme.InvertIcons), theme)
var pauseButton = new IconButton(StaticData.Instance.LoadIcon("fa-pause_12.png", 12, 12, theme.InvertIcons), theme)
{
Margin = theme.ButtonSpacing,
Enabled = taskDetails.Options?.PauseAction != null,
@ -139,7 +139,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
topRow.AddChild(pauseButton);
resumeButton = new IconButton(AggContext.StaticData.LoadIcon("fa-play_12.png", 12, 12, theme.InvertIcons), theme)
resumeButton = new IconButton(StaticData.Instance.LoadIcon("fa-play_12.png", 12, 12, theme.InvertIcons), theme)
{
Visible = false,
Margin = theme.ButtonSpacing,
@ -154,7 +154,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
topRow.AddChild(resumeButton);
var stopButton = new IconButton(AggContext.StaticData.LoadIcon("fa-stop_12.png", 12, 12, theme.InvertIcons), theme)
var stopButton = new IconButton(StaticData.Instance.LoadIcon("fa-stop_12.png", 12, 12, theme.InvertIcons), theme)
{
Margin = theme.ButtonSpacing,
Name = "Stop Task Button",

View file

@ -49,7 +49,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.theme = theme;
this.Padding = new BorderDouble(3, 0);
this.AddChild(new ImageWidget(AggContext.StaticData.LoadIcon("wait.png", 14, 14, theme.InvertIcons))
this.AddChild(new ImageWidget(StaticData.Instance.LoadIcon("wait.png", 14, 14, theme.InvertIcons))
{
VAnchor = VAnchor.Center,
HAnchor = HAnchor.Left

View file

@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl
};
contentRow.AddChild(itemNameWidget);
var icon = AggContext.StaticData.LoadIcon("fa-folder-new_16.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons);
var icon = StaticData.Instance.LoadIcon("fa-folder-new_16.png", 16, 16, ApplicationController.Instance.MenuTheme.InvertIcons);
var isEnabled = false;
if (librarySelectorWidget.ActiveContainer is ILibraryWritableContainer writableContainer)
{
@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl
createFolderButton.Name = "Create Folder In Button";
folderButtonRow.AddChild(createFolderButton);
var refreshButton = new IconButton(AggContext.StaticData.LoadIcon("fa-refresh_14.png", 16, 16, theme.InvertIcons), theme)
var refreshButton = new IconButton(StaticData.Instance.LoadIcon("fa-refresh_14.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Refresh Folder".Localize(),
Enabled = isEnabled,

View file

@ -102,7 +102,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (searchResults.Children.Count == 0)
{
searchResults.AddChild(new SettingsRow("No results found".Localize(), null, theme, AggContext.StaticData.LoadIcon("StatusInfoTip_16x.png", 16, 16).SetPreMultiply()));
searchResults.AddChild(new SettingsRow("No results found".Localize(), null, theme, StaticData.Instance.LoadIcon("StatusInfoTip_16x.png", 16, 16).SetPreMultiply()));
}
// Add top border to first child

View file

@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
toolbar.AddChild(primaryActionsPanel);
// put in a make permanent button
var icon = AggContext.StaticData.LoadIcon("apply.png", 16, 16, theme.InvertIcons).SetPreMultiply();
var icon = StaticData.Instance.LoadIcon("apply.png", 16, 16, theme.InvertIcons).SetPreMultiply();
flattenButton = new IconButton(icon, theme)
{
Margin = theme.ButtonSpacing,
@ -112,7 +112,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
toolbar.AddChild(flattenButton);
// put in a remove button
removeButton = new IconButton(AggContext.StaticData.LoadIcon("cancel.png", 16, 16, theme.InvertIcons), theme)
removeButton = new IconButton(StaticData.Instance.LoadIcon("cancel.png", 16, 16, theme.InvertIcons), theme)
{
Margin = theme.ButtonSpacing,
ToolTipText = "Cancel".Localize(),

View file

@ -259,7 +259,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.TabBar.ActionArea.AddChild(tabTrailer);
var plusTabButton = new NewTabButton(AggContext.StaticData.LoadIcon("fa-plus_12.png", 12, 12, theme.InvertIcons), theme)
var plusTabButton = new NewTabButton(StaticData.Instance.LoadIcon("fa-plus_12.png", 12, 12, theme.InvertIcons), theme)
{
Height = 20 * GuiWidget.DeviceScale,
};

View file

@ -102,7 +102,7 @@ namespace MatterHackers.MatterControl.DesignTools
// Persist
string filePath = ApplicationDataStorage.Instance.GetNewLibraryFilePath(".png");
AggContext.ImageIO.SaveImageData(
ImageIO.SaveImageData(
filePath,
activeImage);

View file

@ -325,11 +325,11 @@ namespace MatterHackers.MatterControl
{
// Add an oem/watermark image to the bedplate grid
string imagePathAndFile = Path.Combine("OEMSettings", "bedimage.png");
if (AggContext.StaticData.FileExists(imagePathAndFile))
if (StaticData.Instance.FileExists(imagePathAndFile))
{
if (watermarkImage == null)
{
watermarkImage = AggContext.StaticData.LoadImage(imagePathAndFile);
watermarkImage = StaticData.Instance.LoadImage(imagePathAndFile);
}
var xYRatio = printer.Bed.ViewerVolume.X / Math.Max(1, printer.Bed.ViewerVolume.Y);

View file

@ -69,7 +69,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
switch (rowIndex)
{
case 0:
var resetButton = new IconButton(AggContext.StaticData.LoadIcon("transparent_grid.png"), theme)
var resetButton = new IconButton(StaticData.Instance.LoadIcon("transparent_grid.png"), theme)
{
Width = scaledButtonSize,
Height = scaledButtonSize,

View file

@ -45,7 +45,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.object3DControlLayer = object3DControlLayer;
this.PopupContent = () => ShowGridOptions(theme);
this.AddChild(new IconButton(AggContext.StaticData.LoadIcon("1694146.png", 16, 16, theme.InvertIcons), theme)
this.AddChild(new IconButton(StaticData.Instance.LoadIcon("1694146.png", 16, 16, theme.InvertIcons), theme)
{
Selectable = false
});

View file

@ -137,7 +137,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
DrawOnTop = true;
using (Stream arrowStream = AggContext.StaticData.OpenStream(Path.Combine("Stls", "up_pointer.stl")))
using (Stream arrowStream = StaticData.Instance.OpenStream(Path.Combine("Stls", "up_pointer.stl")))
{
upArrowMesh = StlProcessing.Load(arrowStream, CancellationToken.None);
}

View file

@ -192,7 +192,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private static ImageBuffer CreateOverflowIcon(ThemeConfig theme)
{
return AggContext.StaticData.LoadIcon(Path.Combine("ViewTransformControls", "overflow.png"), 32, 32, theme.InvertIcons);
return StaticData.Instance.LoadIcon(Path.Combine("ViewTransformControls", "overflow.png"), 32, 32, theme.InvertIcons);
}
}
}

View file

@ -78,7 +78,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
var resetConnectionButton = new TextIconButton(
"Reset".Localize(),
AggContext.StaticData.LoadIcon("e_stop.png", 14, 14, theme.InvertIcons),
StaticData.Instance.LoadIcon("e_stop.png", 14, 14, theme.InvertIcons),
theme)
{
ToolTipText = "Reboots the firmware on the controller".Localize(),
@ -138,7 +138,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var buttonGroupB = new ObservableCollection<GuiWidget>();
var iconPath = Path.Combine("ViewTransformControls", "model.png");
modelViewButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 16, 16, theme.InvertIcons), theme)
modelViewButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 16, 16, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupB,
Name = "Model View Button",
@ -153,7 +153,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
viewModes.Add(PartViewMode.Model, modelViewButton);
iconPath = Path.Combine("ViewTransformControls", "gcode_3d.png");
layers3DButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 16, 16, theme.InvertIcons), theme)
layers3DButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 16, 16, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupB,
Name = "Layers3D Button",
@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
iconPath = Path.Combine("ViewTransformControls", "gcode_2d.png");
layers2DButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 16, 16, theme.InvertIcons), theme)
layers2DButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 16, 16, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupB,
Name = "Layers2D Button",
@ -293,7 +293,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
new NamedAction()
{
Icon = AggContext.StaticData.LoadIcon("memory_16x16.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("memory_16x16.png", 16, 16, theme.InvertIcons),
Title = "Configure EEProm".Localize(),
Action = configureEePromButton_Click,
IsEnabled = () => printer.Connection.IsConnected
@ -343,7 +343,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
ApplicationController.Instance.ExportAsMatterControlConfig(printer);
}),
Icon = AggContext.StaticData.LoadIcon("cube_export.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("cube_export.png", 16, 16, theme.InvertIcons),
},
new ActionSeparator(),
@ -357,7 +357,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
DialogWindow.Show(new PrinterCalibrationWizard(printer, theme));
});
}),
Icon = AggContext.StaticData.LoadIcon("compass.png", 16, 16, theme.InvertIcons)
Icon = StaticData.Instance.LoadIcon("compass.png", 16, 16, theme.InvertIcons)
},
new ActionSeparator(),
new NamedAction()
@ -367,7 +367,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
DialogWindow.Show(new UpdateSettingsPage(printer));
},
Icon = AggContext.StaticData.LoadIcon("fa-refresh_14.png", 16, 16, theme.InvertIcons)
Icon = StaticData.Instance.LoadIcon("fa-refresh_14.png", 16, 16, theme.InvertIcons)
},
new NamedAction()
{

View file

@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project.
*/
using System;
using MatterHackers.Agg;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
using MatterHackers.Localizations;
@ -54,7 +55,7 @@ namespace MatterHackers.MatterControl.ActionBar
connectButton = new TextIconButton(
"Connect".Localize(),
AggContext.StaticData.LoadIcon("connect.png", 14, 14, theme.InvertIcons),
StaticData.Instance.LoadIcon("connect.png", 14, 14, theme.InvertIcons),
theme)
{
Name = "Connect to printer button",
@ -75,7 +76,7 @@ namespace MatterHackers.MatterControl.ActionBar
// add the cancel stop button
cancelConnectButton = new TextIconButton(
"Cancel".Localize(),
AggContext.StaticData.LoadIcon("connect.png", 14, 14, theme.InvertIcons),
StaticData.Instance.LoadIcon("connect.png", 14, 14, theme.InvertIcons),
theme)
{
ToolTipText = "Stop trying to connect to the printer.".Localize(),
@ -92,7 +93,7 @@ namespace MatterHackers.MatterControl.ActionBar
disconnectButton = new TextIconButton(
"Disconnect".Localize(),
AggContext.StaticData.LoadIcon("connect.png", 14, 14, theme.InvertIcons),
StaticData.Instance.LoadIcon("connect.png", 14, 14, theme.InvertIcons),
theme)
{
Name = "Disconnect from printer button",

View file

@ -46,9 +46,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.VAnchor = VAnchor.Fit | VAnchor;
this.BackgroundColor = theme.ResolveColor(theme.BackgroundColor, theme.PrimaryAccentColor.WithAlpha(30));
var errorImage = AggContext.StaticData.LoadIcon("SettingsGroupError_16x.png", 16, 16, theme.InvertIcons);
var warningImage = AggContext.StaticData.LoadIcon("SettingsGroupWarning_16x.png", 16, 16, theme.InvertIcons);
var infoImage = AggContext.StaticData.LoadIcon("StatusInfoTip_16x.png", 16, 16);
var errorImage = StaticData.Instance.LoadIcon("SettingsGroupError_16x.png", 16, 16, theme.InvertIcons);
var warningImage = StaticData.Instance.LoadIcon("SettingsGroupWarning_16x.png", 16, 16, theme.InvertIcons);
var infoImage = StaticData.Instance.LoadIcon("StatusInfoTip_16x.png", 16, 16);
foreach (var validationError in errors.OrderByDescending(e => e.ErrorLevel))
{

View file

@ -33,6 +33,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.Image;
using MatterHackers.Agg.Platform;
using MatterHackers.Agg.UI;
using MatterHackers.DataConverters3D;
@ -196,7 +197,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
// Persist
string filePath = ApplicationDataStorage.Instance.GetNewLibraryFilePath(".png");
AggContext.ImageIO.SaveImageData(
ImageIO.SaveImageData(
filePath,
Clipboard.Instance.GetImage());

View file

@ -238,7 +238,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
titleAndTreeView.AddChild(treeView);
workspaceName.ActionArea.AddChild(
new IconButton(AggContext.StaticData.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons), theme)
new IconButton(StaticData.Instance.LoadIcon("fa-angle-right_12.png", 12, 12, theme.InvertIcons), theme)
{
Enabled = false
},
@ -286,7 +286,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
this.Object3DControlLayer.AddChild(viewOptionsBar);
var homeButton = new IconButton(AggContext.StaticData.LoadIcon("fa-home_16.png", 16, 16, theme.InvertIcons), theme)
var homeButton = new IconButton(StaticData.Instance.LoadIcon("fa-home_16.png", 16, 16, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Absolute,
ToolTipText = "Reset View".Localize(),

View file

@ -137,7 +137,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.AddChild(new ToolbarSeparator(theme.GetBorderColor(50), theme.SeparatorMargin));
bedMenuButton = new PopupMenuButton(AggContext.StaticData.LoadIcon("bed.png", 16, 16, theme.InvertIcons), theme)
bedMenuButton = new PopupMenuButton(StaticData.Instance.LoadIcon("bed.png", 16, 16, theme.InvertIcons), theme)
{
Name = "Bed Options Menu",
ToolTipText = "Bed",
@ -157,7 +157,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.AddChild(new ToolbarSeparator(theme.GetBorderColor(50), theme.SeparatorMargin));
undoButton = new IconButton(AggContext.StaticData.LoadIcon("Undo_grey_16x.png", 16, 16, theme.InvertIcons), theme)
undoButton = new IconButton(StaticData.Instance.LoadIcon("Undo_grey_16x.png", 16, 16, theme.InvertIcons), theme)
{
Name = "3D View Undo",
ToolTipText = "Undo".Localize(),
@ -172,7 +172,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
this.AddChild(undoButton);
redoButton = new IconButton(AggContext.StaticData.LoadIcon("Redo_grey_16x.png", 16, 16, theme.InvertIcons), theme)
redoButton = new IconButton(StaticData.Instance.LoadIcon("Redo_grey_16x.png", 16, 16, theme.InvertIcons), theme)
{
Name = "3D View Redo",
Margin = theme.ButtonSpacing,
@ -211,7 +211,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
if (UserSettings.Instance.IsTouchScreen)
{
iconPath = Path.Combine("ViewTransformControls", "rotate.png");
rotateButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
rotateButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupA,
ToolTipText = "Rotate (Alt + Left Mouse)".Localize(),
@ -222,7 +222,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
AddChild(rotateButton);
iconPath = Path.Combine("ViewTransformControls", "translate.png");
translateButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
translateButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupA,
ToolTipText = "Move (Shift + Left Mouse)".Localize(),
@ -233,7 +233,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
AddChild(translateButton);
iconPath = Path.Combine("ViewTransformControls", "scale.png");
scaleButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
scaleButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupA,
ToolTipText = "Zoom (Ctrl + Left Mouse)".Localize(),
@ -249,7 +249,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
this.AddChild(new ToolbarSeparator(theme.GetBorderColor(50), theme.SeparatorMargin));
iconPath = Path.Combine("ViewTransformControls", "partSelect.png");
partSelectButton = new RadioIconButton(AggContext.StaticData.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
partSelectButton = new RadioIconButton(StaticData.Instance.LoadIcon(iconPath, 32, 32, theme.InvertIcons), theme)
{
SiblingRadioButtonList = buttonGroupA,
ToolTipText = "Select Part".Localize(),
@ -566,7 +566,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
ID = "Export",
Title = "Export".Localize(),
Icon = AggContext.StaticData.LoadIcon("cube_export.png", 16, 16, menuTheme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("cube_export.png", 16, 16, menuTheme.InvertIcons),
Action = () =>
{
ApplicationController.Instance.ExportLibraryItems(
@ -607,7 +607,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private IconButton CreateOpenButton(ThemeConfig theme)
{
var openButton = new IconButton(AggContext.StaticData.LoadIcon("fa-folder-open_16.png", 16, 16, theme.InvertIcons), theme)
var openButton = new IconButton(StaticData.Instance.LoadIcon("fa-folder-open_16.png", 16, 16, theme.InvertIcons), theme)
{
Margin = theme.ButtonSpacing,
ToolTipText = "Open File".Localize(),
@ -676,7 +676,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
var buttonView = new TextIconButton(
"",
AggContext.StaticData.LoadIcon("cube_add.png", 16, 16, theme.InvertIcons),
StaticData.Instance.LoadIcon("cube_add.png", 16, 16, theme.InvertIcons),
theme);
// Remove right Padding for drop style
@ -794,7 +794,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
minimumSupportHeight = sceneContext.Printer.Settings.GetValue<double>(SettingsKey.layer_height) / 2;
}
toggleSupportButton = new PopupMenuButton(AggContext.StaticData.LoadIcon("support.png", 16, 16, theme.InvertIcons), theme)
toggleSupportButton = new PopupMenuButton(StaticData.Instance.LoadIcon("support.png", 16, 16, theme.InvertIcons), theme)
{
Name = "Support SplitButton",
ToolTipText = "Generate Support".Localize(),
@ -817,7 +817,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
return theme.CreateSplitButton(new SplitButtonParams()
{
ButtonName = "Save",
Icon = AggContext.StaticData.LoadIcon("save_grey_16x.png", 16, 16, theme.InvertIcons),
Icon = StaticData.Instance.LoadIcon("save_grey_16x.png", 16, 16, theme.InvertIcons),
DefaultAction = (menuButton) =>
{
ApplicationController.Instance.Tasks.Execute("Saving".Localize(), sceneContext.Printer, async (progress, cancellationToken) =>

View file

@ -56,12 +56,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
viewIcons = new Dictionary<RenderTypes, ImageBuffer>()
{
[RenderTypes.Shaded] = AggContext.StaticData.LoadIcon("view_shaded.png", 16, 16, theme.InvertIcons),
[RenderTypes.Outlines] = AggContext.StaticData.LoadIcon("view_outlines.png", 16, 16, theme.InvertIcons),
[RenderTypes.Polygons] = AggContext.StaticData.LoadIcon("view_polygons.png", 16, 16, theme.InvertIcons),
[RenderTypes.NonManifold] = AggContext.StaticData.LoadIcon("view_polygons.png", 16, 16, theme.InvertIcons),
[RenderTypes.Materials] = AggContext.StaticData.LoadIcon("view_materials.png", 16, 16, theme.InvertIcons),
[RenderTypes.Overhang] = AggContext.StaticData.LoadIcon("view_overhang.png", 16, 16, theme.InvertIcons),
[RenderTypes.Shaded] = StaticData.Instance.LoadIcon("view_shaded.png", 16, 16, theme.InvertIcons),
[RenderTypes.Outlines] = StaticData.Instance.LoadIcon("view_outlines.png", 16, 16, theme.InvertIcons),
[RenderTypes.Polygons] = StaticData.Instance.LoadIcon("view_polygons.png", 16, 16, theme.InvertIcons),
[RenderTypes.NonManifold] = StaticData.Instance.LoadIcon("view_polygons.png", 16, 16, theme.InvertIcons),
[RenderTypes.Materials] = StaticData.Instance.LoadIcon("view_materials.png", 16, 16, theme.InvertIcons),
[RenderTypes.Overhang] = StaticData.Instance.LoadIcon("view_overhang.png", 16, 16, theme.InvertIcons),
};
this.AddChild(iconButton = new IconButton(viewIcons[sceneContext.ViewState.RenderType], theme)

View file

@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl.Plugins.X3GDriver
public override string FileExtension { get; } = ".x3g";
public override ImageBuffer Icon { get; } = AggContext.StaticData.LoadIcon(Path.Combine("filetypes", "x3g.png"));
public override ImageBuffer Icon { get; } = StaticData.Instance.LoadIcon(Path.Combine("filetypes", "x3g.png"));
public override bool Enabled
{

View file

@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.PrinterControls
null,
theme));
var runWizardButton = new IconButton(AggContext.StaticData.LoadIcon("compass.png", 16, 16, theme.InvertIcons), theme)
var runWizardButton = new IconButton(StaticData.Instance.LoadIcon("compass.png", 16, 16, theme.InvertIcons), theme)
{
VAnchor = VAnchor.Center,
Margin = theme.ButtonSpacing,

View file

@ -106,7 +106,7 @@ namespace MatterHackers.MatterControl.PrinterControls
{
var widget = new MacroControls(printer, theme);
var editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme);
var editButton = new IconButton(StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme);
editButton.Click += (s, e) =>
{
DialogWindow.Show(new MacroListPage(printer.Settings));

View file

@ -83,7 +83,7 @@ namespace MatterHackers.MatterControl.PrinterControls
{
var widget = new MovementControls(printer, new XYZColors(theme), theme);
var editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme);
var editButton = new IconButton(StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme);
editButton.Click += (s, e) => widget.EditOptions();
return new SectionWidget(
@ -129,7 +129,7 @@ namespace MatterHackers.MatterControl.PrinterControls
Margin = new BorderDouble(bottom: 10)
};
var homeIcon = new IconButton(AggContext.StaticData.LoadIcon("fa-home_16.png", 16, 16, theme.InvertIcons), theme)
var homeIcon = new IconButton(StaticData.Instance.LoadIcon("fa-home_16.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Home X, Y and Z".Localize(),
BackgroundColor = theme.MinimalShade,

View file

@ -167,7 +167,7 @@ namespace MatterHackers.MatterControl
MinimumSize = new Vector2(125, 0)
});
var editButton = new IconButton(AggContext.StaticData.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme)
var editButton = new IconButton(StaticData.Instance.LoadIcon("icon_edit.png", 16, 16, theme.InvertIcons), theme)
{
Name = "Edit Leveling Data Button",
ToolTipText = "Edit Leveling Data".Localize(),

View file

@ -286,7 +286,7 @@ namespace MatterHackers.MatterControl
Margin = new BorderDouble(left: 10)
};
keyboardImage = new IconButton(AggContext.StaticData.LoadIcon("hot_key_small_white.png", 19, 12, theme.InvertIcons), theme)
keyboardImage = new IconButton(StaticData.Instance.LoadIcon("hot_key_small_white.png", 19, 12, theme.InvertIcons), theme)
{
HAnchor = HAnchor.Center,
Margin = new BorderDouble(5),

View file

@ -75,7 +75,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
};
container.AddChild(printerMessageThree);
var removeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "remove usb.png"));
var removeImage = StaticData.Instance.LoadImage(Path.Combine("Images", "remove usb.png"));
removeImage.SetRecieveBlender(new BlenderPreMultBGRA());
container.AddChild(new ImageWidget(removeImage)
{

View file

@ -153,7 +153,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
};
container.AddChild(printerErrorMessage);
var removeImage = AggContext.StaticData.LoadImage(Path.Combine("Images", "insert usb.png")).SetPreMultiply();
var removeImage = StaticData.Instance.LoadImage(Path.Combine("Images", "insert usb.png")).SetPreMultiply();
container.AddChild(new ImageWidget(removeImage)
{
HAnchor = HAnchor.Center,

View file

@ -103,7 +103,7 @@ namespace MatterHackers.MatterControl
VAnchor = VAnchor.Fit,
};
var configureIcon = AggContext.StaticData.LoadIcon("fa-cog_16.png", 16, 16, theme.InvertIcons);
var configureIcon = StaticData.Instance.LoadIcon("fa-cog_16.png", 16, 16, theme.InvertIcons);
var generalSection = new SectionWidget("General".Localize(), generalPanel, theme, expandingContent: false)
{
@ -146,7 +146,7 @@ namespace MatterHackers.MatterControl
}
},
previewButton,
AggContext.StaticData.LoadIcon("camera-24x24.png", 24, 24))
StaticData.Instance.LoadIcon("camera-24x24.png", 24, 24))
{
Enabled = printer.Settings.PrinterSelected
},
@ -186,7 +186,7 @@ namespace MatterHackers.MatterControl
}
},
configureNotificationsButton,
AggContext.StaticData.LoadIcon("notify-24x24.png", 16, 16, theme.InvertIcons)),
StaticData.Instance.LoadIcon("notify-24x24.png", 16, 16, theme.InvertIcons)),
generalPanel);
// LanguageControl
@ -391,7 +391,7 @@ namespace MatterHackers.MatterControl
true,
false);
var openCacheButton = new IconButton(AggContext.StaticData.LoadIcon("fa-link_16.png", 16, 16, theme.InvertIcons), theme)
var openCacheButton = new IconButton(StaticData.Instance.LoadIcon("fa-link_16.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Open Folder".Localize(),
};
@ -407,7 +407,7 @@ namespace MatterHackers.MatterControl
theme),
advancedPanel);
var clearCacheButton = new HoverIconButton(AggContext.StaticData.LoadIcon("remove.png", 16, 16, theme.InvertIcons), theme)
var clearCacheButton = new HoverIconButton(StaticData.Instance.LoadIcon("remove.png", 16, 16, theme.InvertIcons), theme)
{
ToolTipText = "Clear Cache".Localize(),
};
@ -424,7 +424,7 @@ namespace MatterHackers.MatterControl
advancedPanel);
#if DEBUG
var configureIcon = AggContext.StaticData.LoadIcon("fa-cog_16.png", 16, 16, theme.InvertIcons);
var configureIcon = StaticData.Instance.LoadIcon("fa-cog_16.png", 16, 16, theme.InvertIcons);
var configurePluginsButton = new IconButton(configureIcon, theme)
{
@ -569,7 +569,7 @@ namespace MatterHackers.MatterControl
Margin = 0
};
themeSection.SetNonExpandableIcon(AggContext.StaticData.LoadIcon("theme.png", 16, 16, theme.InvertIcons));
themeSection.SetNonExpandableIcon(StaticData.Instance.LoadIcon("theme.png", 16, 16, theme.InvertIcons));
return themeSection;
}

View file

@ -51,7 +51,7 @@ namespace MatterHackers.MatterControl.SettingsManagement
{
if (instance == null)
{
string oemSettings = AggContext.StaticData.ReadAllText(Path.Combine("OEMSettings", "Settings.json"));
string oemSettings = StaticData.Instance.ReadAllText(Path.Combine("OEMSettings", "Settings.json"));
instance = JsonConvert.DeserializeObject<OemSettings>(oemSettings) as OemSettings;
}
@ -184,7 +184,7 @@ namespace MatterHackers.MatterControl.SettingsManagement
// If empty, purge the cache file and fall back to StaticData
File.Delete(cachePath);
json = AggContext.StaticData.ReadAllText(Path.Combine("Profiles", "oemprofiles.json"));
json = StaticData.Instance.ReadAllText(Path.Combine("Profiles", "oemprofiles.json"));
}
try
@ -196,7 +196,7 @@ namespace MatterHackers.MatterControl.SettingsManagement
// If json parse fails, purge the cache file and fall back to StaticData
File.Delete(cachePath);
json = AggContext.StaticData.ReadAllText(Path.Combine("Profiles", "oemprofiles.json"));
json = StaticData.Instance.ReadAllText(Path.Combine("Profiles", "oemprofiles.json"));
return JsonConvert.DeserializeObject<OemProfileDictionary>(json);
}
}
@ -259,8 +259,8 @@ namespace MatterHackers.MatterControl.SettingsManagement
private OemSettings()
{
this.ManufacturerNameMappings = new List<ManufacturerNameMapping>();
this.OemUrls = JsonConvert.DeserializeObject<Dictionary<string, string>>(AggContext.StaticData.ReadAllText(Path.Combine("OEMSettings", "OEMUrls.json")));
this.OemPrinters = JsonConvert.DeserializeObject<Dictionary<string, StorePrinterID>>(AggContext.StaticData.ReadAllText(Path.Combine("OEMSettings", "Printers.json")));
this.OemUrls = JsonConvert.DeserializeObject<Dictionary<string, string>>(StaticData.Instance.ReadAllText(Path.Combine("OEMSettings", "OEMUrls.json")));
this.OemPrinters = JsonConvert.DeserializeObject<Dictionary<string, StorePrinterID>>(StaticData.Instance.ReadAllText(Path.Combine("OEMSettings", "Printers.json")));
}
}

Some files were not shown because too many files have changed in this diff Show more