diff --git a/src/CommonProject.properties b/src/CommonProject.properties deleted file mode 100644 index 1cfd12951..000000000 --- a/src/CommonProject.properties +++ /dev/null @@ -1,48 +0,0 @@ - - - - false - latest - OnBuildSuccess - - - 1685 - true - bin\Debug\ - DEBUG;TRACE - true - 4096 - pdbonly - x86 - Off - - - 1685 - true - bin\Debug\ - DEBUG;TRACE - true - 4096 - pdbonly - AnyCPU - Off - - - 1685 - bin\Release\ - true - 4096 - pdbonly - AnyCPU - Off - - - 1685 - bin\Release\ - true - 4096 - pdbonly - x86 - Off - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 000000000..7b8ed197c --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,68 @@ + + + Copyright © Greenshot 2004-2018 + Greenshot + https://getgreenshot.org/favicon.ico + https://github.com/greenshot/greenshot + git + https://github.com/greenshot/greenshot + https://www.gnu.org/licenses/gpl.html + latest + true + true + 1.0.0 + 1.0.0 + 1.0.0 + + + + true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true + + + + false + false + + + + DEBUG;TRACE + True + true + Full + false + + + + true + pdbonly + True + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + + + diff --git a/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs b/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs index d116901ab..a444e1fe4 100644 --- a/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs +++ b/src/Greenshot.Addon.InternetExplorer/AccessibleHelper.cs @@ -21,6 +21,7 @@ #endregion +#if !NETCOREAPP30 #region Usings using System; @@ -358,4 +359,5 @@ namespace Greenshot.Addon.InternetExplorer #endregion } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj b/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj index dd5940f08..a0c2d3e66 100644 --- a/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj +++ b/src/Greenshot.Addon.InternetExplorer/Greenshot.Addon.InternetExplorer.csproj @@ -1,25 +1,43 @@  - netcoreapp3.0 - latest + netcoreapp3.0;net461 true - + + + + + + + + + + + + + + + + + + + + + + + + - - 0.6.2 - - - 0.6.6 + 0.7.16 - 0.6.6 + 0.7.16 diff --git a/src/Greenshot.Addon.InternetExplorer/IECaptureHelper.cs b/src/Greenshot.Addon.InternetExplorer/IECaptureHelper.cs index 2ebca2386..8788a6d1d 100644 --- a/src/Greenshot.Addon.InternetExplorer/IECaptureHelper.cs +++ b/src/Greenshot.Addon.InternetExplorer/IECaptureHelper.cs @@ -29,7 +29,6 @@ using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Runtime.InteropServices; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Com; using Dapplo.Windows.Common.Extensions; @@ -38,6 +37,7 @@ using Dapplo.Windows.Desktop; using Dapplo.Windows.Messages; using Dapplo.Windows.User32; using Greenshot.Addon.InternetExplorer.IEInterop; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Controls; using Greenshot.Addons.Core; using Greenshot.Addons.Interfaces; @@ -57,10 +57,11 @@ namespace Greenshot.Addon.InternetExplorer public static class IeCaptureHelper { private static readonly LogSource Log = new LogSource(); - private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl(); - // Helper method to activate a certain IE Tab - public static void ActivateIeTab(IInteropWindow nativeIeWindow, int tabIndex) + // Helper method to activate a certain IE Tab + public static void ActivateIeTab(IInteropWindow nativeIeWindow, int tabIndex) { var directUiInteropWindow = IEHelper.GetDirectUi(nativeIeWindow); if (directUiInteropWindow != null) diff --git a/src/Greenshot.Addon.InternetExplorer/IEHelper.cs b/src/Greenshot.Addon.InternetExplorer/IEHelper.cs index abebb5d79..cf11764bf 100644 --- a/src/Greenshot.Addon.InternetExplorer/IEHelper.cs +++ b/src/Greenshot.Addon.InternetExplorer/IEHelper.cs @@ -108,12 +108,13 @@ namespace Greenshot.Addon.InternetExplorer { { continue; } - - var ieAccessible = new Accessible(directUiWd.Handle); +#if !NETCOREAPP30 + var ieAccessible = new Accessible(directUiWd.Handle); foreach (var url in ieAccessible.IETabUrls) { yield return url; } +#endif } } } diff --git a/src/Greenshot.Addon.InternetExplorer/app.config b/src/Greenshot.Addon.InternetExplorer/app.config index 4ce296638..dc12e2573 100644 --- a/src/Greenshot.Addon.InternetExplorer/app.config +++ b/src/Greenshot.Addon.InternetExplorer/app.config @@ -2,18 +2,6 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Greenshot.Addon.LegacyEditor/Configuration/Impl/EditorConfigurationImpl.cs b/src/Greenshot.Addon.LegacyEditor/Configuration/Impl/EditorConfigurationImpl.cs new file mode 100644 index 000000000..26bca1834 --- /dev/null +++ b/src/Greenshot.Addon.LegacyEditor/Configuration/Impl/EditorConfigurationImpl.cs @@ -0,0 +1,30 @@ +using System.Collections.Generic; +using System.Drawing; +using Dapplo.Config.Ini; +using Dapplo.Windows.Common.Structs; +using Dapplo.Windows.User32.Enums; +using Greenshot.Gfx.Effects; + +namespace Greenshot.Addon.LegacyEditor.Configuration.Impl +{ + internal class EditorConfigurationImpl : IniSectionBase, IEditorConfiguration + { + #region Implementation of IEditorConfiguration + + public IList RecentColors { get; set; } + public IDictionary LastUsedFieldValues { get; set; } + public bool MatchSizeToCapture { get; set; } + public WindowPlacementFlags WindowPlacementFlags { get; set; } + public ShowWindowCommands ShowWindowCommand { get; set; } + public NativePoint WindowMinPosition { get; set; } + public NativePoint WindowMaxPosition { get; set; } + public NativeRect WindowNormalPosition { get; set; } + public bool ReuseEditor { get; set; } + public int FreehandSensitivity { get; set; } + public bool SuppressSaveDialogAtClose { get; set; } + public DropShadowEffect DropShadowEffectSettings { get; set; } + public TornEdgeEffect TornEdgeEffectSettings { get; set; } + + #endregion + } +} diff --git a/src/Greenshot.Addon.LegacyEditor/Configuration/Impl/EditorLanguageImpl.cs b/src/Greenshot.Addon.LegacyEditor/Configuration/Impl/EditorLanguageImpl.cs new file mode 100644 index 000000000..08dfb556f --- /dev/null +++ b/src/Greenshot.Addon.LegacyEditor/Configuration/Impl/EditorLanguageImpl.cs @@ -0,0 +1,101 @@ +using Dapplo.Config.Language; + +namespace Greenshot.Addon.LegacyEditor.Configuration.Impl +{ + public class EditorLanguageImpl : LanguageBase, IEditorLanguage + { + #region Implementation of IEditorLanguage + + public string SettingsDestinationEditor { get; } + public string EditorAlignBottom { get; } + public string EditorAlignCenter { get; } + public string EditorAlignHorizontal { get; } + public string EditorAlignLeft { get; } + public string EditorAlignMiddle { get; } + public string EditorAlignRight { get; } + public string EditorAlignTop { get; } + public string EditorAlignVertical { get; } + public string EditorArrange { get; } + public string EditorArrowheads { get; } + public string EditorArrowheadsBoth { get; } + public string EditorArrowheadsEnd { get; } + public string EditorArrowheadsNone { get; } + public string EditorArrowheadsStart { get; } + public string EditorAutocrop { get; } + public string EditorBackcolor { get; } + public string EditorBlurRadius { get; } + public string EditorBold { get; } + public string EditorBorder { get; } + public string EditorBrightness { get; } + public string EditorCancel { get; } + public string EditorClipboardfailed { get; } + public string EditorClose { get; } + public string EditorCloseOnSave { get; } + public string EditorCloseOnSaveTitle { get; } + public string EditorConfirm { get; } + public string EditorCopyimagetoclipboard { get; } + public string EditorCopypathtoclipboard { get; } + public string EditorCopytoclipboard { get; } + public string EditorCrop { get; } + public string EditorCursortool { get; } + public string EditorCuttoclipboard { get; } + public string EditorDeleteelement { get; } + public string EditorDownonelevel { get; } + public string EditorDowntobottom { get; } + public string EditorDrawarrow { get; } + public string EditorDrawellipse { get; } + public string EditorDrawfreehand { get; } + public string EditorDrawhighlighter { get; } + public string EditorDrawline { get; } + public string EditorDrawrectangle { get; } + public string EditorDrawtextbox { get; } + public string EditorDuplicate { get; } + public string EditorEdit { get; } + public string EditorEffects { get; } + public string EditorEmail { get; } + public string EditorFile { get; } + public string EditorFontsize { get; } + public string EditorForecolor { get; } + public string EditorGrayscale { get; } + public string EditorHighlightArea { get; } + public string EditorHighlightGrayscale { get; } + public string EditorHighlightMagnify { get; } + public string EditorHighlightMode { get; } + public string EditorHighlightText { get; } + public string EditorImagesaved { get; } + public string EditorInsertwindow { get; } + public string EditorItalic { get; } + public string EditorLoadObjects { get; } + public string EditorMagnificationFactor { get; } + public string EditorMatchCaptureSize { get; } + public string EditorObfuscate { get; } + public string EditorObfuscateBlur { get; } + public string EditorObfuscateMode { get; } + public string EditorObfuscatePixelize { get; } + public string EditorObject { get; } + public string EditorOpendirinexplorer { get; } + public string EditorPastefromclipboard { get; } + public string EditorPixelSize { get; } + public string EditorPreviewQuality { get; } + public string EditorPrint { get; } + public string EditorRedo { get; } + public string EditorResetsize { get; } + public string EditorResizePercent { get; } + public string EditorResizePixel { get; } + public string EditorSave { get; } + public string EditorSaveas { get; } + public string EditorSaveObjects { get; } + public string EditorSelectall { get; } + public string EditorSenttoprinter { get; } + public string EditorShadow { get; } + public string EditorStoredtoclipboard { get; } + public string EditorThickness { get; } + public string EditorTitle { get; } + public string EditorTornEdge { get; } + public string EditorUndo { get; } + public string EditorUponelevel { get; } + public string EditorUptotop { get; } + + #endregion + } +} diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainer.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainer.cs index 3c6854e1d..86e64c120 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainer.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/DrawableContainer.cs @@ -30,10 +30,10 @@ using System.Drawing; using System.Drawing.Drawing2D; using System.Runtime.Serialization; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; +using Greenshot.Addon.LegacyEditor.Configuration.Impl; using Greenshot.Addon.LegacyEditor.Drawing.Adorners; using Greenshot.Addon.LegacyEditor.Drawing.Fields; using Greenshot.Addon.LegacyEditor.Drawing.Filters; @@ -59,7 +59,8 @@ namespace Greenshot.Addon.LegacyEditor.Drawing private const int M11 = 0; private const int M22 = 3; private static readonly LogSource Log = new LogSource(); - protected static readonly IEditorConfiguration EditorConfig = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + protected static readonly IEditorConfiguration EditorConfig = new EditorConfigurationImpl(); /// /// List of available Adorners diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/AbstractFieldHolder.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/AbstractFieldHolder.cs index e2895a3ae..0e44a9437 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/AbstractFieldHolder.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/AbstractFieldHolder.cs @@ -24,8 +24,8 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Runtime.Serialization; -using Dapplo.Ini; using Dapplo.Log; +using Greenshot.Addon.LegacyEditor.Configuration.Impl; using Greenshot.Addons.Interfaces.Drawing; namespace Greenshot.Addon.LegacyEditor.Drawing.Fields @@ -37,8 +37,10 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Fields public abstract class AbstractFieldHolder : IFieldHolder { private static readonly LogSource Log = new LogSource(); - private static readonly IEditorConfiguration EditorConfig = IniConfig.Current.Get(); - [NonSerialized] + // TODO: Solve, was static reference! + private static readonly IEditorConfiguration EditorConfig = new EditorConfigurationImpl(); + + [NonSerialized] private readonly IDictionary _handlers = new Dictionary(); /// diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/FieldAggregator.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/FieldAggregator.cs index 194caee41..7e4773948 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/FieldAggregator.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/Fields/FieldAggregator.cs @@ -27,7 +27,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; -using Dapplo.Ini; +using Greenshot.Addon.LegacyEditor.Configuration.Impl; using Greenshot.Addons.Interfaces; using Greenshot.Addons.Interfaces.Drawing; @@ -49,7 +49,8 @@ namespace Greenshot.Addon.LegacyEditor.Drawing.Fields [Serializable] public sealed class FieldAggregator : AbstractFieldHolder { - private static readonly IEditorConfiguration EditorConfig = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly IEditorConfiguration EditorConfig = new EditorConfigurationImpl(); private readonly IDrawableContainerList _boundContainers; private bool _internalUpdateRunning; diff --git a/src/Greenshot.Addon.LegacyEditor/Drawing/Surface.cs b/src/Greenshot.Addon.LegacyEditor/Drawing/Surface.cs index ff8c13b09..388dd65fd 100644 --- a/src/Greenshot.Addon.LegacyEditor/Drawing/Surface.cs +++ b/src/Greenshot.Addon.LegacyEditor/Drawing/Surface.cs @@ -33,12 +33,12 @@ using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms; using Dapplo.HttpExtensions; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; using Greenshot.Addon.LegacyEditor.Drawing.Fields; using Greenshot.Addon.LegacyEditor.Memento; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Controls; using Greenshot.Addons.Core; using Greenshot.Addons.Interfaces; @@ -57,12 +57,13 @@ namespace Greenshot.Addon.LegacyEditor.Drawing public sealed class Surface : Control, ISurface, INotifyPropertyChanged { private static readonly LogSource Log = new LogSource(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration conf = new CoreConfigurationImpl(); - /// - /// The number of Surfaces in existance - /// - public static int Count { get; private set; } - private static readonly ICoreConfiguration conf = IniConfig.Current.Get(); + /// + /// The number of Surfaces in existance + /// + public static int Count { get; private set; } /// /// all elements on the surface, needed with serialization diff --git a/src/Greenshot.Addon.LegacyEditor/EditorAddonModule.cs b/src/Greenshot.Addon.LegacyEditor/EditorAddonModule.cs index ad5b1fe35..31f46d7fd 100644 --- a/src/Greenshot.Addon.LegacyEditor/EditorAddonModule.cs +++ b/src/Greenshot.Addon.LegacyEditor/EditorAddonModule.cs @@ -24,8 +24,7 @@ using Autofac; using Dapplo.Addons; using Dapplo.CaliburnMicro.Configuration; -using Dapplo.Ini; -using Dapplo.Language; +using Greenshot.Addon.LegacyEditor.Configuration.Impl; using Greenshot.Addon.LegacyEditor.Controls; using Greenshot.Addon.LegacyEditor.Drawing; using Greenshot.Addon.LegacyEditor.Forms; @@ -41,12 +40,12 @@ namespace Greenshot.Addon.LegacyEditor protected override void Load(ContainerBuilder builder) { builder - .Register(context => IniConfig.Current.Get()) + .Register(context => new EditorConfigurationImpl()) .As() .SingleInstance(); builder - .Register(context => LanguageLoader.Current.Get()) + .Register(context => new EditorLanguageImpl()) .As() .SingleInstance(); diff --git a/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj b/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj index 5cf1108b4..681de736d 100644 --- a/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj +++ b/src/Greenshot.Addon.LegacyEditor/Greenshot.Addon.LegacyEditor.csproj @@ -1,15 +1,36 @@  - netcoreapp3.0 - latest + netcoreapp3.0;net461 true - + + + + + + + + + + + + + + + + + + + + + + + {5b924697-4dcd-4f98-85f1-105cb84b7341} @@ -30,20 +51,19 @@ 2.0.4 - 1.0.83 + 1.1.1-gd01f910204 - 1.0.83 + 1.1.1-gd01f910204 - 0.9.4 + 0.9.6 - - 0.6.6 + 0.7.16 - 0.6.6 + 0.7.16 \ No newline at end of file diff --git a/src/Greenshot.Addon.LegacyEditor/IEditorConfiguration.cs b/src/Greenshot.Addon.LegacyEditor/IEditorConfiguration.cs index a9fd701a1..5b302f58d 100644 --- a/src/Greenshot.Addon.LegacyEditor/IEditorConfiguration.cs +++ b/src/Greenshot.Addon.LegacyEditor/IEditorConfiguration.cs @@ -26,8 +26,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using Dapplo.Ini; -using Dapplo.InterfaceImpl.Extensions; +using Dapplo.Config.Ini; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.User32.Enums; using Greenshot.Gfx.Effects; @@ -41,7 +40,7 @@ namespace Greenshot.Addon.LegacyEditor /// [IniSection("Editor")] [Description("Greenshot editor configuration")] - public interface IEditorConfiguration : IIniSection, INotifyPropertyChanged, ITransactionalProperties + public interface IEditorConfiguration : IIniSection { [Description("Last used colors")] IList RecentColors { get; set; } diff --git a/src/Greenshot.Addon.LegacyEditor/IEditorLanguage.cs b/src/Greenshot.Addon.LegacyEditor/IEditorLanguage.cs index 1831d7ba3..4aa96dcaf 100644 --- a/src/Greenshot.Addon.LegacyEditor/IEditorLanguage.cs +++ b/src/Greenshot.Addon.LegacyEditor/IEditorLanguage.cs @@ -17,13 +17,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -using System.ComponentModel; -using Dapplo.Language; +using Dapplo.Config.Language; namespace Greenshot.Addon.LegacyEditor { [Language("Editor")] - public interface IEditorLanguage : ILanguage, INotifyPropertyChanged + public interface IEditorLanguage : ILanguage { string SettingsDestinationEditor { get; } diff --git a/src/Greenshot.Addon.LegacyEditor/app.config b/src/Greenshot.Addon.LegacyEditor/app.config index efd04e61c..b98217257 100644 --- a/src/Greenshot.Addon.LegacyEditor/app.config +++ b/src/Greenshot.Addon.LegacyEditor/app.config @@ -2,22 +2,6 @@ - - - - - - - - - - - - - - - - diff --git a/src/Greenshot.Addons/AddonsModule.cs b/src/Greenshot.Addons/AddonsModule.cs index 34e964617..5faa5419c 100644 --- a/src/Greenshot.Addons/AddonsModule.cs +++ b/src/Greenshot.Addons/AddonsModule.cs @@ -24,9 +24,8 @@ using Autofac; using Dapplo.Addons; using Dapplo.CaliburnMicro.Configuration; -using Dapplo.Ini; -using Dapplo.Language; using Greenshot.Addons.Components; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Controls; using Greenshot.Addons.Core; using Greenshot.Addons.ViewModels; @@ -39,22 +38,18 @@ namespace Greenshot.Addons protected override void Load(ContainerBuilder builder) { builder - .Register(context => IniConfig.Current.Get()) + .Register(context => new CoreConfigurationImpl()) + .As() .As() .SingleInstance(); builder - .Register(context => IniConfig.Current.Get()) - .As() - .SingleInstance(); - - builder - .Register(context => LanguageLoader.Current.Get()) + .Register(context => new GreenshotLanguageImpl()) .As() .SingleInstance(); builder - .Register(context => IniConfig.Current.Get()) + .Register(context => new HttpConfigurationImpl()) .As() .SingleInstance(); @@ -69,10 +64,6 @@ namespace Greenshot.Addons .RegisterType() .AsSelf(); - builder.RegisterType() - .As() - .SingleInstance(); - builder.RegisterType() .AsSelf() .SingleInstance(); @@ -80,15 +71,5 @@ namespace Greenshot.Addons .AsSelf(); base.Load(builder); } - - /// - private class SetupConfig : IStartable - { - public void Start() - { - // Register the after load, so it's called when the configuration is created - IniConfig.Current.AfterLoad(coreConfiguration => coreConfiguration.AfterLoad()); - } - } } } diff --git a/src/Greenshot.Addons/Config/Impl/CoreConfigurationImpl.cs b/src/Greenshot.Addons/Config/Impl/CoreConfigurationImpl.cs new file mode 100644 index 000000000..a722525bf --- /dev/null +++ b/src/Greenshot.Addons/Config/Impl/CoreConfigurationImpl.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows; +using Dapplo.Config.Ini; +using Dapplo.Windows.Common.Structs; +using Dapplo.Windows.User32.Structs; +using Greenshot.Addons.Core; +using Greenshot.Addons.Core.Enums; +using Greenshot.Core.Enums; + +namespace Greenshot.Addons.Config.Impl +{ + public class CoreConfigurationImpl : IniSectionBase, ICoreConfiguration + { + #region Overrides of IniSectionBase + + public override void AfterLoad() + { + CoreConfigurationExtensions.AfterLoad(this); + } + + #endregion + + #region Implementation of IFileConfiguration + + public string OutputFilePath { get; set; } + public bool OutputFileAllowOverwrite { get; set; } + public string OutputFileFilenamePattern { get; set; } + public OutputFormats OutputFileFormat { get; set; } + public bool OutputFileReduceColors { get; set; } + public bool OutputFileAutoReduceColors { get; set; } + public int OutputFileReduceColorsTo { get; set; } + public int OutputFileJpegQuality { get; set; } + public bool OutputFilePromptQuality { get; set; } + public uint OutputFileIncrementingNumber { get; set; } + public string OptimizePNGCommand { get; set; } + public string OptimizePNGCommandArguments { get; set; } + + #endregion + + #region Implementation of ICaptureConfiguration + + public NativeSize Win10BorderCrop { get; set; } + public bool CaptureMousepointer { get; set; } + public bool CaptureWindowsInteractive { get; set; } + public int CaptureDelay { get; set; } + public ScreenCaptureMode ScreenCaptureMode { get; set; } + public int ScreenToCapture { get; set; } + public WindowCaptureModes WindowCaptureMode { get; set; } + public Color DWMBackgroundColor { get; set; } + public IList NoGDICaptureForProduct { get; set; } + public IList NoDWMCaptureForProduct { get; set; } + public bool WindowCaptureRemoveCorners { get; set; } + public IList WindowCornerCutShape { get; set; } + + #endregion + + #region Implementation of ICoreConfiguration + + public string Language { get; set; } + public string RegionHotkey { get; set; } + public string WindowHotkey { get; set; } + public string FullscreenHotkey { get; set; } + public string LastregionHotkey { get; set; } + public string IEHotkey { get; set; } + public bool IsFirstLaunch { get; set; } + public IList OutputDestinations { get; set; } + public IList PickerDestinations { get; set; } + public IList ClipboardFormats { get; set; } + public bool WindowCaptureAllChildLocations { get; set; } + public bool PlayCameraSound { get; set; } + public bool ShowTrayNotification { get; set; } + public bool OutputFileCopyPathToClipboard { get; set; } + public string OutputFileAsFullpath { get; set; } + public bool OutputPrintPromptOptions { get; set; } + public bool OutputPrintAllowRotate { get; set; } + public bool OutputPrintAllowEnlarge { get; set; } + public bool OutputPrintAllowShrink { get; set; } + public bool OutputPrintCenter { get; set; } + public bool OutputPrintInverted { get; set; } + public bool OutputPrintGrayscale { get; set; } + public bool OutputPrintMonochrome { get; set; } + public byte OutputPrintMonochromeThreshold { get; set; } + public bool OutputPrintFooter { get; set; } + public string OutputPrintFooterPattern { get; set; } + public string NotificationSound { get; set; } + public bool UseProxy { get; set; } + public bool IECapture { get; set; } + public bool IEFieldCapture { get; set; } + public IList WindowClassesToCheckForIE { get; set; } + public int AutoCropDifference { get; set; } + public IList IncludePlugins { get; set; } + public IList ExcludePlugins { get; set; } + public IList ExcludeDestinations { get; set; } + public bool CheckForUpdates { get; set; } + public int UpdateCheckInterval { get; set; } + public DateTime LastUpdateCheck { get; set; } + public bool DisableSettings { get; set; } + public bool DisableQuickSettings { get; set; } + public bool HideTrayicon { get; set; } + public bool HideExpertSettings { get; set; } + public bool ThumnailPreview { get; set; } + public bool OptimizeForRDP { get; set; } + public bool DisableRDPOptimizing { get; set; } + public bool MinimizeWorkingSetSize { get; set; } + public bool CheckForUnstable { get; set; } + public IList ActiveTitleFixes { get; set; } + public IDictionary TitleFixMatcher { get; set; } + public IDictionary TitleFixReplacer { get; set; } + public IList ExperimentalFeatures { get; set; } + public bool EnableSpecialDIBClipboardReader { get; set; } + public ClickActions LeftClickAction { get; set; } + public ClickActions DoubleClickAction { get; set; } + public bool ZoomerEnabled { get; set; } + public float ZoomerOpacity { get; set; } + public int MaxMenuItemLength { get; set; } + public string MailApiTo { get; set; } + public string MailApiCC { get; set; } + public string MailApiBCC { get; set; } + public string LastSaveWithVersion { get; set; } + public bool ProcessEXIFOrientation { get; set; } + public NativeRect LastCapturedRegion { get; set; } + public NativeSize IconSize { get; set; } + public int WebRequestTimeout { get; set; } + public int WebRequestReadWriteTimeout { get; set; } + public bool IsScrollingCaptureEnabled { get; set; } + public bool IsPortable { get; set; } + public ISet Permissions { get; set; } + + #endregion + + #region Implementation of IUiConfiguration + + public WindowStartupLocation DefaultWindowStartupLocation { get; set; } + public bool AreWindowLocationsStored { get; set; } + public IDictionary WindowLocations { get; set; } + + #endregion + } +} diff --git a/src/Greenshot.Addons/Config/Impl/GreenshotLanguageImpl.cs b/src/Greenshot.Addons/Config/Impl/GreenshotLanguageImpl.cs new file mode 100644 index 000000000..dfa60b1cc --- /dev/null +++ b/src/Greenshot.Addons/Config/Impl/GreenshotLanguageImpl.cs @@ -0,0 +1,155 @@ +using Dapplo.Config.Language; + +namespace Greenshot.Addons.Config.Impl +{ + internal class GreenshotLanguageImpl : LanguageBase, IGreenshotLanguage + { + #region Implementation of ICoreTranslations + + public string Cancel { get; } + public string Ok { get; } + + #endregion + + #region Implementation of IGreenshotLanguage + + public string None { get; } + public string AboutBugs { get; } + public string AboutDonations { get; } + public string AboutHost { get; } + public string AboutIcons { get; } + public string AboutLicense { get; } + public string AboutTitle { get; } + public string AboutTranslation { get; } + public string ApplicationTitle { get; } + public string BugreportCancel { get; } + public string BugreportInfo { get; } + public string BugreportTitle { get; } + public string ClipboardError { get; } + public string ClipboardInuse { get; } + public string Close { get; } + public string ColorpickerAlpha { get; } + public string ColorpickerApply { get; } + public string ColorpickerBlue { get; } + public string ColorpickerGreen { get; } + public string ColorpickerHtmlcolor { get; } + public string ColorpickerRecentcolors { get; } + public string ColorpickerRed { get; } + public string ColorpickerTitle { get; } + public string ColorpickerTransparent { get; } + public string ConfigUnauthorizedaccessWrite { get; } + public string ContextmenuAbout { get; } + public string ContextmenuCapturearea { get; } + public string ContextmenuCaptureclipboard { get; } + public string ContextmenuCapturefullscreen { get; } + public string ContextmenuCapturefullscreenAll { get; } + public string ContextmenuCapturefullscreenLeft { get; } + public string ContextmenuCapturefullscreenTop { get; } + public string ContextmenuCapturefullscreenRight { get; } + public string ContextmenuCapturefullscreenBottom { get; } + public string ContextmenuCapturelastregion { get; } + public string ContextmenuCapturewindow { get; } + public string ContextmenuDonate { get; } + public string ContextmenuExit { get; } + public string ContextmenuHelp { get; } + public string ContextmenuOpenfile { get; } + public string ContextmenuQuicksettings { get; } + public string ContextmenuSettings { get; } + public string ContextmenuCaptureie { get; } + public string ContextmenuOpenrecentcapture { get; } + public string Error { get; } + public string ErrorMultipleinstances { get; } + public string ErrorNowriteaccess { get; } + public string ErrorOpenfile { get; } + public string ErrorOpenlink { get; } + public string ErrorSave { get; } + public string ErrorSaveInvalidChars { get; } + public string HelpTitle { get; } + public string JpegqualitydialogChoosejpegquality { get; } + public string QualitydialogDontaskagain { get; } + public string QualitydialogTitle { get; } + public string SettingsReducecolors { get; } + public string PrintError { get; } + public string PrintoptionsAllowcenter { get; } + public string PrintoptionsAllowenlarge { get; } + public string PrintoptionsAllowrotate { get; } + public string PrintoptionsAllowshrink { get; } + public string PrintoptionsColors { get; } + public string PrintoptionsDontaskagain { get; } + public string PrintoptionsPagelayout { get; } + public string PrintoptionsPrintcolor { get; } + public string PrintoptionsPrintgrayscale { get; } + public string PrintoptionsPrintmonochrome { get; } + public string PrintoptionsTimestamp { get; } + public string PrintoptionsInverted { get; } + public string PrintoptionsTitle { get; } + public string QuicksettingsDestinationFile { get; } + public string SettingsAlwaysshowqualitydialog { get; } + public string SettingsAlwaysshowprintoptionsdialog { get; } + public string SettingsApplicationsettings { get; } + public string SettingsAutostartshortcut { get; } + public string SettingsCapture { get; } + public string SettingsCaptureMousepointer { get; } + public string SettingsCaptureWindowsInteractive { get; } + public string SettingsCopypathtoclipboard { get; } + public string SettingsDestination { get; } + public string SettingsDestinationClipboard { get; } + public string SettingsDestinationEditor { get; } + public string SettingsDestinationEmail { get; } + public string SettingsDestinationFile { get; } + public string SettingsDestinationFileas { get; } + public string SettingsDestinationPrinter { get; } + public string SettingsDestinationPicker { get; } + public string SettingsEditor { get; } + public string SettingsFilenamepattern { get; } + public string SettingsGeneral { get; } + public string SettingsIecapture { get; } + public string SettingsJpegquality { get; } + public string SettingsQualitysettings { get; } + public string SettingsLanguage { get; } + public string SettingsMessageFilenamepattern { get; } + public string SettingsOutput { get; } + public string SettingsPlaysound { get; } + public string SettingsPlugins { get; } + public string SettingsPluginsName { get; } + public string SettingsPluginsVersion { get; } + public string SettingsPluginsCreatedby { get; } + public string SettingsPluginsDllpath { get; } + public string SettingsPreferredfilesettings { get; } + public string SettingsPrimaryimageformat { get; } + public string SettingsPrinter { get; } + public string SettingsPrintoptions { get; } + public string SettingsRegisterhotkeys { get; } + public string SettingsShowflashlight { get; } + public string SettingsStoragelocation { get; } + public string SettingsTitle { get; } + public string SettingsTooltipFilenamepattern { get; } + public string SettingsTooltipLanguage { get; } + public string SettingsTooltipPrimaryimageformat { get; } + public string SettingsTooltipRegisterhotkeys { get; } + public string SettingsTooltipStoragelocation { get; } + public string SettingsVisualization { get; } + public string SettingsShownotify { get; } + public string SettingsWaittime { get; } + public string SettingsZoom { get; } + public string SettingsWindowscapture { get; } + public string SettingsWindowCaptureMode { get; } + public string SettingsScreenCaptureMode { get; } + public string SettingsNetwork { get; } + public string SettingsCheckperiod { get; } + public string SettingsUsedefaultproxy { get; } + public string TooltipFirststart { get; } + public string Warning { get; } + public string WarningHotkeys { get; } + public string Hotkeys { get; } + public string WaitIeCapture { get; } + public string UpdateFound { get; } + public string ExportedTo { get; } + public string LatestVersion { get; } + public string CurrentVersion { get; } + public string Expert { get; } + public string DestinationExportFailed { get; } + + #endregion + } +} diff --git a/src/Greenshot.Addons/Config/Impl/HttpConfigurationImpl.cs b/src/Greenshot.Addons/Config/Impl/HttpConfigurationImpl.cs new file mode 100644 index 000000000..879643888 --- /dev/null +++ b/src/Greenshot.Addons/Config/Impl/HttpConfigurationImpl.cs @@ -0,0 +1,55 @@ +using System; +using System.Net; +using System.Net.Cache; +using System.Net.Http; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using System.Security.Principal; +using Dapplo.Config.Ini; +using Dapplo.HttpExtensions; +using Greenshot.Addons.Core; + +namespace Greenshot.Addons.Config.Impl +{ + internal class HttpConfigurationImpl : IniSectionBase, IHttpConfiguration + { + #region Implementation of IHttpSettings + + public IHttpSettings ShallowClone() + { + throw new NotImplementedException(); + } + + public bool AllowAutoRedirect { get; set; } + public ICredentials Credentials { get; set; } + public ClientCertificateOption ClientCertificateOptions { get; set; } + public DecompressionMethods DefaultDecompressionMethods { get; set; } + public string DefaultUserAgent { get; set; } + public bool Expect100Continue { get; set; } + public int MaxAutomaticRedirections { get; set; } + public long MaxResponseContentBufferSize { get; set; } + public bool PreAuthenticate { get; set; } + public TimeSpan RequestTimeout { get; set; } + public bool UseCookies { get; set; } + public bool UseDefaultCredentials { get; set; } + public bool AllowPipelining { get; set; } + public AuthenticationLevel AuthenticationLevel { get; set; } + public X509CertificateCollection ClientCertificates { get; set; } + public TimeSpan ContinueTimeout { get; set; } + public TokenImpersonationLevel ImpersonationLevel { get; set; } + public long MaxRequestContentBufferSize { get; set; } + public int MaxResponseHeadersLength { get; set; } + public int ReadWriteTimeout { get; set; } + public RequestCacheLevel RequestCacheLevel { get; set; } + public bool UseProxy { get; set; } + public bool IgnoreSslCertificateErrors { get; set; } + public string[] ProxyBypassList { get; set; } + public bool ProxyBypassOnLocal { get; set; } + public ICredentials ProxyCredentials { get; set; } + public Uri ProxyUri { get; set; } + public bool UseDefaultCredentialsForProxy { get; set; } + public bool UseDefaultProxy { get; set; } + + #endregion + } +} diff --git a/src/Greenshot.Addons/Controls/AnimatingForm.cs b/src/Greenshot.Addons/Controls/AnimatingForm.cs index 606f9521d..0f6ff371c 100644 --- a/src/Greenshot.Addons/Controls/AnimatingForm.cs +++ b/src/Greenshot.Addons/Controls/AnimatingForm.cs @@ -25,7 +25,7 @@ using System; using System.Windows.Forms; -using Dapplo.Language; +using Dapplo.Config.Language; using Dapplo.Log; using Dapplo.Windows.Gdi32; using Dapplo.Windows.Gdi32.Enums; diff --git a/src/Greenshot.Addons/Controls/ContextMenuToolStripProfessionalRenderer.cs b/src/Greenshot.Addons/Controls/ContextMenuToolStripProfessionalRenderer.cs index 4121b6cc0..b3c235bc0 100644 --- a/src/Greenshot.Addons/Controls/ContextMenuToolStripProfessionalRenderer.cs +++ b/src/Greenshot.Addons/Controls/ContextMenuToolStripProfessionalRenderer.cs @@ -25,7 +25,7 @@ using System.Drawing; using System.Windows.Forms; -using Dapplo.Ini; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Core; using Greenshot.Gfx; @@ -38,8 +38,10 @@ namespace Greenshot.Addons.Controls /// public class ContextMenuToolStripProfessionalRenderer : ToolStripProfessionalRenderer { - private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get(); - private Image _scaledCheckbox; + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl(); + + private Image _scaledCheckbox; private bool _newImage; protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e) { diff --git a/src/Greenshot.Addons/Controls/GreenshotComboBox.cs b/src/Greenshot.Addons/Controls/GreenshotComboBox.cs index f806fb477..e95b1e014 100644 --- a/src/Greenshot.Addons/Controls/GreenshotComboBox.cs +++ b/src/Greenshot.Addons/Controls/GreenshotComboBox.cs @@ -25,8 +25,9 @@ using System; using System.ComponentModel; +using System.Linq; using System.Windows.Forms; -using Dapplo.Language; +using Dapplo.Config.Language; #endregion diff --git a/src/Greenshot.Addons/Controls/GreenshotForm.cs b/src/Greenshot.Addons/Controls/GreenshotForm.cs index 3a911e7a2..eebef46c6 100644 --- a/src/Greenshot.Addons/Controls/GreenshotForm.cs +++ b/src/Greenshot.Addons/Controls/GreenshotForm.cs @@ -26,11 +26,12 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Reflection; using System.Windows.Forms; -using Dapplo.Ini; -using Dapplo.InterfaceImpl.Extensions; -using Dapplo.Language; +using Dapplo.Config.Ini; +using Dapplo.Config.Interfaces; +using Dapplo.Config.Language; using Dapplo.Log; using Dapplo.Windows.Desktop; using Dapplo.Windows.Dpi; @@ -194,7 +195,8 @@ namespace Greenshot.Addons.Controls return; } - var section = IniConfig.Current[configBindable.SectionName]; + // TODO: Fix this + IIniSection section = null; // IniConfig.Current[configBindable.SectionName]; if (section == null) { return; @@ -202,7 +204,7 @@ namespace Greenshot.Addons.Controls // Only update the language, so get the actual value and than repopulate var currentValue = comboxBox.GetSelectedEnum(); - comboxBox.Populate(section[configBindable.PropertyName].ValueType); + comboxBox.Populate(section.GetIniValue(configBindable.PropertyName).ValueType); comboxBox.SetValue(currentValue); } @@ -308,7 +310,8 @@ namespace Greenshot.Addons.Controls continue; } - var section = IniConfig.Current[configBindable.SectionName]; + // TODO: Fix this + IIniSection section = null;//IniConfig.Current[configBindable.SectionName]; if (section == null) { continue; @@ -375,7 +378,8 @@ namespace Greenshot.Addons.Controls continue; } - var section = IniConfig.Current[configBindable.SectionName]; + // TODO: Fix this + IIniSection section = null;//IniConfig.Current[configBindable.SectionName]; if (section == null) { continue; diff --git a/src/Greenshot.Addons/Controls/InvertedBoolenConverter.cs b/src/Greenshot.Addons/Controls/InvertedBooleanConverter.cs similarity index 93% rename from src/Greenshot.Addons/Controls/InvertedBoolenConverter.cs rename to src/Greenshot.Addons/Controls/InvertedBooleanConverter.cs index 7c42d8b75..bc45d5a97 100644 --- a/src/Greenshot.Addons/Controls/InvertedBoolenConverter.cs +++ b/src/Greenshot.Addons/Controls/InvertedBooleanConverter.cs @@ -27,7 +27,7 @@ using System.Windows.Data; namespace Greenshot.Addons.Controls { - public class InvertedBoolenConverter : IValueConverter + public class InvertedBooleanConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { diff --git a/src/Greenshot.Addons/Controls/SaveImageFileDialog.cs b/src/Greenshot.Addons/Controls/SaveImageFileDialog.cs index 8671b2468..7a6de3ad1 100644 --- a/src/Greenshot.Addons/Controls/SaveImageFileDialog.cs +++ b/src/Greenshot.Addons/Controls/SaveImageFileDialog.cs @@ -26,8 +26,8 @@ using System; using System.IO; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Core; using Greenshot.Addons.Interfaces; using Greenshot.Core.Enums; @@ -43,8 +43,9 @@ namespace Greenshot.Addons.Controls public class SaveImageFileDialog : IDisposable { private static readonly LogSource Log = new LogSource(); - private static readonly ICoreConfiguration conf = IniConfig.Current.Get(); - private readonly ICaptureDetails _captureDetails; + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfiguration = new CoreConfigurationImpl(); + private readonly ICaptureDetails _captureDetails; private DirectoryInfo _eagerlyCreatedDirectory; private FilterOption[] _filterOptions; protected SaveFileDialog SaveFileDialog; @@ -145,21 +146,21 @@ namespace Greenshot.Addons.Controls string initialDirectory = null; try { - conf.ValidateAndCorrect(); - initialDirectory = Path.GetDirectoryName(conf.OutputFileAsFullpath); + CoreConfiguration.ValidateAndCorrect(); + initialDirectory = Path.GetDirectoryName(CoreConfiguration.OutputFileAsFullpath); } catch { - Log.Warn().WriteLine("OutputFileAsFullpath was set to {0}, ignoring due to problem in path.", conf.OutputFileAsFullpath); + Log.Warn().WriteLine("OutputFileAsFullpath was set to {0}, ignoring due to problem in path.", CoreConfiguration.OutputFileAsFullpath); } if (!string.IsNullOrEmpty(initialDirectory) && Directory.Exists(initialDirectory)) { SaveFileDialog.InitialDirectory = initialDirectory; } - else if (Directory.Exists(conf.OutputFilePath)) + else if (Directory.Exists(CoreConfiguration.OutputFilePath)) { - SaveFileDialog.InitialDirectory = conf.OutputFilePath; + SaveFileDialog.InitialDirectory = CoreConfiguration.OutputFilePath; } // The following property fixes a problem that the directory where we save is locked (bug #2899790) SaveFileDialog.RestoreDirectory = true; @@ -174,7 +175,7 @@ namespace Greenshot.Addons.Controls PrepareFilterOptions(); var fdf = ""; var preselect = 0; - var outputFileFormatAsString = Enum.GetName(typeof(OutputFormats), conf.OutputFileFormat); + var outputFileFormatAsString = Enum.GetName(typeof(OutputFormats), CoreConfiguration.OutputFileFormat); for (var i = 0; i < _filterOptions.Length; i++) { var fo = _filterOptions[i]; @@ -223,7 +224,7 @@ namespace Greenshot.Addons.Controls private void ApplySuggestedValues() { // build the full path and set dialog properties - FileName = FilenameHelper.GetFilenameWithoutExtensionFromPattern(conf.OutputFileFilenamePattern, _captureDetails); + FileName = FilenameHelper.GetFilenameWithoutExtensionFromPattern(CoreConfiguration.OutputFileFilenamePattern, _captureDetails); } private void CleanUp() diff --git a/src/Greenshot.Addons/Controls/ThumbnailForm.cs b/src/Greenshot.Addons/Controls/ThumbnailForm.cs index cd9aade6e..5b1b490b1 100644 --- a/src/Greenshot.Addons/Controls/ThumbnailForm.cs +++ b/src/Greenshot.Addons/Controls/ThumbnailForm.cs @@ -26,13 +26,14 @@ using System; using System.Drawing; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Desktop; using Dapplo.Windows.DesktopWindowsManager; +using Dapplo.Windows.DesktopWindowsManager.Structs; using Dapplo.Windows.User32; using Dapplo.Windows.User32.Enums; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Core; using Greenshot.Core.Enums; @@ -47,9 +48,10 @@ namespace Greenshot.Addons.Controls /// public sealed class ThumbnailForm : FormWithoutActivation { - private static readonly ICoreConfiguration conf = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration coreConfiguration = new CoreConfigurationImpl(); - private IntPtr _thumbnailHandle = IntPtr.Zero; + private IntPtr _thumbnailHandle = IntPtr.Zero; public ThumbnailForm() { @@ -57,9 +59,9 @@ namespace Greenshot.Addons.Controls FormBorderStyle = FormBorderStyle.None; TopMost = false; Enabled = false; - if (conf.WindowCaptureMode == WindowCaptureModes.Auto || conf.WindowCaptureMode == WindowCaptureModes.Aero) + if (coreConfiguration.WindowCaptureMode == WindowCaptureModes.Auto || coreConfiguration.WindowCaptureMode == WindowCaptureModes.Aero) { - BackColor = Color.FromArgb(255, conf.DWMBackgroundColor.R, conf.DWMBackgroundColor.G, conf.DWMBackgroundColor.B); + BackColor = Color.FromArgb(255, coreConfiguration.DWMBackgroundColor.R, coreConfiguration.DWMBackgroundColor.G, coreConfiguration.DWMBackgroundColor.B); } else { diff --git a/src/Greenshot.Addons/Core/ClipboardHelper.cs b/src/Greenshot.Addons/Core/ClipboardHelper.cs index 15a9854b4..066724b72 100644 --- a/src/Greenshot.Addons/Core/ClipboardHelper.cs +++ b/src/Greenshot.Addons/Core/ClipboardHelper.cs @@ -34,13 +34,13 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Clipboard; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Gdi32.Enums; using Dapplo.Windows.Gdi32.Structs; using Dapplo.Windows.User32; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Core.Enums; using Greenshot.Addons.Interfaces; using Greenshot.Addons.Interfaces.Plugin; @@ -101,8 +101,9 @@ EndSelection:<<<<<<<4 private const int BITMAPFILEHEADER_LENGTH = 14; private static readonly LogSource Log = new LogSource(); private static readonly object ClipboardLockObject = new object(); - private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get(); - private static readonly string FORMAT_FILECONTENTS = "FileContents"; + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl(); + private static readonly string FORMAT_FILECONTENTS = "FileContents"; private static readonly string FORMAT_PNG = "PNG"; private static readonly string FORMAT_PNG_OFFICEART = "PNG+Office Art"; private static readonly string FORMAT_17 = "Format17"; diff --git a/src/Greenshot.Addons/Core/FilenameHelper.cs b/src/Greenshot.Addons/Core/FilenameHelper.cs index 1ec7ac53b..27ec291a9 100644 --- a/src/Greenshot.Addons/Core/FilenameHelper.cs +++ b/src/Greenshot.Addons/Core/FilenameHelper.cs @@ -29,8 +29,8 @@ using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Interfaces; using Greenshot.Core.Enums; @@ -53,14 +53,15 @@ namespace Greenshot.Addons.Core private static readonly Regex CmdVarRegexp = new Regex(@"%(?[^%]+)%", RegexOptions.Compiled); private static readonly Regex SplitRegexp = new Regex(";(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)", RegexOptions.Compiled); - private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl(); - /// - /// Remove invalid characters from the fully qualified filename - /// - /// string with the full path to a file - /// string with the full path to a file, without invalid characters - public static string MakeFqFilenameSafe(string fullPath) + /// + /// Remove invalid characters from the fully qualified filename + /// + /// string with the full path to a file + /// string with the full path to a file, without invalid characters + public static string MakeFqFilenameSafe(string fullPath) { var path = MakePathSafe(Path.GetDirectoryName(fullPath)); var filename = MakeFilenameSafe(Path.GetFileName(fullPath)); diff --git a/src/Greenshot.Addons/Core/ICoreConfiguration.cs b/src/Greenshot.Addons/Core/ICoreConfiguration.cs index c7f3a0128..f866ec414 100644 --- a/src/Greenshot.Addons/Core/ICoreConfiguration.cs +++ b/src/Greenshot.Addons/Core/ICoreConfiguration.cs @@ -27,8 +27,9 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; -using Dapplo.Ini; -using Dapplo.InterfaceImpl.Extensions; +using Dapplo.CaliburnMicro.Configuration; +using Dapplo.Config.Attributes; +using Dapplo.Config.Ini; using Dapplo.Windows.Common.Structs; using Greenshot.Addons.Core.Enums; using Greenshot.Core.Configuration; @@ -42,7 +43,7 @@ namespace Greenshot.Addons.Core /// [IniSection("Core")] [Description("Greenshot core configuration")] - public interface ICoreConfiguration : IIniSection, IFileConfiguration, ICaptureConfiguration, INotifyPropertyChanged, IWriteProtectProperties, IDefaultValue, ITagging, ITransactionalProperties + public interface ICoreConfiguration : IIniSection, IFileConfiguration, ICaptureConfiguration, IUiConfiguration { [Description("The language in IETF format (e.g. en-US)")] string Language { get; set; } @@ -294,7 +295,7 @@ namespace Greenshot.Addons.Core [Description("Defines the base size of the icons (e.g. for the buttons in the editor), default value 16,16 anything bigger will cause scaling")] [DefaultValue("16,16")] - Size IconSize { get; set; } + NativeSize IconSize { get; set; } [Description("The connect timeout value for webrequets, these are seconds")] [DefaultValue(100)] diff --git a/src/Greenshot.Addons/Core/IHttpConfiguration.cs b/src/Greenshot.Addons/Core/IHttpConfiguration.cs index 9efd1d60e..dfb804751 100644 --- a/src/Greenshot.Addons/Core/IHttpConfiguration.cs +++ b/src/Greenshot.Addons/Core/IHttpConfiguration.cs @@ -24,9 +24,8 @@ #region Usings using System.ComponentModel; +using Dapplo.Config.Ini; using Dapplo.HttpExtensions; -using Dapplo.Ini; -using Dapplo.InterfaceImpl.Extensions; #endregion @@ -37,7 +36,7 @@ namespace Greenshot.Addons.Core /// [IniSection("Network")] [Description("Greenshot network configuration")] - public interface IHttpConfiguration : IIniSection, IHttpSettings, INotifyPropertyChanged, IWriteProtectProperties, IDefaultValue, ITransactionalProperties + public interface IHttpConfiguration : IIniSection, IHttpSettings { } } \ No newline at end of file diff --git a/src/Greenshot.Addons/Core/ImageOutput.cs b/src/Greenshot.Addons/Core/ImageOutput.cs index 3fdecedc2..a13fbcd0f 100644 --- a/src/Greenshot.Addons/Core/ImageOutput.cs +++ b/src/Greenshot.Addons/Core/ImageOutput.cs @@ -35,11 +35,10 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; -using Dapplo.Ini; -using Dapplo.Language; using Dapplo.Log; using Dapplo.Windows.Clipboard; using Dapplo.Windows.Common; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Controls; using Greenshot.Addons.Interfaces; using Greenshot.Addons.Interfaces.Plugin; @@ -58,7 +57,8 @@ namespace Greenshot.Addons.Core public static class ImageOutput { private static readonly LogSource Log = new LogSource(); - private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl(); private static readonly int PROPERTY_TAG_SOFTWARE_USED = 0x0131; private static readonly Cache TmpFileCache = new Cache(10 * 60 * 60, RemoveExpiredTmpFile); @@ -139,8 +139,8 @@ namespace Greenshot.Addons.Core var outputSettings = new SurfaceOutputSettings(FormatForFilename(fileNameWithExtension)); if (CoreConfig.OutputFilePromptQuality) { - // TODO: Resolve - var qualityDialog = new QualityDialog(outputSettings, CoreConfig, LanguageLoader.Current.Get()); + // TODO: Resolve, was static reference + var qualityDialog = new QualityDialog(outputSettings, CoreConfig, new GreenshotLanguageImpl()); qualityDialog.ShowDialog(); } // TODO: For now we always overwrite, should be changed diff --git a/src/Greenshot.Addons/Core/InteropWindowCaptureExtensions.cs b/src/Greenshot.Addons/Core/InteropWindowCaptureExtensions.cs index 4f574c1dd..9a9836120 100644 --- a/src/Greenshot.Addons/Core/InteropWindowCaptureExtensions.cs +++ b/src/Greenshot.Addons/Core/InteropWindowCaptureExtensions.cs @@ -28,7 +28,6 @@ using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.App; using Dapplo.Windows.Common; @@ -36,10 +35,12 @@ using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Desktop; using Dapplo.Windows.DesktopWindowsManager; +using Dapplo.Windows.DesktopWindowsManager.Structs; using Dapplo.Windows.Gdi32; using Dapplo.Windows.Icons; using Dapplo.Windows.Kernel32; using Dapplo.Windows.User32.Enums; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Interfaces; using Greenshot.Core.Enums; using Greenshot.Gfx; @@ -55,7 +56,8 @@ namespace Greenshot.Addons.Core public static class InteropWindowCaptureExtensions { private static readonly LogSource Log = new LogSource(); - private static readonly ICoreConfiguration CoreConfiguration = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfiguration = new CoreConfigurationImpl(); private static Color _transparentColor = Color.Transparent; /// diff --git a/src/Greenshot.Addons/Core/PluginUtils.cs b/src/Greenshot.Addons/Core/PluginUtils.cs index 6cc252c02..50ea53b39 100644 --- a/src/Greenshot.Addons/Core/PluginUtils.cs +++ b/src/Greenshot.Addons/Core/PluginUtils.cs @@ -29,10 +29,10 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Icons; using Dapplo.Windows.Icons.Enums; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Interfaces.Forms; using Microsoft.Win32; @@ -61,7 +61,7 @@ namespace Greenshot.Addons.Core } _isHooked = true; - var coreConfiguration = IniConfig.Current.Get(); + var coreConfiguration = new CoreConfigurationImpl(); coreConfiguration.PropertyChanged += OnIconSizeChanged; } diff --git a/src/Greenshot.Addons/Core/WindowCapture.cs b/src/Greenshot.Addons/Core/WindowCapture.cs index d1b2248a7..fc009b81d 100644 --- a/src/Greenshot.Addons/Core/WindowCapture.cs +++ b/src/Greenshot.Addons/Core/WindowCapture.cs @@ -30,7 +30,6 @@ using System.Drawing; using System.Drawing.Imaging; using System.Runtime.InteropServices; using System.Windows.Forms; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Common; using Dapplo.Windows.Common.Extensions; @@ -43,6 +42,7 @@ using Dapplo.Windows.Icons; using Dapplo.Windows.User32; using Dapplo.Windows.User32.Enums; using Dapplo.Windows.User32.Structs; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Interfaces; using Greenshot.Gfx; @@ -56,7 +56,8 @@ namespace Greenshot.Addons.Core public static class WindowCapture { private static readonly LogSource Log = new LogSource(); - private static readonly ICoreConfiguration Configuration = IniConfig.Current.Get(); + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration Configuration = new CoreConfigurationImpl(); /// /// Used to cleanup the unmanged resource in the iconInfo for the CaptureCursor method diff --git a/src/Greenshot.Addons/Extensions/LanguageExtensions.cs b/src/Greenshot.Addons/Extensions/LanguageExtensions.cs index a4d69f986..bbbbc7f99 100644 --- a/src/Greenshot.Addons/Extensions/LanguageExtensions.cs +++ b/src/Greenshot.Addons/Extensions/LanguageExtensions.cs @@ -24,7 +24,7 @@ using System; using System.Collections.Generic; using System.Linq; -using Dapplo.Language; +using Dapplo.Config.Language; using Dapplo.Utils.Extensions; namespace Greenshot.Addons.Extensions diff --git a/src/Greenshot.Addons/Greenshot.Addons.csproj b/src/Greenshot.Addons/Greenshot.Addons.csproj index b93fff73d..af3e0df0d 100644 --- a/src/Greenshot.Addons/Greenshot.Addons.csproj +++ b/src/Greenshot.Addons/Greenshot.Addons.csproj @@ -1,162 +1,75 @@ - + - netcoreapp3.0 - latest + netcoreapp3.0;net461 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - 2.0.4 - - - 1.0.83 + 1.1.1-gd01f910204 - 1.0.83 + 1.1.1-gd01f910204 - 1.0.83 + 1.1.1-gd01f910204 + + + 0.9.6 - 0.9.4 + 0.9.6 - 0.9.4 + 0.9.6 - - - - - - 0.6.6 + 0.7.16 - 0.6.6 + 0.7.16 - - - 2.3.0 + 3.0.0-alpha0082 2.3.0 - - - - - - - Form - - - Component - - - Form - - - MovableShowColorForm.cs - - - Form - - - Component - - - Component - - - Component - - - Form - - - Component - - - Component - - - Component - - - Component - - - Component - - - Form - - - BackgroundForm.cs - - - Component - - - Component - - - Component - - - Form - - - PleaseWaitForm.cs - - - Form - - - QualityDialog.cs - - - Form - - - GreenshotResources.cs - - - - MSBuild:None - - - MSBuild:None - - - MSBuild:None - - - MSBuild:None - Designer - - - MSBuild:None - Designer - - - Designer - MSBuild:None - diff --git a/src/Greenshot.Addons/IGreenshotLanguage.cs b/src/Greenshot.Addons/IGreenshotLanguage.cs index 74dd0e39f..25d9001c2 100644 --- a/src/Greenshot.Addons/IGreenshotLanguage.cs +++ b/src/Greenshot.Addons/IGreenshotLanguage.cs @@ -24,14 +24,14 @@ #region Usings using System.ComponentModel; -using Dapplo.Language; +using Dapplo.Config.Language; #endregion namespace Greenshot.Addons { [Language("Core")] - public interface IGreenshotLanguage : ILanguage, INotifyPropertyChanged, Dapplo.CaliburnMicro.Translations.ICoreTranslations + public interface IGreenshotLanguage : ILanguage, Dapplo.CaliburnMicro.Translations.ICoreTranslations { string None { get; } string AboutBugs { get; } diff --git a/src/Greenshot.Addons/Interfaces/Plugin/SurfaceOutputSettings.cs b/src/Greenshot.Addons/Interfaces/Plugin/SurfaceOutputSettings.cs index 99f947ea5..cebb2de72 100644 --- a/src/Greenshot.Addons/Interfaces/Plugin/SurfaceOutputSettings.cs +++ b/src/Greenshot.Addons/Interfaces/Plugin/SurfaceOutputSettings.cs @@ -24,7 +24,7 @@ #region Usings using System.Collections.Generic; -using Dapplo.Ini; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Core; using Greenshot.Core.Enums; using Greenshot.Gfx.Effects; @@ -35,8 +35,9 @@ namespace Greenshot.Addons.Interfaces.Plugin { public class SurfaceOutputSettings { - private static readonly ICoreConfiguration CoreConfig = IniConfig.Current.Get(); - private bool _disableReduceColors; + // TODO: Solve, was static reference! + private static readonly ICoreConfiguration CoreConfig = new CoreConfigurationImpl(); + private bool _disableReduceColors; private bool _reduceColors; public SurfaceOutputSettings() diff --git a/src/Greenshot.Addons/app.config b/src/Greenshot.Addons/app.config index c20c0c817..b98217257 100644 --- a/src/Greenshot.Addons/app.config +++ b/src/Greenshot.Addons/app.config @@ -2,26 +2,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs b/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs index bace08038..f6220c6f8 100644 --- a/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs +++ b/src/Greenshot.Core/Extensions/InteropWindowCaptureExtensions.cs @@ -37,6 +37,7 @@ using Dapplo.Windows.Common.Extensions; using Dapplo.Windows.Common.Structs; using Dapplo.Windows.Desktop; using Dapplo.Windows.DesktopWindowsManager; +using Dapplo.Windows.DesktopWindowsManager.Structs; using Dapplo.Windows.Gdi32; using Dapplo.Windows.User32; using Dapplo.Windows.User32.Structs; diff --git a/src/Greenshot.Core/Greenshot.Core.csproj b/src/Greenshot.Core/Greenshot.Core.csproj index fb252169a..761d480ba 100644 --- a/src/Greenshot.Core/Greenshot.Core.csproj +++ b/src/Greenshot.Core/Greenshot.Core.csproj @@ -1,31 +1,44 @@  - netcoreapp3.0 - latest + netcoreapp3.0;net461 true - + + + + + + + + + + + + + + + + + + + + + + + - - - - - 0.6.6 + 0.7.16 - - - {f041c685-eb96-4ed1-9ace-0f5bd836610f} - Greenshot.Gfx - + \ No newline at end of file diff --git a/src/Greenshot.Core/app.config b/src/Greenshot.Core/app.config index 4ce296638..dc12e2573 100644 --- a/src/Greenshot.Core/app.config +++ b/src/Greenshot.Core/app.config @@ -2,18 +2,6 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Greenshot.Gfx.Experimental/Greenshot.Gfx.Experimental.csproj b/src/Greenshot.Gfx.Experimental/Greenshot.Gfx.Experimental.csproj index 8c642a83e..9cdb69003 100644 --- a/src/Greenshot.Gfx.Experimental/Greenshot.Gfx.Experimental.csproj +++ b/src/Greenshot.Gfx.Experimental/Greenshot.Gfx.Experimental.csproj @@ -1,67 +1,40 @@ - - - + + - Debug - AnyCPU - {14894A45-AA2C-4BC3-85A3-E388D0BDC1CA} - Library - Properties - Greenshot.Gfx.Experimental - Greenshot.Gfx.Experimental - v4.6.1 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - latest + netcoreapp3.0;net461 true - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - latest - true - - - - - - - - + + + + + + - + + + + + + + + + + + + + + + + + - - - - - - - - - {f041c685-eb96-4ed1-9ace-0f5bd836610f} - Greenshot.Gfx - - - - + + 4.5.0 @@ -73,8 +46,15 @@ 4.5.0 - 4.5.1 + 4.5.2 - + + + + {f041c685-eb96-4ed1-9ace-0f5bd836610f} + Greenshot.Gfx + + + \ No newline at end of file diff --git a/src/Greenshot.Gfx.Experimental/Properties/AssemblyInfo.cs b/src/Greenshot.Gfx.Experimental/Properties/AssemblyInfo.cs deleted file mode 100644 index 5b43d1766..000000000 --- a/src/Greenshot.Gfx.Experimental/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Greenshot.Gfx.Experimental")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Greenshot.Gfx.Experimental")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("14894a45-aa2c-4bc3-85a3-e388d0bdc1ca")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Greenshot.Gfx.Experimental/app.config b/src/Greenshot.Gfx.Experimental/app.config index b64150bec..b98217257 100644 --- a/src/Greenshot.Gfx.Experimental/app.config +++ b/src/Greenshot.Gfx.Experimental/app.config @@ -2,22 +2,6 @@ - - - - - - - - - - - - - - - - diff --git a/src/Greenshot.Gfx/Greenshot.Gfx.csproj b/src/Greenshot.Gfx/Greenshot.Gfx.csproj index 923b38c5c..8426478d7 100644 --- a/src/Greenshot.Gfx/Greenshot.Gfx.csproj +++ b/src/Greenshot.Gfx/Greenshot.Gfx.csproj @@ -1,25 +1,43 @@  - netcoreapp3.0 - latest + netcoreapp3.0;net461 true - - + + + + + + + + + + + + + + + + + + + + + + + + 2.0.4 - 1.0.83 + 1.1.1-gd01f910204 - - - 2.3.0 diff --git a/src/Greenshot.Tests/CaptureTests.cs b/src/Greenshot.Tests/CaptureTests.cs index b5b97176a..bbca527c5 100644 --- a/src/Greenshot.Tests/CaptureTests.cs +++ b/src/Greenshot.Tests/CaptureTests.cs @@ -26,8 +26,8 @@ using System.Linq; using System.Threading.Tasks; using System.Windows.Media.Imaging; using Dapplo.CaliburnMicro.Extensions; -using Dapplo.Ini; using Dapplo.Windows.Desktop; +using Greenshot.Addons.Config.Impl; using Greenshot.Addons.Core; using Greenshot.Core; using Greenshot.Core.Enums; @@ -81,8 +81,7 @@ namespace Greenshot.Tests [WpfFact] public async Task Test_CaptureFlow_DwmWindowSource() { - var iniConfig = new IniConfig("Greenshot.Tests", "Greenshot.Tests"); - var config = iniConfig.Get(); + ICoreConfiguration config = new CoreConfigurationImpl(); var windowToCapture = InteropWindowQuery.GetTopLevelWindows().First(window => window.GetCaption().Contains("Notepad")); var bounds = windowToCapture.GetInfo().Bounds; diff --git a/src/Greenshot.Tests/Greenshot.Tests.csproj b/src/Greenshot.Tests/Greenshot.Tests.csproj index 4d7667e9a..204d0ae3d 100644 --- a/src/Greenshot.Tests/Greenshot.Tests.csproj +++ b/src/Greenshot.Tests/Greenshot.Tests.csproj @@ -1,42 +1,15 @@ - - - + + - Debug - AnyCPU - {9B162E60-12D8-44FD-8093-7D40392F23FA} - Library - Properties - Greenshot.Tests - Greenshot.Tests - v4.6.1 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + net461 true - latest - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - latest - - + + + + + + @@ -62,51 +35,10 @@ + - - - - - - - - - - - - - - - {ad7cffe2-40e7-46cf-a172-d48cf7ae9a12} - Greenshot.Addon.Dropbox - - - {5b924697-4dcd-4f98-85f1-105cb84b7341} - Greenshot.Addons - - - {bf35190d-b2a7-4cfa-b397-51cb384cf0d7} - Greenshot.Core - - - {14894a45-aa2c-4bc3-85a3-e388d0bdc1ca} - Greenshot.Gfx.Experimental - - - {f041c685-eb96-4ed1-9ace-0f5bd836610f} - Greenshot.Gfx - - - {cd642bf4-d815-4d67-a0b5-c69f0b8231af} - Greenshot - - - - - - - - + + PreserveNewest @@ -121,13 +53,12 @@ PreserveNewest - - PreserveNewest Designer + 0.11.1 @@ -139,13 +70,13 @@ 2.0.4 - 1.0.75 + 1.1.1-gd01f910204 - 0.8.46 + 0.9.6 - 2.6.1 + 2.6.2 runtime; build; native; contentfiles; analyzers all @@ -165,7 +96,7 @@ 4.3.0 - 4.5.0 + 4.5.1 4.3.0 @@ -183,7 +114,7 @@ 4.3.1 - 2.4.0 + 2.4.1 2.0.3 @@ -192,16 +123,25 @@ 0.10.0 - 2.4.0 + 2.4.1 - 2.4.0 + 2.4.1 runtime; build; native; contentfiles; analyzers all - 0.2.17 + 0.3.2 - + + + + + + + + + + \ No newline at end of file diff --git a/src/Greenshot.Tests/Properties/AssemblyInfo.cs b/src/Greenshot.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index e314bba58..000000000 --- a/src/Greenshot.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Greenshot.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("Greenshot.Tests")] -[assembly: AssemblyCopyright("Copyright © Greenshot 2007-2018")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9b162e60-12d8-44fd-8093-7d40392f23fa")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Greenshot.Tests/app.config b/src/Greenshot.Tests/app.config index bf9c7a032..b98217257 100644 --- a/src/Greenshot.Tests/app.config +++ b/src/Greenshot.Tests/app.config @@ -2,110 +2,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Greenshot/App.config b/src/Greenshot/App.config index 66aa08b87..1345cf5df 100644 --- a/src/Greenshot/App.config +++ b/src/Greenshot/App.config @@ -10,34 +10,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Greenshot/Components/MainFormStartup.cs b/src/Greenshot/Components/MainFormStartup.cs index 895407e59..682e9a493 100644 --- a/src/Greenshot/Components/MainFormStartup.cs +++ b/src/Greenshot/Components/MainFormStartup.cs @@ -40,7 +40,7 @@ namespace Greenshot.Components /// /// This startup action starts the MainForm /// - [Service(nameof(MainFormStartup), nameof(FormsStartup), nameof(CaliburnServices.IniSectionService), TaskSchedulerName = "ui")] + [Service(nameof(MainFormStartup), nameof(FormsStartup), nameof(CaliburnServices.ConfigurationService), TaskSchedulerName = "ui")] public class MainFormStartup : IStartup, IShutdown { private static readonly LogSource Log = new LogSource(); diff --git a/src/Greenshot/Components/SoundHelper.cs b/src/Greenshot/Components/SoundHelper.cs index 93252ab56..830f7d4f1 100644 --- a/src/Greenshot/Components/SoundHelper.cs +++ b/src/Greenshot/Components/SoundHelper.cs @@ -42,7 +42,7 @@ namespace Greenshot.Components /// Create to fix the sometimes wrongly played sample, especially after first start from IDE /// See: http://www.codeproject.com/KB/audio-video/soundplayerbug.aspx?msg=2487569 /// - [Service(nameof(SoundHelper), nameof(CaliburnServices.IniSectionService))] + [Service(nameof(SoundHelper), nameof(CaliburnServices.ConfigurationService))] public class SoundHelper : IStartup, IShutdown { private readonly ICoreConfiguration _coreConfiguration; diff --git a/src/Greenshot/Configuration/IConfigTranslations.cs b/src/Greenshot/Configuration/IConfigTranslations.cs index c006ad943..869b381cc 100644 --- a/src/Greenshot/Configuration/IConfigTranslations.cs +++ b/src/Greenshot/Configuration/IConfigTranslations.cs @@ -22,12 +22,12 @@ #endregion using System.ComponentModel; -using Dapplo.Language; +using Dapplo.Config.Language; namespace Greenshot.Configuration { [Language("Config")] - public interface IConfigTranslations : Dapplo.CaliburnMicro.Translations.IConfigTranslations, ILanguage, INotifyPropertyChanged + public interface IConfigTranslations : Dapplo.CaliburnMicro.Translations.IConfigTranslations, ILanguage { [DefaultValue("Theme")] string Theme { get; } diff --git a/src/Greenshot/Configuration/IMetroConfiguration.cs b/src/Greenshot/Configuration/IMetroConfiguration.cs index 6f4d390e7..400da3848 100644 --- a/src/Greenshot/Configuration/IMetroConfiguration.cs +++ b/src/Greenshot/Configuration/IMetroConfiguration.cs @@ -1,12 +1,11 @@ using System.ComponentModel; using Dapplo.CaliburnMicro.Metro; -using Dapplo.Ini; -using Dapplo.InterfaceImpl.Extensions; +using Dapplo.Config.Ini; namespace Greenshot.Configuration { [IniSection("Metro")] - public interface IMetroConfiguration : IIniSection, ITransactionalProperties + public interface IMetroConfiguration : IIniSection { [DefaultValue(Themes.BaseLight)] Themes Theme { get; set; } diff --git a/src/Greenshot/Configuration/Impl/ConfigTranslationsImpl.cs b/src/Greenshot/Configuration/Impl/ConfigTranslationsImpl.cs new file mode 100644 index 000000000..0d4ace26c --- /dev/null +++ b/src/Greenshot/Configuration/Impl/ConfigTranslationsImpl.cs @@ -0,0 +1,34 @@ +#region Greenshot GNU General Public License + +// Greenshot - a free and open source screenshot tool +// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom +// +// For more information see: http://getgreenshot.org/ +// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 1 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#endregion + +using Dapplo.Config.Language; + +namespace Greenshot.Configuration.Impl +{ + internal class ConfigTranslationsImpl : LanguageBase, IConfigTranslations + { + public string Filter { get; } + + public string Theme { get; } + } +} diff --git a/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs b/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs new file mode 100644 index 000000000..397f29203 --- /dev/null +++ b/src/Greenshot/Configuration/Impl/MetroConfigurationImpl.cs @@ -0,0 +1,34 @@ +#region Greenshot GNU General Public License + +// Greenshot - a free and open source screenshot tool +// Copyright (C) 2007-2018 Thomas Braun, Jens Klingen, Robin Krom +// +// For more information see: http://getgreenshot.org/ +// The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 1 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#endregion + +using Dapplo.CaliburnMicro.Metro; +using Dapplo.Config.Ini; + +namespace Greenshot.Configuration.Impl +{ + internal class MetroConfigurationImpl : IniSectionBase, IMetroConfiguration + { + public Themes Theme { get; set; } + public ThemeAccents ThemeAccent { get; set; } + } +} diff --git a/src/Greenshot/Forms/AboutForm.cs b/src/Greenshot/Forms/AboutForm.cs index 9afd4d488..eeffa10c5 100644 --- a/src/Greenshot/Forms/AboutForm.cs +++ b/src/Greenshot/Forms/AboutForm.cs @@ -33,7 +33,6 @@ using System.Security.Permissions; using System.Windows.Forms; using Dapplo.CaliburnMicro; using Greenshot.Helpers; -using Dapplo.Ini; using Dapplo.Log; using Dapplo.Windows.Common.Structs; using Greenshot.Addons; diff --git a/src/Greenshot/Greenshot.csproj b/src/Greenshot/Greenshot.csproj index 45f2520ed..9ddd82f72 100644 --- a/src/Greenshot/Greenshot.csproj +++ b/src/Greenshot/Greenshot.csproj @@ -2,83 +2,16 @@ WinExe - netcoreapp3.0 + netcoreapp3.0;net461 latest icons\applicationIcon\icon.ico True greenshot.manifest - - - - - - - + - - - - - 5.0.0 - - - 2.3.0 - - - 2.0.4 - - - - - 1.1.3 - - - 1.0.83 - - - 1.0.83 - - - 1.0.83 - - - 1.0.83 - - - 0.9.4 - - - 0.9.4 - - - - 1.3.11 - - - 1.3.11 - - - 0.6.6 - - - 0.6.6 - - - - 0.6.6 - - - 1.1.0 - - - 2.3.0 - - - 2.3.0 - - + 4.3.0 @@ -117,79 +50,95 @@ 4.3.0 - + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.0.0 + + + 2.3.0 + + + 2.0.4 + + + 1.1.1-gd01f910204 + + + 1.1.1-gd01f910204 + + + 1.1.1-gd01f910204 + + + 1.1.1-gd01f910204 + + + 0.9.6 + + + 0.9.6 + + + 1.3.11 + + + 1.3.11 + + + 0.7.16 + + + 0.7.16 + + + 0.7.16 + + + 1.1.0 + + + 3.0.0-alpha0082 + + + 2.3.0 + - - Greenshot.Addon.InternetExplorer - - - Greenshot.Addon.LegacyEditor - - - Greenshot.Core - - - Greenshot.Gfx - - - Greenshot.Addons - + + + + - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - + + + \ No newline at end of file diff --git a/src/Greenshot/GreenshotAutofacModule.cs b/src/Greenshot/GreenshotAutofacModule.cs index cbf43592c..ff960d917 100644 --- a/src/Greenshot/GreenshotAutofacModule.cs +++ b/src/Greenshot/GreenshotAutofacModule.cs @@ -26,11 +26,10 @@ using Autofac.Features.AttributeFilters; using Dapplo.Addons; using Dapplo.CaliburnMicro.Configuration; using Dapplo.CaliburnMicro.Security; -using Dapplo.Ini; -using Dapplo.Language; using Greenshot.Addons.Components; using Greenshot.Components; using Greenshot.Configuration; +using Greenshot.Configuration.Impl; using Greenshot.Forms; using Greenshot.Helpers; using Greenshot.Ui.Configuration.ViewModels; @@ -46,12 +45,12 @@ namespace Greenshot protected override void Load(ContainerBuilder builder) { builder - .Register(context => IniConfig.Current.Get()) + .Register(context => new MetroConfigurationImpl()) .As() .SingleInstance(); builder - .Register(context => LanguageLoader.Current.Get()) + .Register(context => new ConfigTranslationsImpl()) .As() .SingleInstance(); diff --git a/src/Greenshot/Ui/Configuration/Views/CaptureConfigView.xaml b/src/Greenshot/Ui/Configuration/Views/CaptureConfigView.xaml index ff9824bd6..76b551a8f 100644 --- a/src/Greenshot/Ui/Configuration/Views/CaptureConfigView.xaml +++ b/src/Greenshot/Ui/Configuration/Views/CaptureConfigView.xaml @@ -10,7 +10,7 @@ d:DataContext="{d:DesignInstance viewModels:CaptureConfigViewModel,IsDesignTimeCreatable=False}" > - + @@ -24,7 +24,7 @@ - + diff --git a/src/NuGet.Config b/src/NuGet.Config index 2b5005fdb..fdb112809 100644 --- a/src/NuGet.Config +++ b/src/NuGet.Config @@ -1,9 +1,12 @@  - + + + + \ No newline at end of file