From 2a5903cf1eb97410f05bbaefba69ebe98a41b6d9 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 25 Dec 2020 13:39:51 -0500 Subject: [PATCH] initial commit --- .../AutoSavePlugin.cs | 47 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 46 ++++++++++++++++++ .../UniversalEditor.Plugins.AutoSave.csproj | 48 +++++++++++++++++++ UniversalEditor.sln | 7 +++ 4 files changed, 148 insertions(+) create mode 100644 Plugins/UniversalEditor.Plugins.AutoSave/AutoSavePlugin.cs create mode 100644 Plugins/UniversalEditor.Plugins.AutoSave/Properties/AssemblyInfo.cs create mode 100644 Plugins/UniversalEditor.Plugins.AutoSave/UniversalEditor.Plugins.AutoSave.csproj diff --git a/Plugins/UniversalEditor.Plugins.AutoSave/AutoSavePlugin.cs b/Plugins/UniversalEditor.Plugins.AutoSave/AutoSavePlugin.cs new file mode 100644 index 00000000..169fe311 --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.AutoSave/AutoSavePlugin.cs @@ -0,0 +1,47 @@ +// +// MyClass.cs +// +// Author: +// Michael Becker +// +// Copyright (c) 2020 Mike Becker's Software +// +// 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 3 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 . +using System; +using MBS.Framework.UserInterface; + +namespace UniversalEditor.Plugins.AutoSave +{ + public class AutoSavePlugin : UserInterfacePlugin + { + private Timer tmr = new Timer(); + + private void tmr_Tick(object sender, EventArgs e) + { + Console.WriteLine("autosave: looking for dirty documents..."); + Console.WriteLine("autosave: saving dirty documents in /tmp/autosave/universal-editor/..."); + Console.WriteLine("autosave: going back to sleep"); + } + + + protected override void InitializeInternal() + { + base.InitializeInternal(); + + tmr.Duration = 5 /*minutes*/ * 60 /*seconds in a minute*/ * 1000 /*milliseconds in a second*/; + tmr.Tick += tmr_Tick; + tmr.Enabled = true; + } + } +} diff --git a/Plugins/UniversalEditor.Plugins.AutoSave/Properties/AssemblyInfo.cs b/Plugins/UniversalEditor.Plugins.AutoSave/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..edcc27a9 --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.AutoSave/Properties/AssemblyInfo.cs @@ -0,0 +1,46 @@ +// +// AssemblyInfo.cs +// +// Author: +// Michael Becker +// +// Copyright (c) 2020 Mike Becker's Software +// +// 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 3 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 . +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("UniversalEditor.Plugins.AutoSave")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Mike Becker's Software")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Mike Becker's Software")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/Plugins/UniversalEditor.Plugins.AutoSave/UniversalEditor.Plugins.AutoSave.csproj b/Plugins/UniversalEditor.Plugins.AutoSave/UniversalEditor.Plugins.AutoSave.csproj new file mode 100644 index 00000000..0fe4e2cb --- /dev/null +++ b/Plugins/UniversalEditor.Plugins.AutoSave/UniversalEditor.Plugins.AutoSave.csproj @@ -0,0 +1,48 @@ + + + + Debug + AnyCPU + {385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192} + Library + UniversalEditor.Plugins.AutoSave + UniversalEditor.Plugins.AutoSave + v4.7 + 4.0.2019.12 + + + true + full + false + ..\..\Output\Debug\Plugins + DEBUG; + prompt + 4 + false + + + true + ..\..\Output\Release\Plugins + prompt + 4 + false + + + + + + + + + + + {00266B21-35C9-4A7F-A6BA-D54D7FDCC25C} + MBS.Framework + + + {29E1C1BB-3EA5-4062-B62F-85EEC703FE07} + MBS.Framework.UserInterface + + + + \ No newline at end of file diff --git a/UniversalEditor.sln b/UniversalEditor.sln index 38ca4933..73fb57fe 100644 --- a/UniversalEditor.sln +++ b/UniversalEditor.sln @@ -211,6 +211,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Plugins.Mul EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MBS.Audio", "..\MBS.Audio\MBS.Audio\MBS.Audio.csproj", "{E0897B7B-617A-4709-A4C6-FC0F6B441B2A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalEditor.Plugins.AutoSave", "Plugins\UniversalEditor.Plugins.AutoSave\UniversalEditor.Plugins.AutoSave.csproj", "{385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -607,6 +609,10 @@ Global {E0897B7B-617A-4709-A4C6-FC0F6B441B2A}.Debug|Any CPU.Build.0 = Debug|Any CPU {E0897B7B-617A-4709-A4C6-FC0F6B441B2A}.Release|Any CPU.ActiveCfg = Release|Any CPU {E0897B7B-617A-4709-A4C6-FC0F6B441B2A}.Release|Any CPU.Build.0 = Release|Any CPU + {385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192}.Debug|Any CPU.Build.0 = Debug|Any CPU + {385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192}.Release|Any CPU.ActiveCfg = Release|Any CPU + {385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {6F0AB1AF-E1A1-4D19-B19C-05BBB15C94B2} = {05D15661-E684-4EC9-8FBD-C014BA433CC5} @@ -706,6 +712,7 @@ Global {37504ECC-D87F-4E93-8E08-89C03BAAA6D9} = {2ED32D16-6C06-4450-909A-40D32DA67FB4} {75C99631-122C-4880-806E-646FCB021730} = {7B535D74-5496-4802-B809-89ED88274A91} {E0897B7B-617A-4709-A4C6-FC0F6B441B2A} = {20F315E0-52AE-479F-AF43-3402482C1FC8} + {385AB5A6-3EB6-4DF6-A7BF-DF9FFE43F192} = {2ED32D16-6C06-4450-909A-40D32DA67FB4} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0