-
-
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/Log.Extension.cs b/Duplicati/GUI/Datamodel/Log.Extension.cs
deleted file mode 100644
index bd2624436..000000000
--- a/Duplicati/GUI/Datamodel/Log.Extension.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Duplicati.Datamodel
-{
- public partial class Log
- {
- public string TransferSizeString
- {
- get
- {
- return Library.Utility.Utility.FormatSizeString(this.Transfersize);
- }
- }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/Log.cs b/Duplicati/GUI/Datamodel/Log.cs
deleted file mode 100644
index d704dae60..000000000
--- a/Duplicati/GUI/Datamodel/Log.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// Log
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("Log")]
- public partial class Log : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [Relation("LogTask", typeof(Task), "ID"), DatabaseField("TaskID")]
- private System.Int64 m_TaskID = long.MinValue;
- [DatabaseField("EndTime")]
- private System.DateTime m_EndTime = new System.DateTime(1, 1, 1);
- [DatabaseField("BeginTime")]
- private System.DateTime m_BeginTime = new System.DateTime(1, 1, 1);
- [DatabaseField("Action")]
- private System.String m_Action = "";
- [DatabaseField("SubAction")]
- private System.String m_SubAction = "";
- [DatabaseField("Transfersize")]
- private System.Int64 m_Transfersize = long.MinValue;
- [DatabaseField("ParsedStatus")]
- private System.String m_ParsedStatus = "";
- [DatabaseField("ParsedMessage")]
- private System.String m_ParsedMessage = "";
- [Relation("LogBlob", typeof(LogBlob), "ID"), DatabaseField("LogBlobID")]
- private System.Int64 m_LogBlobID = long.MinValue;
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.Int64 TaskID
- {
- get{return m_TaskID;}
- set{object oldvalue = m_TaskID;OnBeforeDataChange(this, "TaskID", oldvalue, value);m_TaskID = value;OnAfterDataChange(this, "TaskID", oldvalue, value);}
- }
-
- public System.DateTime EndTime
- {
- get{return m_EndTime;}
- set{object oldvalue = m_EndTime;OnBeforeDataChange(this, "EndTime", oldvalue, value);m_EndTime = value;OnAfterDataChange(this, "EndTime", oldvalue, value);}
- }
-
- public System.DateTime BeginTime
- {
- get{return m_BeginTime;}
- set{object oldvalue = m_BeginTime;OnBeforeDataChange(this, "BeginTime", oldvalue, value);m_BeginTime = value;OnAfterDataChange(this, "BeginTime", oldvalue, value);}
- }
-
- public System.String Action
- {
- get{return m_Action;}
- set{object oldvalue = m_Action;OnBeforeDataChange(this, "Action", oldvalue, value);m_Action = value;OnAfterDataChange(this, "Action", oldvalue, value);}
- }
-
- public System.String SubAction
- {
- get{return m_SubAction;}
- set{object oldvalue = m_SubAction;OnBeforeDataChange(this, "SubAction", oldvalue, value);m_SubAction = value;OnAfterDataChange(this, "SubAction", oldvalue, value);}
- }
-
- public System.Int64 Transfersize
- {
- get{return m_Transfersize;}
- set{object oldvalue = m_Transfersize;OnBeforeDataChange(this, "Transfersize", oldvalue, value);m_Transfersize = value;OnAfterDataChange(this, "Transfersize", oldvalue, value);}
- }
-
- public System.String ParsedStatus
- {
- get{return m_ParsedStatus;}
- set{object oldvalue = m_ParsedStatus;OnBeforeDataChange(this, "ParsedStatus", oldvalue, value);m_ParsedStatus = value;OnAfterDataChange(this, "ParsedStatus", oldvalue, value);}
- }
-
- public System.String ParsedMessage
- {
- get { return m_ParsedMessage; }
- set { object oldvalue = m_ParsedMessage; OnBeforeDataChange(this, "ParsedMessage", oldvalue, value); m_ParsedMessage = value; OnAfterDataChange(this, "ParsedMessage", oldvalue, value); }
- }
-
- public System.Int64 LogBlobID
- {
- get{return m_LogBlobID;}
- set{object oldvalue = m_LogBlobID;OnBeforeDataChange(this, "LogBlobID", oldvalue, value);m_LogBlobID = value;OnAfterDataChange(this, "LogBlobID", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Task))]
- public Task OwnerTask
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("LogTask", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("LogTask", this, value); }
- }
-
- [Affects(typeof(LogBlob))]
- public LogBlob Blob
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("LogBlob", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("LogBlob", this, value); }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/LogBlob.Extension.cs b/Duplicati/GUI/Datamodel/LogBlob.Extension.cs
deleted file mode 100644
index ffdb0ae72..000000000
--- a/Duplicati/GUI/Datamodel/LogBlob.Extension.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Duplicati.Datamodel
-{
- public partial class LogBlob
- {
- public string StringData
- {
- get
- {
- return System.Text.Encoding.UTF8.GetString(this.Data);
- }
- set
- {
- this.Data = System.Text.Encoding.UTF8.GetBytes(value);
- }
- }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/LogBlob.cs b/Duplicati/GUI/Datamodel/LogBlob.cs
deleted file mode 100644
index 27dd34412..000000000
--- a/Duplicati/GUI/Datamodel/LogBlob.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// LogBlob
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("LogBlob")]
- public partial class LogBlob : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, Relation("LogBlob", typeof(Log), "LogBlobID", false), DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [DatabaseField("Data")]
- private System.Byte[] m_Data = null;
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.Byte[] Data
- {
- get{return m_Data;}
- set{object oldvalue = m_Data;OnBeforeDataChange(this, "Data", oldvalue, value);m_Data = value;OnAfterDataChange(this, "Data", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Log))]
- public Log Log
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("LogBlob", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("LogBlob", this, value); }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/Schedule.Extension.cs b/Duplicati/GUI/Datamodel/Schedule.Extension.cs
deleted file mode 100644
index 064932b53..000000000
--- a/Duplicati/GUI/Datamodel/Schedule.Extension.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Duplicati.Datamodel
-{
- public partial class Schedule
- {
- private DateTime m_nextSchedule = new DateTime();
-
- public bool ExistsInDb
- {
- get { return this.ID > 0; }
- }
-
- ///
- /// Gets or sets the next scheduled time.
- /// Note that this property is volatile, so
- /// commiting the object will not persist this value.
- /// Only a call to ScheduledRunCompleted will persist this value.
- ///
- public DateTime NextScheduledTime
- {
- get
- {
- if (m_nextSchedule.Ticks == 0)
- return this.When;
- else
- return m_nextSchedule;
- }
- set
- {
- m_nextSchedule = value;
- }
- }
-
- ///
- /// Signals that the a scheduled run has completed.
- /// Will write a new scheduled time to the database
- ///
- public void ScheduledRunCompleted()
- {
- if (m_nextSchedule.Ticks != 0)
- {
- this.When = m_nextSchedule;
- m_nextSchedule = new DateTime();
- ((System.Data.LightDatamodel.IDataFetcherWithRelations)this.DataParent).CommitRecursiveWithRelations(this);
- }
- }
-
- ///
- /// Signals that the operation failed and that the backup
- ///
- public void ScheduledRunFailed()
- {
- m_nextSchedule = new DateTime(0);
- }
-
- ///
- /// Gets or sets the schedule allowed weekdays,
- /// this is a parser/wrapper for the Weekdays string
- ///
- public DayOfWeek[] AllowedWeekdays
- {
- get
- {
- if (string.IsNullOrEmpty(this.Weekdays))
- return null;
- else
- {
- string[] names = System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedDayNames;
- List l = new List();
- foreach(string s in this.Weekdays.Split(','))
- {
- int x = -1;
- for(int i = 0; i < names.Length; i++)
- if (s.Trim().Equals(names[i], StringComparison.InvariantCultureIgnoreCase))
- {
- x = i;
- break;
- }
-
- if (x >= 0 && !l.Contains((DayOfWeek)x))
- l.Add((DayOfWeek)x);
- }
-
- l.Sort();
- return l.ToArray();
- }
- }
- set
- {
- if (value == null || value.Length == 0)
- this.Weekdays = null;
- else
- {
- //Filter duplicates
- List l = new List();
- foreach (DayOfWeek d in value)
- if (!l.Contains(d))
- l.Add(d);
-
- //If all is selected, don't store
- if (l.Count == 7)
- this.Weekdays = null;
- else
- {
- l.Sort();
-
- StringBuilder sb = new StringBuilder();
- foreach (DayOfWeek d in l)
- {
- if (sb.Length != 0)
- sb.Append(",");
- sb.Append(System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedDayNames[(int)d]);
- }
-
- this.Weekdays = sb.ToString();
- }
- }
- }
- }
-
- private SettingsHelper m_metadataLookup;
-
- public IDictionary MetadataLookup
- {
- get
- {
- //Extra check because the datamodel copies the collection between contexts... not nice
- if (m_metadataLookup == null || m_metadataLookup.DataParent != this.DataParent || m_metadataLookup.Collection != this.Metadata)
- m_metadataLookup = new SettingsHelper(this.DataParent, this.Metadata, "Name", "Value");
-
- return m_metadataLookup;
- }
- }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/Schedule.cs b/Duplicati/GUI/Datamodel/Schedule.cs
deleted file mode 100644
index 5e384936d..000000000
--- a/Duplicati/GUI/Datamodel/Schedule.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// Schedule
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("Schedule")]
- public partial class Schedule : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, Relation("TaskSchedule", typeof(Task), "ScheduleID", false), Relation("ScheduleMetadataSchedule", typeof(ScheduleMetadata), "ScheduleID", false), DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [DatabaseField("Name")]
- private System.String m_Name = "";
- [DatabaseField("Path")]
- private System.String m_Path = "";
- [DatabaseField("When")]
- private System.DateTime m_When = new System.DateTime(1, 1, 1);
- [DatabaseField("Repeat")]
- private System.String m_Repeat = "";
- [DatabaseField("Weekdays")]
- private System.String m_Weekdays = "";
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.String Name
- {
- get{return m_Name;}
- set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
- }
-
- public System.String Path
- {
- get{return m_Path;}
- set{object oldvalue = m_Path;OnBeforeDataChange(this, "Path", oldvalue, value);m_Path = value;OnAfterDataChange(this, "Path", oldvalue, value);}
- }
-
- public System.DateTime When
- {
- get{return m_When;}
- set{object oldvalue = m_When;OnBeforeDataChange(this, "When", oldvalue, value);m_When = value;OnAfterDataChange(this, "When", oldvalue, value);}
- }
-
- public System.String Repeat
- {
- get{return m_Repeat;}
- set{object oldvalue = m_Repeat;OnBeforeDataChange(this, "Repeat", oldvalue, value);m_Repeat = value;OnAfterDataChange(this, "Repeat", oldvalue, value);}
- }
-
- public System.String Weekdays
- {
- get{return m_Weekdays;}
- set{object oldvalue = m_Weekdays;OnBeforeDataChange(this, "Weekdays", oldvalue, value);m_Weekdays = value;OnAfterDataChange(this, "Weekdays", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Task))]
- public Task Task
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("TaskSchedule", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskSchedule", this, value); }
- }
-
- [Affects(typeof(ScheduleMetadata))]
- public System.Collections.Generic.IList Metadata
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("ScheduleMetadataSchedule", this);
- }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/ScheduleMetadata.cs b/Duplicati/GUI/Datamodel/ScheduleMetadata.cs
deleted file mode 100644
index 88785ceaa..000000000
--- a/Duplicati/GUI/Datamodel/ScheduleMetadata.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// ScheduleMetadata
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("ScheduleMetadata")]
- public partial class ScheduleMetadata : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [Relation("ScheduleMetadataSchedule", typeof(Schedule), "ID"), DatabaseField("ScheduleID")]
- private System.Int64 m_ScheduleID = long.MinValue;
- [DatabaseField("Name")]
- private System.String m_Name = "";
- [DatabaseField("Value")]
- private System.String m_Value = "";
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.Int64 ScheduleID
- {
- get{return m_ScheduleID;}
- set{object oldvalue = m_ScheduleID;OnBeforeDataChange(this, "ScheduleID", oldvalue, value);m_ScheduleID = value;OnAfterDataChange(this, "ScheduleID", oldvalue, value);}
- }
-
- public System.String Name
- {
- get{return m_Name;}
- set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
- }
-
- public System.String Value
- {
- get{return m_Value;}
- set{object oldvalue = m_Value;OnBeforeDataChange(this, "Value", oldvalue, value);m_Value = value;OnAfterDataChange(this, "Value", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Schedule))]
- public Schedule Schedule
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("ScheduleMetadataSchedule", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("ScheduleMetadataSchedule", this, value); }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/SettingExtension.Extension.cs b/Duplicati/GUI/Datamodel/SettingExtension.Extension.cs
deleted file mode 100644
index e0cc3f1a4..000000000
--- a/Duplicati/GUI/Datamodel/SettingExtension.Extension.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Duplicati.Datamodel
-{
- public partial class SettingExtension
- {
- public static IDictionary GetExtensions(System.Data.LightDatamodel.IDataFetcher fetcher, string key)
- {
- return new ExtDict(fetcher, key);
- }
-
- private class ExtDict : SettingsHelper
- {
- private string m_key;
- public ExtDict(System.Data.LightDatamodel.IDataFetcher fetcher, string key)
- : base(fetcher, new List(fetcher.GetObjects("SettingKey LIKE ?", key)), "Name", "Value")
- {
- m_key = key;
- }
-
- public override void Add(string key, string value)
- {
- base.Add(key, value);
- base.InternalSettings[key].SettingKey = m_key;
- }
- }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/SettingExtension.cs b/Duplicati/GUI/Datamodel/SettingExtension.cs
deleted file mode 100644
index db909b293..000000000
--- a/Duplicati/GUI/Datamodel/SettingExtension.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// SettingExtension
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("SettingExtension")]
- public partial class SettingExtension : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [DatabaseField("SettingKey")]
- private System.String m_SettingKey = "";
- [DatabaseField("Name")]
- private System.String m_Name = "";
- [DatabaseField("Value")]
- private System.String m_Value = "";
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.String SettingKey
- {
- get{return m_SettingKey;}
- set{object oldvalue = m_SettingKey;OnBeforeDataChange(this, "SettingKey", oldvalue, value);m_SettingKey = value;OnAfterDataChange(this, "SettingKey", oldvalue, value);}
- }
-
- public System.String Name
- {
- get{return m_Name;}
- set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
- }
-
- public System.String Value
- {
- get{return m_Value;}
- set{object oldvalue = m_Value;OnBeforeDataChange(this, "Value", oldvalue, value);m_Value = value;OnAfterDataChange(this, "Value", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/SettingsHelper.cs b/Duplicati/GUI/Datamodel/SettingsHelper.cs
deleted file mode 100644
index 3f64329cf..000000000
--- a/Duplicati/GUI/Datamodel/SettingsHelper.cs
+++ /dev/null
@@ -1,321 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Data.LightDatamodel;
-using System.Reflection;
-
-namespace Duplicati.Datamodel
-{
- public class SettingsHelper
- : IDictionary
- where TBase : IDataClass
- {
- private Dictionary m_settings;
- private IList m_col;
- private IDataFetcher m_parent;
-
- private PropertyInfo m_keyfield;
- private PropertyInfo m_valuefield;
-
- public SettingsHelper(IDataFetcher parent, IList col, string keyfield, string valuefield)
- : this(parent, col, typeof(TBase).GetProperty(keyfield), typeof(TBase).GetProperty(valuefield))
-
- {
- }
-
- public SettingsHelper(IDataFetcher parent, IList col, PropertyInfo keyfield, PropertyInfo valuefield)
- {
- m_parent = parent;
- m_col = col;
- m_keyfield = keyfield;
- m_valuefield = valuefield;
-
- if (m_parent == null)
- throw new ArgumentNullException("parent");
- if (m_col == null)
- throw new ArgumentNullException("col");
- if (m_keyfield == null)
- throw new ArgumentNullException("keyfield");
- if (m_valuefield == null)
- throw new ArgumentNullException("valuefield");
-
- parent.AfterDataConnection += new DataConnectionEventHandler(parent_AfterDataConnection);
- }
-
- void parent_AfterDataConnection(object sender, DataActions action)
- {
- if (action != DataActions.Fetch)
- m_settings = null;
-
- }
-
- public PropertyInfo KeyField { get { return m_keyfield; } }
- public PropertyInfo ValueField { get { return m_valuefield; } }
-
- protected Dictionary InternalSettings
- {
- get
- {
- if (m_settings == null)
- {
- m_settings = new Dictionary();
-
- foreach (TBase item in m_col)
- if (!m_settings.ContainsKey((TKey)m_keyfield.GetValue(item, null)))
- m_settings.Add((TKey)m_keyfield.GetValue(item, null), item);
- }
-
- return m_settings;
- }
- }
-
- #region IDictionary Members
-
- public virtual void Add(TKey key, TValue value)
- {
- TBase item = Activator.CreateInstance();
- m_keyfield.SetValue(item, key, null);
- m_valuefield.SetValue(item, value, null);
-
- InternalSettings.Add(key, item);
- m_parent.Add(item);
- m_col.Add(item);
- }
-
- public bool ContainsKey(TKey key)
- {
- return InternalSettings.ContainsKey(key);
- }
-
- public ICollection Keys
- {
- get { return InternalSettings.Keys; }
- }
-
- public bool Remove(TKey key)
- {
- if (InternalSettings.ContainsKey(key))
- {
- m_col.Remove(InternalSettings[key]);
- m_parent.DeleteObject(InternalSettings[key]);
- }
-
- return InternalSettings.Remove(key);
- }
-
- public bool TryGetValue(TKey key, out TValue value)
- {
- TBase item;
- if (InternalSettings.TryGetValue(key, out item))
- {
- value = (TValue)m_valuefield.GetValue(item, null);
- return true;
- }
- else
- {
- value = default(TValue);
- return false;
- }
-
- }
-
- public ICollection Values
- {
- get
- {
- List lst = new List();
- foreach (TBase item in InternalSettings.Values)
- lst.Add((TValue)m_valuefield.GetValue(item, null));
- return lst;
- }
- }
-
- public TValue this[TKey key]
- {
- get
- {
- TBase tmp;
- if (InternalSettings.TryGetValue(key, out tmp))
- return (TValue)m_valuefield.GetValue(tmp, null);
- else
- return default(TValue);
- }
- set
- {
- bool exists = InternalSettings.ContainsKey(key);
-
- if (value == null && exists)
- {
- //Remove
- this.Remove(key);
- }
- else if (value != null && !exists)
- {
- //Add
- this.Add(key, value);
- }
- else if (value != null && exists)
- {
- //Update
- m_valuefield.SetValue(InternalSettings[key], value, null);
- }
- //else: It should be removed, but does not exist
-
- }
- }
-
- #endregion
-
- #region ICollection> Members
-
- public void Add(KeyValuePair item)
- {
- this.Add(item.Key, item.Value);
- }
-
- public void Clear()
- {
- while (m_col.Count > 0)
- {
- TBase item = m_col[0];
- m_col.Remove(item);
- m_parent.DeleteObject(item);
- }
-
- InternalSettings.Clear();
- }
-
- public bool Contains(KeyValuePair item)
- {
- if (!InternalSettings.ContainsKey(item.Key))
- return false;
-
- TValue v = this[item.Key];
- if (v == null && item.Value == null)
- return true;
- else if (v == null)
- return false;
- else
- return v.Equals(item.Value);
- }
-
- public void CopyTo(KeyValuePair[] array, int arrayIndex)
- {
- ((ICollection>)(InternalSettings)).CopyTo(array, arrayIndex);
- }
-
- public int Count
- {
- get { return InternalSettings.Count; }
- }
-
- public bool IsReadOnly
- {
- get { return false; }
- }
-
- public bool Remove(KeyValuePair item)
- {
- if (!this.Contains(item))
- return false;
-
- return this.Remove(item.Key);
- }
-
- #endregion
-
- #region IEnumerable> Members
-
- public IEnumerator> GetEnumerator()
- {
- return new TranslatoryEnumerator(this, InternalSettings.GetEnumerator());
- }
-
- #endregion
-
- #region IEnumerable Members
-
- System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
- {
- return ((System.Collections.IEnumerable)InternalSettings).GetEnumerator();
- }
-
- #endregion
-
-
- private class TranslatoryEnumerator : IEnumerator>
- {
- private SettingsHelper m_parent;
- private IEnumerator> m_base;
-
- public TranslatoryEnumerator(SettingsHelper parent, IEnumerator> en)
- {
- m_parent = parent;
- m_base = en;
- }
-
- #region IEnumerator> Members
-
- public KeyValuePair Current
- {
- get
- {
- return new KeyValuePair(m_base.Current.Key, (TValue)m_parent.ValueField.GetValue(m_base.Current.Value, null));
- }
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose()
- {
- m_parent = null;
- m_base = null;
- }
-
- #endregion
-
- #region IEnumerator Members
-
- object System.Collections.IEnumerator.Current
- {
- get { return new System.Collections.DictionaryEntry(m_base.Current.Key, (TValue)m_parent.KeyField.GetValue(m_base.Current.Value, null)); }
- }
-
- public bool MoveNext()
- {
- return m_base.MoveNext();
- }
-
- public void Reset()
- {
- m_base.Reset();
- }
-
- #endregion
- }
-
- public IDataFetcher DataParent { get { return m_parent; } }
- public IList Collection { get { return m_col; } }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/Strings/DatabaseUpgrader.Designer.cs b/Duplicati/GUI/Datamodel/Strings/DatabaseUpgrader.Designer.cs
deleted file mode 100644
index f0c5e484f..000000000
--- a/Duplicati/GUI/Datamodel/Strings/DatabaseUpgrader.Designer.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.269
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace Duplicati.Datamodel.Strings {
- using System;
-
-
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class DatabaseUpgrader {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal DatabaseUpgrader() {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Duplicati.Datamodel.Strings.DatabaseUpgrader", typeof(DatabaseUpgrader).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- ///
- /// Looks up a localized string similar to backup.
- ///
- internal static string BackupFilenamePrefix {
- get {
- return ResourceManager.GetString("BackupFilenamePrefix", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Unable to determine database format: {0}.
- ///
- internal static string DatabaseFormatError {
- get {
- return ResourceManager.GetString("DatabaseFormatError", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to
- ///The database has version {0} but the largest supported version is {1}.
- ///
- ///This is likely caused by upgrading to a newer version and then downgrading.
- ///If this is the case, there is likely a backup file of the previous database version in the folder {2}..
- ///
- internal static string InvalidVersionError {
- get {
- return ResourceManager.GetString("InvalidVersionError", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Unknown table layout detected.
- ///
- internal static string TableLayoutError {
- get {
- return ResourceManager.GetString("TableLayoutError", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Failed to execute SQL: {0}
- ///Error: {1}
- ///Database is NOT upgraded..
- ///
- internal static string UpgradeFailure {
- get {
- return ResourceManager.GetString("UpgradeFailure", resourceCulture);
- }
- }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/Strings/DatabaseUpgrader.resx b/Duplicati/GUI/Datamodel/Strings/DatabaseUpgrader.resx
deleted file mode 100644
index 9a48a0514..000000000
--- a/Duplicati/GUI/Datamodel/Strings/DatabaseUpgrader.resx
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- backup
- A string prefixed to the name of the database when making a backup
-
-
- Unable to determine database format: {0}
- An error message that is displayed if an error occurs while determining database layout
-
-
-
-The database has version {0} but the largest supported version is {1}.
-
-This is likely caused by upgrading to a newer version and then downgrading.
-If this is the case, there is likely a backup file of the previous database version in the folder {2}.
- An error message that is displayed if the database version number does not match
-
-
- Unknown table layout detected
- An error message that is displayed when the layout of the database is unexpected
-
-
- Failed to execute SQL: {0}
-Error: {1}
-Database is NOT upgraded.
- An error message displayed if one of the upgrade SQL statements fail
-
-
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/Task.Extension.cs b/Duplicati/GUI/Datamodel/Task.Extension.cs
deleted file mode 100644
index 5bd2a2531..000000000
--- a/Duplicati/GUI/Datamodel/Task.Extension.cs
+++ /dev/null
@@ -1,355 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-using System;
-using System.Collections.Generic;
-using System.Collections.Specialized;
-using System.Text;
-
-
-namespace Duplicati.Datamodel
-{
- public partial class Task
- {
- public Task()
- {
- this.AfterDataCommit += new System.Data.LightDatamodel.DataConnectionEventHandler(Task_AfterDataCommit);
- }
-
- void Task_AfterDataCommit(object sender, System.Data.LightDatamodel.DataActions action)
- {
- if (action != System.Data.LightDatamodel.DataActions.Fetch)
- {
- m_backendSettings = null;
- m_extensionSettings = null;
- }
- }
-
- private SettingsHelper m_backendSettings;
- private SettingsHelper m_extensionSettings;
-
- private SettingsHelper m_taskOverrides;
-
- private SettingsHelper m_encryptionSettings;
- private SettingsHelper m_compressionSettings;
-
- public IDictionary BackendSettingsLookup
- {
- get
- {
- //Extra check because the datamodel copies the collection between contexts... not nice
- if (m_backendSettings == null || m_backendSettings.DataParent != this.DataParent || m_backendSettings.Collection != this.BackendSettings)
- m_backendSettings = new SettingsHelper(this.DataParent, this.BackendSettings, "Name", "Value");
-
- return m_backendSettings;
- }
- }
-
- public IDictionary TaskExtensionsLookup
- {
- get
- {
- //Extra check because the datamodel copies the collection between contexts... not nice
- if (m_extensionSettings == null || m_extensionSettings.DataParent != this.DataParent || m_extensionSettings.Collection != this.TaskExtensions)
- m_extensionSettings = new SettingsHelper(this.DataParent, this.TaskExtensions, "Name", "Value");
-
- return m_extensionSettings;
- }
- }
-
- public IDictionary TaskOverridesLookup
- {
- get
- {
- //Extra check because the datamodel copies the collection between contexts... not nice
- if (m_taskOverrides == null || m_taskOverrides.DataParent != this.DataParent || m_taskOverrides.Collection != this.TaskOverrides)
- m_taskOverrides = new SettingsHelper(this.DataParent, this.TaskOverrides, "Name", "Value");
-
- return m_taskOverrides;
- }
- }
-
- public IDictionary EncryptionSettingsLookup
- {
- get
- {
- //Extra check because the datamodel copies the collection between contexts... not nice
- if (m_encryptionSettings == null || m_encryptionSettings.DataParent != this.DataParent || m_encryptionSettings.Collection != this.EncryptionSettings)
- m_encryptionSettings = new SettingsHelper(this.DataParent, this.EncryptionSettings, "Name", "Value");
-
- return m_encryptionSettings;
- }
- }
-
- public IDictionary CompressionSettingsLookup
- {
- get
- {
- //Extra check because the datamodel copies the collection between contexts... not nice
- if (m_compressionSettings == null || m_compressionSettings.DataParent != this.DataParent || m_compressionSettings.Collection != this.CompressionSettings)
- m_compressionSettings = new SettingsHelper(this.DataParent, this.CompressionSettings, "Name", "Value");
-
- return m_compressionSettings;
- }
- }
-
- public TaskExtensionWrapper Extensions
- {
- get { return new TaskExtensionWrapper(this); }
- }
-
- public string FilterXml
- {
- get
- {
- if (this.Filters.Count <= 0)
- return "";
-
- System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
- System.Xml.XmlNode root = doc.AppendChild(doc.CreateElement("root"));
-
- foreach (TaskFilter f in this.SortedFilters)
- {
- System.Xml.XmlNode e = root.AppendChild(doc.CreateElement("filter"));
- e.Attributes.Append(doc.CreateAttribute("include")).Value = f.Include.ToString();
- e.Attributes.Append(doc.CreateAttribute("filter")).Value = f.Filter ?? "";
- e.Attributes.Append(doc.CreateAttribute("globbing")).Value = f.GlobbingFilter ?? "";
- }
-
- return doc.OuterXml;
- }
- set
- {
- //Delete previous ones
- this.SortedFilters = new TaskFilter[0];
-
- if (string.IsNullOrEmpty(value))
- return;
-
- System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
- doc.LoadXml(value);
-
- List filters = new List();
- foreach(System.Xml.XmlNode n in doc.SelectNodes("root/filter"))
- {
- TaskFilter tf = this.DataParent.Add();
- tf.Include = bool.Parse(n.Attributes["include"].Value);
- tf.GlobbingFilter = n.Attributes["globbing"].Value;
- tf.Filter = n.Attributes["filter"].Value;
- filters.Add(tf);
- }
-
- this.SortedFilters = filters.ToArray();
- }
- }
-
- public bool ExistsInDb
- {
- get { return this.ID > 0; }
- }
-
-
- public TaskFilter[] SortedFilters
- {
- get
- {
- return System.Data.LightDatamodel.Query.Parse("ORDER BY SortOrder").EvaluateList(this.Filters).ToArray();
- }
- set
- {
- foreach (TaskFilter t in this.SortedFilters)
- if (Array.IndexOf(value, t) >= 0)
- this.Filters.Remove(t);
- else
- t.DataParent.DeleteObject(t);
-
- int index = 0;
- foreach (TaskFilter t in value)
- {
- t.SortOrder = index++;
- this.Filters.Add(t);
- }
- }
- }
-
-
- public class TaskExtensionWrapper
- {
- private const string MAX_UPLOAD_SIZE = "Max Upload Size";
- private const string UPLOAD_BANDWIDTH = "Upload Bandwidth";
- private const string DOWNLOAD_BANDWIDTH = "Download Bandwidth";
- private const string VOLUME_SIZE = "Volume Size";
- private const string THREAD_PRIORITY = "Thread Priority";
- private const string ASYNC_TRANSFER = "Async Transfer";
- private const string INCLUDE_SETUP = "Include Setup";
- private const string IGNORE_TIMESTAMPS = "Ignore Timestamps";
- private const string FILE_SIZE_LIMIT = "File Size Limit";
-
- private const string SELECTFILES_VERSION = "Select Files - Version";
- private const string SELECTFILES_USESIMPLEMODE = "Select Files - Use Simple Mode";
- private const string SELECTFILES_INCLUDEDOCUMENTS = "Select Files - Include Documents";
- private const string SELECTFILES_INCLUDEDESKTOP = "Select Files - Include Desktop";
- private const string SELECTFILES_INCLUDEMUSIC = "Select Files - Include Music";
- private const string SELECTFILES_INCLUDEIMAGES = "Select Files - Include Images";
- private const string SELECTFILES_INCLUDEAPPDATA = "Select Files - Include AppData";
-
- private const string SELECTWHEN_WARNEDNOSCHEDULE = "Select When - Warned No Schedule";
- private const string SELECTWHEN_WARNEDTOOMANYINCREMENTALS = "Select When - Warned Too Many Incrementals";
- private const string SELECTWHEN_WARNEDNOINCREMENTALS = "Select When - Warned No Incrementals";
-
- private const string PASSWORDSETTINGS_WARNEDNOPASSWORD = "Password Settings - Warned No Password";
- private const string CLEANUPSETTINGS_WARNEDNOCLEANUP = "Cleanup Settings - Warned No Cleanup";
-
- private const string DISABLE_AES_FALLBACK_DECRYPTION = "Disable AES fallback encryption";
-
- private Task m_owner;
-
- public TaskExtensionWrapper(Task owner)
- {
- m_owner = owner;
- }
-
- public string MaxUploadSize
- {
- get { return m_owner.TaskExtensionsLookup[MAX_UPLOAD_SIZE]; }
- set { m_owner.TaskExtensionsLookup[MAX_UPLOAD_SIZE] = value; }
- }
-
- public string UploadBandwidth
- {
- get { return m_owner.TaskExtensionsLookup[UPLOAD_BANDWIDTH]; }
- set { m_owner.TaskExtensionsLookup[UPLOAD_BANDWIDTH] = value; }
- }
-
- public string DownloadBandwidth
- {
- get { return m_owner.TaskExtensionsLookup[DOWNLOAD_BANDWIDTH]; }
- set { m_owner.TaskExtensionsLookup[DOWNLOAD_BANDWIDTH] = value; }
- }
-
- public string VolumeSize
- {
- get { return m_owner.TaskExtensionsLookup[VOLUME_SIZE]; }
- set { m_owner.TaskExtensionsLookup[VOLUME_SIZE] = value; }
- }
-
- public string ThreadPriority
- {
- get { return m_owner.TaskExtensionsLookup[THREAD_PRIORITY]; }
- set { m_owner.TaskExtensionsLookup[THREAD_PRIORITY] = value; }
- }
-
- public bool AsyncTransfer
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[ASYNC_TRANSFER], true); }
- set { m_owner.TaskExtensionsLookup[ASYNC_TRANSFER] = value.ToString(); }
- }
-
- public bool IgnoreTimestamps
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[IGNORE_TIMESTAMPS], false); }
- set { m_owner.TaskExtensionsLookup[IGNORE_TIMESTAMPS] = value.ToString(); }
- }
-
- public string FileSizeLimit
- {
- get { return m_owner.TaskExtensionsLookup[FILE_SIZE_LIMIT]; }
- set { m_owner.TaskExtensionsLookup[FILE_SIZE_LIMIT] = value; }
- }
-
- public int SelectFiles_Version
- {
- get { return string.IsNullOrEmpty(m_owner.TaskExtensionsLookup[SELECTFILES_VERSION]) ? 1 : int.Parse(m_owner.TaskExtensionsLookup[SELECTFILES_VERSION]); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_VERSION] = value.ToString(); }
- }
-
- public bool SelectFiles_UseSimpleMode
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTFILES_USESIMPLEMODE], false); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_USESIMPLEMODE] = value.ToString(); }
- }
-
- public bool SelectFiles_IncludeDocuments
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEDOCUMENTS], false); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEDOCUMENTS] = value.ToString(); }
- }
-
- public bool SelectFiles_IncludeDesktop
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEDESKTOP], false); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEDESKTOP] = value.ToString(); }
- }
-
- public bool SelectFiles_IncludeMusic
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEMUSIC], false); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEMUSIC] = value.ToString(); }
- }
-
- public bool SelectFiles_IncludeImages
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEIMAGES], false); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEIMAGES] = value.ToString(); }
- }
-
- public bool SelectFiles_IncludeAppData
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEAPPDATA], false); }
- set { m_owner.TaskExtensionsLookup[SELECTFILES_INCLUDEAPPDATA] = value.ToString(); }
- }
-
- public bool SelectWhen_WarnedNoSchedule
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTWHEN_WARNEDNOSCHEDULE], false); }
- set { m_owner.TaskExtensionsLookup[SELECTWHEN_WARNEDNOSCHEDULE] = value.ToString(); }
- }
-
- public bool SelectWhen_WarnedNoIncrementals
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTWHEN_WARNEDNOINCREMENTALS], false); }
- set { m_owner.TaskExtensionsLookup[SELECTWHEN_WARNEDNOINCREMENTALS] = value.ToString(); }
- }
-
- public bool SelectWhen_WarnedTooManyIncrementals
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[SELECTWHEN_WARNEDTOOMANYINCREMENTALS], false); }
- set { m_owner.TaskExtensionsLookup[SELECTWHEN_WARNEDTOOMANYINCREMENTALS] = value.ToString(); }
- }
-
- public bool PasswordSettings_WarnedNoPassword
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[PASSWORDSETTINGS_WARNEDNOPASSWORD], false); }
- set { m_owner.TaskExtensionsLookup[PASSWORDSETTINGS_WARNEDNOPASSWORD] = value.ToString(); }
- }
-
- public bool CleanupSettings_WarnedNoCleanup
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[CLEANUPSETTINGS_WARNEDNOCLEANUP], false); }
- set { m_owner.TaskExtensionsLookup[CLEANUPSETTINGS_WARNEDNOCLEANUP] = value.ToString(); }
- }
-
- public bool DisableAESFallbackDecryption
- {
- get { return Duplicati.Library.Utility.Utility.ParseBool(m_owner.TaskExtensionsLookup[DISABLE_AES_FALLBACK_DECRYPTION], false); }
- set { m_owner.TaskExtensionsLookup[DISABLE_AES_FALLBACK_DECRYPTION] = value.ToString(); }
- }
- }
- }
-}
diff --git a/Duplicati/GUI/Datamodel/Task.cs b/Duplicati/GUI/Datamodel/Task.cs
deleted file mode 100644
index dbdf2829b..000000000
--- a/Duplicati/GUI/Datamodel/Task.cs
+++ /dev/null
@@ -1,211 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-//
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// Task
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("Task")]
- public partial class Task : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, Relation("LogTask", typeof(Log), "TaskID", false), Relation("TaskFilterTask", typeof(TaskFilter), "TaskID", false), Relation("BackendSettingTask", typeof(BackendSetting), "TaskID", false), Relation("TaskExtensionTask", typeof(TaskExtension), "TaskID", false), Relation("TaskOverrideTask", typeof(TaskOverride), "TaskID", false), Relation("CompressionSettingTask", typeof(CompressionSetting), "TaskID", false), Relation("EncryptionSettingTask", typeof(EncryptionSetting), "TaskID", false), DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [DatabaseField("Service")]
- private System.String m_Service = "";
- [DatabaseField("Encryptionkey")]
- private System.String m_Encryptionkey = "";
- [DatabaseField("SourcePath")]
- private System.String m_SourcePath = "";
- [Relation("TaskSchedule", typeof(Schedule), "ID"), DatabaseField("ScheduleID")]
- private System.Int64 m_ScheduleID = long.MinValue;
- [DatabaseField("KeepFull")]
- private System.Int64 m_KeepFull = long.MinValue;
- [DatabaseField("KeepTime")]
- private System.String m_KeepTime = "";
- [DatabaseField("FullAfter")]
- private System.String m_FullAfter = "";
- [DatabaseField("IncludeSetup")]
- private System.Boolean m_IncludeSetup = false;
- [DatabaseField("EncryptionModule")]
- private System.String m_EncryptionModule = "";
- [DatabaseField("CompressionModule")]
- private System.String m_CompressionModule = "";
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.String Service
- {
- get{return m_Service;}
- set{object oldvalue = m_Service;OnBeforeDataChange(this, "Service", oldvalue, value);m_Service = value;OnAfterDataChange(this, "Service", oldvalue, value);}
- }
-
- public System.String Encryptionkey
- {
- get{return m_Encryptionkey;}
- set{object oldvalue = m_Encryptionkey;OnBeforeDataChange(this, "Encryptionkey", oldvalue, value);m_Encryptionkey = value;OnAfterDataChange(this, "Encryptionkey", oldvalue, value);}
- }
-
- public System.String SourcePath
- {
- get{return m_SourcePath;}
- set{object oldvalue = m_SourcePath;OnBeforeDataChange(this, "SourcePath", oldvalue, value);m_SourcePath = value;OnAfterDataChange(this, "SourcePath", oldvalue, value);}
- }
-
- public System.Int64 ScheduleID
- {
- get{return m_ScheduleID;}
- set{object oldvalue = m_ScheduleID;OnBeforeDataChange(this, "ScheduleID", oldvalue, value);m_ScheduleID = value;OnAfterDataChange(this, "ScheduleID", oldvalue, value);}
- }
-
- public System.Int64 KeepFull
- {
- get{return m_KeepFull;}
- set{object oldvalue = m_KeepFull;OnBeforeDataChange(this, "KeepFull", oldvalue, value);m_KeepFull = value;OnAfterDataChange(this, "KeepFull", oldvalue, value);}
- }
-
- public System.String KeepTime
- {
- get{return m_KeepTime;}
- set{object oldvalue = m_KeepTime;OnBeforeDataChange(this, "KeepTime", oldvalue, value);m_KeepTime = value;OnAfterDataChange(this, "KeepTime", oldvalue, value);}
- }
-
- public System.String FullAfter
- {
- get{return m_FullAfter;}
- set{object oldvalue = m_FullAfter;OnBeforeDataChange(this, "FullAfter", oldvalue, value);m_FullAfter = value;OnAfterDataChange(this, "FullAfter", oldvalue, value);}
- }
-
- public System.Boolean IncludeSetup
- {
- get{return m_IncludeSetup;}
- set{object oldvalue = m_IncludeSetup;OnBeforeDataChange(this, "IncludeSetup", oldvalue, value);m_IncludeSetup = value;OnAfterDataChange(this, "IncludeSetup", oldvalue, value);}
- }
-
- public System.String EncryptionModule
- {
- get{return m_EncryptionModule;}
- set{object oldvalue = m_EncryptionModule;OnBeforeDataChange(this, "EncryptionModule", oldvalue, value);m_EncryptionModule = value;OnAfterDataChange(this, "EncryptionModule", oldvalue, value);}
- }
-
- public System.String CompressionModule
- {
- get{return m_CompressionModule;}
- set{object oldvalue = m_CompressionModule;OnBeforeDataChange(this, "CompressionModule", oldvalue, value);m_CompressionModule = value;OnAfterDataChange(this, "CompressionModule", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Schedule))]
- public Schedule Schedule
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("TaskSchedule", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskSchedule", this, value); }
- }
-
- [Affects(typeof(Log))]
- public System.Collections.Generic.IList Logs
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("LogTask", this);
- }
- }
-
- [Affects(typeof(TaskFilter))]
- public System.Collections.Generic.IList Filters
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("TaskFilterTask", this);
- }
- }
-
- [Affects(typeof(BackendSetting))]
- public System.Collections.Generic.IList BackendSettings
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("BackendSettingTask", this);
- }
- }
-
- [Affects(typeof(TaskExtension))]
- public System.Collections.Generic.IList TaskExtensions
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("TaskExtensionTask", this);
- }
- }
-
- [Affects(typeof(TaskOverride))]
- public System.Collections.Generic.IList TaskOverrides
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("TaskOverrideTask", this);
- }
- }
-
- [Affects(typeof(CompressionSetting))]
- public System.Collections.Generic.IList CompressionSettings
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("CompressionSettingTask", this);
- }
- }
-
- [Affects(typeof(EncryptionSetting))]
- public System.Collections.Generic.IList EncryptionSettings
- {
- get
- {
- return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects("EncryptionSettingTask", this);
- }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/TaskExtension.cs b/Duplicati/GUI/Datamodel/TaskExtension.cs
deleted file mode 100644
index 5ce7ea544..000000000
--- a/Duplicati/GUI/Datamodel/TaskExtension.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// TaskExtension
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("TaskExtension")]
- public partial class TaskExtension : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [Relation("TaskExtensionTask", typeof(Task), "ID"), DatabaseField("TaskID")]
- private System.Int64 m_TaskID = long.MinValue;
- [DatabaseField("Name")]
- private System.String m_Name = "";
- [DatabaseField("Value")]
- private System.String m_Value = "";
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.Int64 TaskID
- {
- get{return m_TaskID;}
- set{object oldvalue = m_TaskID;OnBeforeDataChange(this, "TaskID", oldvalue, value);m_TaskID = value;OnAfterDataChange(this, "TaskID", oldvalue, value);}
- }
-
- public System.String Name
- {
- get{return m_Name;}
- set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
- }
-
- public System.String Value
- {
- get{return m_Value;}
- set{object oldvalue = m_Value;OnBeforeDataChange(this, "Value", oldvalue, value);m_Value = value;OnAfterDataChange(this, "Value", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Task))]
- public Task Task
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("TaskExtensionTask", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskExtensionTask", this, value); }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/TaskFilter.cs b/Duplicati/GUI/Datamodel/TaskFilter.cs
deleted file mode 100644
index a20ff1b67..000000000
--- a/Duplicati/GUI/Datamodel/TaskFilter.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// TaskFilter
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("TaskFilter")]
- public partial class TaskFilter : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [DatabaseField("SortOrder")]
- private System.Int64 m_SortOrder = long.MinValue;
- [DatabaseField("Include")]
- private System.Boolean m_Include = false;
- [DatabaseField("Filter")]
- private System.String m_Filter = "";
- [Relation("TaskFilterTask", typeof(Task), "ID"), DatabaseField("TaskID")]
- private System.Int64 m_TaskID = long.MinValue;
- [DatabaseField("GlobbingFilter")]
- private System.String m_GlobbingFilter = "";
-
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.Int64 SortOrder
- {
- get{return m_SortOrder;}
- set{object oldvalue = m_SortOrder;OnBeforeDataChange(this, "SortOrder", oldvalue, value);m_SortOrder = value;OnAfterDataChange(this, "SortOrder", oldvalue, value);}
- }
-
- public System.Boolean Include
- {
- get{return m_Include;}
- set{object oldvalue = m_Include;OnBeforeDataChange(this, "Include", oldvalue, value);m_Include = value;OnAfterDataChange(this, "Include", oldvalue, value);}
- }
-
- public System.String Filter
- {
- get{return m_Filter;}
- set{object oldvalue = m_Filter;OnBeforeDataChange(this, "Filter", oldvalue, value);m_Filter = value;OnAfterDataChange(this, "Filter", oldvalue, value);}
- }
-
- public System.Int64 TaskID
- {
- get{return m_TaskID;}
- set{object oldvalue = m_TaskID;OnBeforeDataChange(this, "TaskID", oldvalue, value);m_TaskID = value;OnAfterDataChange(this, "TaskID", oldvalue, value);}
- }
-
- public System.String GlobbingFilter
- {
- get { return m_GlobbingFilter; }
- set { object oldvalue = m_GlobbingFilter; OnBeforeDataChange(this, "GlobbingFilter", oldvalue, value); m_GlobbingFilter = value; OnAfterDataChange(this, "GlobbingFilter", oldvalue, value); }
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Task))]
- public Task Task
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("TaskFilterTask", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskFilterTask", this, value); }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/TaskOverride.cs b/Duplicati/GUI/Datamodel/TaskOverride.cs
deleted file mode 100644
index 203ecf208..000000000
--- a/Duplicati/GUI/Datamodel/TaskOverride.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-#region Disclaimer / License
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-//
-#endregion
-///
-/// This class was created by DataClassFileBuilder (LightDatamodel)
-///
-/// Table
-/// Duplicati.Datamodel
-/// TaskOverride
-///
-///
-
-using System.Data.LightDatamodel;
-using System.Data.LightDatamodel.DataClassAttributes;
-
-namespace Duplicati.Datamodel
-{
-
- [DatabaseTable("TaskOverride")]
- public partial class TaskOverride : DataClassBase
- {
-
-#region " private members "
-
- [AutoIncrement, PrimaryKey, DatabaseField("ID")]
- private System.Int64 m_ID = long.MinValue;
- [Relation("TaskOverrideTask", typeof(Task), "ID"), DatabaseField("TaskID")]
- private System.Int64 m_TaskID = long.MinValue;
- [DatabaseField("Name")]
- private System.String m_Name = "";
- [DatabaseField("Value")]
- private System.String m_Value = "";
-#endregion
-
-#region " properties "
-
- public System.Int64 ID
- {
- get{return m_ID;}
- set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
- }
-
- public System.Int64 TaskID
- {
- get{return m_TaskID;}
- set{object oldvalue = m_TaskID;OnBeforeDataChange(this, "TaskID", oldvalue, value);m_TaskID = value;OnAfterDataChange(this, "TaskID", oldvalue, value);}
- }
-
- public System.String Name
- {
- get{return m_Name;}
- set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
- }
-
- public System.String Value
- {
- get{return m_Value;}
- set{object oldvalue = m_Value;OnBeforeDataChange(this, "Value", oldvalue, value);m_Value = value;OnAfterDataChange(this, "Value", oldvalue, value);}
- }
-
-#endregion
-
-#region " referenced properties "
-
- [Affects(typeof(Task))]
- public Task Task
- {
- get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject("TaskOverrideTask", this); }
- set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskOverrideTask", this, value); }
- }
-
-#endregion
-
- }
-
-}
\ No newline at end of file
diff --git a/Duplicati/GUI/Datamodel/app.config b/Duplicati/GUI/Datamodel/app.config
deleted file mode 100644
index 89dc7d426..000000000
--- a/Duplicati/GUI/Datamodel/app.config
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs
index 37e0d1539..a8a03e454 100644
--- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs
+++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/GtkRunner.cs
@@ -33,8 +33,8 @@ namespace Duplicati.GUI.TrayIcon
private class StatusEventArgs : EventArgs
{
- public readonly Duplicati.Server.Serialization.IServerStatus Status;
- public StatusEventArgs(Duplicati.Server.Serialization.IServerStatus args) { this.Status = args; }
+ public readonly Duplicati.Server.Serialization.Interface.IServerStatus Status;
+ public StatusEventArgs(Duplicati.Server.Serialization.Interface.IServerStatus args) { this.Status = args; }
}
private class MenuItemWrapper : IMenuItem
@@ -262,7 +262,7 @@ namespace Duplicati.GUI.TrayIcon
protected override void RegisterStatusUpdateCallback ()
{
- Program.Connection.StatusUpdated += delegate(Duplicati.Server.Serialization.IServerStatus status) {
+ Program.Connection.StatusUpdated += delegate(Duplicati.Server.Serialization.Interface.IServerStatus status) {
Gtk.Application.Invoke(this, new StatusEventArgs(status), StatusUpdateEvent);
};
}
diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs
index 7bc4b7083..53065cea1 100644
--- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs
+++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/HttpServerConnection.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Duplicati.Server.Serialization;
+using Duplicati.Server.Serialization.Interface;
namespace Duplicati.GUI.TrayIcon
{
diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs
index 7e8cd4c71..de1c35759 100644
--- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs
+++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/TrayIconBase.cs
@@ -16,6 +16,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
using System;
using Duplicati.Server.Serialization;
+using Duplicati.Server.Serialization.Interface;
using System.Collections.Generic;
namespace Duplicati.GUI.TrayIcon
diff --git a/Duplicati/GUI/Duplicati.GUI.TrayIcon/WindowsImplementation/WinFormsRunner.cs b/Duplicati/GUI/Duplicati.GUI.TrayIcon/WindowsImplementation/WinFormsRunner.cs
index 0bbdc694b..8ed0a1257 100644
--- a/Duplicati/GUI/Duplicati.GUI.TrayIcon/WindowsImplementation/WinFormsRunner.cs
+++ b/Duplicati/GUI/Duplicati.GUI.TrayIcon/WindowsImplementation/WinFormsRunner.cs
@@ -1,233 +1,234 @@
-// Copyright (C) 2011, Kenneth Skovhede
-// http://www.hexad.dk, opensource@hexad.dk
-//
-// This library is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of the
-// License, or (at your option) any later version.
-//
-// This library 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
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using Duplicati.Server.Serialization;
-
-namespace Duplicati.GUI.TrayIcon.Windows
-{
- //We use a separate class to start the runner to avoid attempts to load WinForms from Program.cs
- public class WinFormsRunner : TrayIconBase
- {
- private class MenuItemWrapper : IMenuItem
- {
- private ToolStripItem m_menu;
- private Action m_callback;
-
- public ToolStripItem MenuItem { get { return m_menu; } }
-
- public MenuItemWrapper(string text, MenuIcons icon, Action callback, IList subitems)
- {
- if (text == "-")
- m_menu = new ToolStripSeparator();
- else
- {
- m_menu = new ToolStripMenuItem(text);
- if (icon != MenuIcons.None)
- m_menu.Image = GetIcon(icon);
-
- if (callback != null)
- {
- m_callback = callback;
- m_menu.Click += OnMenuClick;
- }
-
- if (subitems != null && subitems.Count > 0)
- foreach(var itm in subitems)
- ((ToolStripMenuItem)m_menu).DropDownItems.Add(((MenuItemWrapper)itm).MenuItem);
- }
- }
-
- private void OnMenuClick (object sender, EventArgs e)
- {
- m_callback();
- }
-
- private System.Drawing.Image GetIcon(MenuIcons icon)
- {
- switch(icon)
- {
- case MenuIcons.Pause:
- return Properties.Resources.Pause;
- case MenuIcons.Quit:
- return Properties.Resources.CloseMenuIcon;
- case MenuIcons.Resume:
- return Properties.Resources.Play;
- case MenuIcons.Status:
- return Properties.Resources.StatusMenuIcon;
- case MenuIcons.None:
- default:
- return null;
- }
- }
-
- #region IMenuItem implementation
- public string Text {
- set {
- m_menu.Text = value;
- }
- }
-
- public MenuIcons Icon {
- set {
- m_menu.Image = GetIcon(value);
- }
- }
-
- public bool Enabled {
- set {
- m_menu.Enabled = value;
- }
- }
-
- public bool Default {
- set {
- m_menu.Font = new System.Drawing.Font(m_menu.Font, System.Drawing.FontStyle.Bold);
- }
- }
- #endregion
- }
-
- private Form m_handleProvider;
- private NotifyIcon m_trayIcon;
-
- public static WinFormsRunner Instance = null;
-
- public override void Init (string[] args)
- {
- if (WinFormsRunner.Instance != null)
- throw new Exception("Multiple trayicon instances not allowed!");
-
- WinFormsRunner.Instance = this;
-
- //We need this ugly hack to get a handle that we can call Invoke on,
- // and sadly the TrayIcon does not expose one, and forcing the context menu
- // to create one causes weird "lost clicks"
- m_handleProvider = new Form()
- {
- FormBorderStyle = FormBorderStyle.None,
- Width = 10,
- Height = 10,
- Top = 0,
- Left = 0
- };
- m_handleProvider.Show();
- m_handleProvider.Hide();
-
- m_trayIcon = new NotifyIcon();
- m_trayIcon.DoubleClick += new EventHandler(m_trayIcon_DoubleClick);
- m_trayIcon.Click += new EventHandler(m_trayIcon_Click);
- base.Init(args);
- }
-
- private void m_trayIcon_Click(object sender, EventArgs e)
- {
- if (m_onSingleClick != null)
- m_onSingleClick();
- }
-
- private void m_trayIcon_DoubleClick(object sender, EventArgs e)
- {
- if (m_onDoubleClick != null)
- m_onDoubleClick();
- }
-
- protected override void RegisterStatusUpdateCallback ()
- {
- Program.Connection.StatusUpdated += delegate(IServerStatus status) {
- m_handleProvider.Invoke(new Action(OnStatusUpdated), status);
- };
- }
-
- #region implemented abstract members of Duplicati.GUI.TrayIcon.TrayIconBase
- protected override void Run (string[] args)
- {
- m_trayIcon.Visible = true;
- Application.Run();
- }
-
- protected override TrayIcons Icon {
- set {
- switch (value)
- {
- case TrayIcons.IdleError:
- m_trayIcon.Icon = Properties.Resources.TrayNormalError;
- break;
- case TrayIcons.Paused:
- m_trayIcon.Icon = Properties.Resources.TrayNormalPause;
- break;
- case TrayIcons.PausedError:
- m_trayIcon.Icon = Properties.Resources.TrayNormalPause;
- break;
- case TrayIcons.Running:
- m_trayIcon.Icon = Properties.Resources.TrayWorking;
- break;
- case TrayIcons.RunningError:
- m_trayIcon.Icon = Properties.Resources.TrayWorking;
- break;
- case TrayIcons.Idle:
- default:
- m_trayIcon.Icon = Properties.Resources.TrayNormal;
- break;
- }
- }
- }
-
- protected override IMenuItem CreateMenuItem (string text, MenuIcons icon, Action callback, IList subitems)
- {
- return new MenuItemWrapper(text, icon, callback, subitems);
- }
-
- protected override void Exit ()
- {
- Application.Exit();
- }
-
- protected override void SetMenu (System.Collections.Generic.IEnumerable items)
- {
- m_trayIcon.ContextMenuStrip = new ContextMenuStrip();
- foreach(var itm in items)
- m_trayIcon.ContextMenuStrip.Items.Add(((MenuItemWrapper)itm).MenuItem);
- }
-
- public override void Dispose ()
- {
- if (m_handleProvider != null)
- {
- m_handleProvider.Dispose();
- m_handleProvider = null;
- }
-
- if (m_trayIcon != null)
- {
- m_trayIcon.Visible = false;
- m_trayIcon.Dispose();
- m_trayIcon = null;
- }
- }
- #endregion
-
- /*public override IBrowserWindow ShowUrlInWindow(string url)
- {
- var v = new WindowsBrowser(url);
- v.Show();
- return v;
- }*/
- }
-}
-
+// Copyright (C) 2011, Kenneth Skovhede
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using Duplicati.Server.Serialization;
+using Duplicati.Server.Serialization.Interface;
+
+namespace Duplicati.GUI.TrayIcon.Windows
+{
+ //We use a separate class to start the runner to avoid attempts to load WinForms from Program.cs
+ public class WinFormsRunner : TrayIconBase
+ {
+ private class MenuItemWrapper : IMenuItem
+ {
+ private ToolStripItem m_menu;
+ private Action m_callback;
+
+ public ToolStripItem MenuItem { get { return m_menu; } }
+
+ public MenuItemWrapper(string text, MenuIcons icon, Action callback, IList subitems)
+ {
+ if (text == "-")
+ m_menu = new ToolStripSeparator();
+ else
+ {
+ m_menu = new ToolStripMenuItem(text);
+ if (icon != MenuIcons.None)
+ m_menu.Image = GetIcon(icon);
+
+ if (callback != null)
+ {
+ m_callback = callback;
+ m_menu.Click += OnMenuClick;
+ }
+
+ if (subitems != null && subitems.Count > 0)
+ foreach(var itm in subitems)
+ ((ToolStripMenuItem)m_menu).DropDownItems.Add(((MenuItemWrapper)itm).MenuItem);
+ }
+ }
+
+ private void OnMenuClick (object sender, EventArgs e)
+ {
+ m_callback();
+ }
+
+ private System.Drawing.Image GetIcon(MenuIcons icon)
+ {
+ switch(icon)
+ {
+ case MenuIcons.Pause:
+ return Properties.Resources.Pause;
+ case MenuIcons.Quit:
+ return Properties.Resources.CloseMenuIcon;
+ case MenuIcons.Resume:
+ return Properties.Resources.Play;
+ case MenuIcons.Status:
+ return Properties.Resources.StatusMenuIcon;
+ case MenuIcons.None:
+ default:
+ return null;
+ }
+ }
+
+ #region IMenuItem implementation
+ public string Text {
+ set {
+ m_menu.Text = value;
+ }
+ }
+
+ public MenuIcons Icon {
+ set {
+ m_menu.Image = GetIcon(value);
+ }
+ }
+
+ public bool Enabled {
+ set {
+ m_menu.Enabled = value;
+ }
+ }
+
+ public bool Default {
+ set {
+ m_menu.Font = new System.Drawing.Font(m_menu.Font, System.Drawing.FontStyle.Bold);
+ }
+ }
+ #endregion
+ }
+
+ private Form m_handleProvider;
+ private NotifyIcon m_trayIcon;
+
+ public static WinFormsRunner Instance = null;
+
+ public override void Init (string[] args)
+ {
+ if (WinFormsRunner.Instance != null)
+ throw new Exception("Multiple trayicon instances not allowed!");
+
+ WinFormsRunner.Instance = this;
+
+ //We need this ugly hack to get a handle that we can call Invoke on,
+ // and sadly the TrayIcon does not expose one, and forcing the context menu
+ // to create one causes weird "lost clicks"
+ m_handleProvider = new Form()
+ {
+ FormBorderStyle = FormBorderStyle.None,
+ Width = 10,
+ Height = 10,
+ Top = 0,
+ Left = 0
+ };
+ m_handleProvider.Show();
+ m_handleProvider.Hide();
+
+ m_trayIcon = new NotifyIcon();
+ m_trayIcon.DoubleClick += new EventHandler(m_trayIcon_DoubleClick);
+ m_trayIcon.Click += new EventHandler(m_trayIcon_Click);
+ base.Init(args);
+ }
+
+ private void m_trayIcon_Click(object sender, EventArgs e)
+ {
+ if (m_onSingleClick != null)
+ m_onSingleClick();
+ }
+
+ private void m_trayIcon_DoubleClick(object sender, EventArgs e)
+ {
+ if (m_onDoubleClick != null)
+ m_onDoubleClick();
+ }
+
+ protected override void RegisterStatusUpdateCallback ()
+ {
+ Program.Connection.StatusUpdated += delegate(IServerStatus status) {
+ m_handleProvider.Invoke(new Action(OnStatusUpdated), status);
+ };
+ }
+
+ #region implemented abstract members of Duplicati.GUI.TrayIcon.TrayIconBase
+ protected override void Run (string[] args)
+ {
+ m_trayIcon.Visible = true;
+ Application.Run();
+ }
+
+ protected override TrayIcons Icon {
+ set {
+ switch (value)
+ {
+ case TrayIcons.IdleError:
+ m_trayIcon.Icon = Properties.Resources.TrayNormalError;
+ break;
+ case TrayIcons.Paused:
+ m_trayIcon.Icon = Properties.Resources.TrayNormalPause;
+ break;
+ case TrayIcons.PausedError:
+ m_trayIcon.Icon = Properties.Resources.TrayNormalPause;
+ break;
+ case TrayIcons.Running:
+ m_trayIcon.Icon = Properties.Resources.TrayWorking;
+ break;
+ case TrayIcons.RunningError:
+ m_trayIcon.Icon = Properties.Resources.TrayWorking;
+ break;
+ case TrayIcons.Idle:
+ default:
+ m_trayIcon.Icon = Properties.Resources.TrayNormal;
+ break;
+ }
+ }
+ }
+
+ protected override IMenuItem CreateMenuItem (string text, MenuIcons icon, Action callback, IList subitems)
+ {
+ return new MenuItemWrapper(text, icon, callback, subitems);
+ }
+
+ protected override void Exit ()
+ {
+ Application.Exit();
+ }
+
+ protected override void SetMenu (System.Collections.Generic.IEnumerable items)
+ {
+ m_trayIcon.ContextMenuStrip = new ContextMenuStrip();
+ foreach(var itm in items)
+ m_trayIcon.ContextMenuStrip.Items.Add(((MenuItemWrapper)itm).MenuItem);
+ }
+
+ public override void Dispose ()
+ {
+ if (m_handleProvider != null)
+ {
+ m_handleProvider.Dispose();
+ m_handleProvider = null;
+ }
+
+ if (m_trayIcon != null)
+ {
+ m_trayIcon.Visible = false;
+ m_trayIcon.Dispose();
+ m_trayIcon = null;
+ }
+ }
+ #endregion
+
+ /*public override IBrowserWindow ShowUrlInWindow(string url)
+ {
+ var v = new WindowsBrowser(url);
+ v.Show();
+ return v;
+ }*/
+ }
+}
+
diff --git a/Duplicati/Library/Utility/WorkerThread.cs b/Duplicati/Library/Utility/WorkerThread.cs
index 2134d04a4..87856e1b7 100644
--- a/Duplicati/Library/Utility/WorkerThread.cs
+++ b/Duplicati/Library/Utility/WorkerThread.cs
@@ -63,19 +63,12 @@ namespace Duplicati.Library.Utility
///
/// A callback that performs the actual work on the item
///
- private ProcessItemDelegate m_delegate;
-
- ///
- /// A delegate used to signal a changed state
- ///
- /// The sender of the event
- /// The new state
- public delegate void WorkerStateChangedDelegate(WorkerThread sender, RunState state);
+ private Action m_delegate;
///
/// An event that is raised when the runner state changes
///
- public event WorkerStateChangedDelegate WorkerStateChanged;
+ public event Action, RunState> WorkerStateChanged;
///
/// Event that occurs when a new operation is being processed
@@ -90,8 +83,6 @@ namespace Duplicati.Library.Utility
///
public event EventHandler WorkQueueChanged;
- public delegate void ProcessItemDelegate(Tx item);
-
///
/// The internal state
///
@@ -116,7 +107,7 @@ namespace Duplicati.Library.Utility
/// Constructs a new WorkerThread
///
/// The callback that performs the work
- public WorkerThread(ProcessItemDelegate item, bool paused)
+ public WorkerThread(Action item, bool paused)
{
m_delegate = item;
m_event = new AutoResetEvent(paused);
diff --git a/Duplicati/License/Duplicati.License.csproj b/Duplicati/License/Duplicati.License.csproj
index 5ad3dabfc..ef7b016e7 100644
--- a/Duplicati/License/Duplicati.License.csproj
+++ b/Duplicati/License/Duplicati.License.csproj
@@ -60,14 +60,6 @@
licenses\gpg\License.txt
PreserveNewest
-
- licenses\LightDataModel\Homepage.txt
- PreserveNewest
-
-
- licenses\LightDataModel\license.txt
- PreserveNewest
-
licenses\LitJSON\download.txt
PreserveNewest
diff --git a/Duplicati/Server/Database/ApplicationSettings.cs b/Duplicati/Server/Database/ApplicationSettings.cs
new file mode 100644
index 000000000..466f43578
--- /dev/null
+++ b/Duplicati/Server/Database/ApplicationSettings.cs
@@ -0,0 +1,56 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Database
+{
+ public class ApplicationSettings
+ {
+ internal ApplicationSettings(Connection con)
+ {
+ var settings = con.GetSettings(Connection.APP_SETTINGS_ID);
+ // TODO: Map options to settings
+
+ }
+
+ public string StartupDelayDuration
+ {
+ get ;
+ set ;
+ }
+
+ public System.Threading.ThreadPriority? ThreadPriorityOverride
+ {
+ get;
+ set;
+ }
+
+ public string DownloadSpeedLimit
+ {
+ get;
+ set;
+ }
+
+ public string UploadSpeedLimit
+ {
+ get;
+ set;
+ }
+ }
+}
+
diff --git a/Duplicati/Server/Database/Backup.cs b/Duplicati/Server/Database/Backup.cs
new file mode 100644
index 000000000..4f932fcb1
--- /dev/null
+++ b/Duplicati/Server/Database/Backup.cs
@@ -0,0 +1,92 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using Duplicati.Server.Serialization.Interface;
+using System.Collections.Generic;
+
+namespace Duplicati.Server.Database
+{
+ public class Backup : IBackup
+ {
+
+ public Backup()
+ {
+ this.ID = -2;
+ }
+
+ internal void LoadChildren(Connection con)
+ {
+ if (this.ID < 0)
+ {
+ this.Sources = new string[0];
+ this.Settings = new ISetting[0];
+ this.Filters = new IFilter[0];
+ this.Metadata = new Dictionary();
+ }
+ else
+ {
+ this.Sources = con.GetSources(this.ID);
+ this.Settings = con.GetSettings(this.ID);
+ this.Filters = con.GetFilters(this.ID);
+ this.Metadata = con.GetMetadata(this.ID);
+ }
+ }
+
+ ///
+ /// The backup ID
+ ///
+ public long ID { get; set; }
+ ///
+ /// The backup name
+ ///
+ public string Name { get; set; }
+ ///
+ /// The backup tags
+ ///
+ public string[] Tags { get; set; }
+ ///
+ /// The backup target url, excluding username/password
+ ///
+ public string TargetURL { get; set; }
+ ///
+ /// The path to the local database
+ ///
+ public string DBPath { get; internal set; }
+
+ ///
+ /// The backup source folders and files
+ ///
+ public string[] Sources { get; set; }
+
+ ///
+ /// The backup settings
+ ///
+ public ISetting[] Settings { get; set; }
+
+ ///
+ /// The filters applied to the source files
+ ///
+ public IFilter[] Filters { get; set; }
+
+ ///
+ /// The backup metadata
+ ///
+ public IDictionary Metadata { get; set; }
+ }
+}
+
diff --git a/Duplicati/Server/Database/Connection.cs b/Duplicati/Server/Database/Connection.cs
new file mode 100644
index 000000000..b82d0901b
--- /dev/null
+++ b/Duplicati/Server/Database/Connection.cs
@@ -0,0 +1,431 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Duplicati.Server.Serialization.Interface;
+using System.Text;
+
+namespace Duplicati.Server.Database
+{
+ public class Connection : IDisposable
+ {
+ private System.Data.IDbConnection m_connection;
+ public readonly object m_lock = new object();
+ public const int ANY_BACKUP_ID = -1;
+ public const int APP_SETTINGS_ID = -2;
+
+ public event EventHandler DataChanged;
+
+ public Connection(System.Data.IDbConnection connection)
+ {
+ m_connection = connection;
+ this.ApplicationSettings = new ApplicationSettings(this);
+ }
+
+ public ApplicationSettings ApplicationSettings { get; private set; }
+
+ internal IDictionary GetMetadata(long id)
+ {
+ lock(m_lock)
+ return ReadFromDb(
+ (rd) => new KeyValuePair(
+ ConvertToString(rd.GetValue(0)),
+ ConvertToString(rd.GetValue(1))
+ ),
+ @"SELECT ""Name"", ""Value"" FROM ""Metadata"" WHERE ""BackupID"" = ? ", id)
+ .ToDictionary((k) => k.Key, (k) => k.Value);
+ }
+
+ internal void SetMetadata(IDictionary values, long id, System.Data.IDbTransaction transaction)
+ {
+ lock(m_lock)
+ using(var tr = transaction == null ? m_connection.BeginTransaction() : null)
+ {
+ OverwriteAndUpdateDb(
+ tr,
+ @"DELETE FROM ""Metadata"" WHERE ""BackupID"" = ?", new object[] { id },
+ values,
+ @"INSERT INTO ""Metadata"" (""BackupID"", ""Name"", ""Value"") VALUES (?, ?, ?)",
+ (f) => new object[] { id, f.Key, f.Value }
+ );
+
+ if (tr != null)
+ tr.Commit();
+ }
+ }
+
+ internal IFilter[] GetFilters(long id)
+ {
+ lock(m_lock)
+ return ReadFromDb(
+ (rd) => (IFilter)new Filter() {
+ Order = ConvertToInt64(rd.GetValue(0)),
+ Include = ConvertToBoolean(rd.GetValue(1)),
+ Expression = ConvertToString(rd.GetValue(2)) ?? ""
+ },
+ @"SELECT ""Order"", ""Include"", ""Expression"" FROM ""Filter"" WHERE ""BackupID"" = ? ORDER BY ""Order"" ", id)
+ .ToArray();
+ }
+
+ internal void SetFilters(IEnumerable values, long id, System.Data.IDbTransaction transaction = null)
+ {
+ lock(m_lock)
+ using(var tr = transaction == null ? m_connection.BeginTransaction() : null)
+ {
+ OverwriteAndUpdateDb(
+ tr,
+ @"DELETE FROM ""Filter"" WHERE ""BackupID"" = ?", new object[] { id },
+ values,
+ @"INSERT INTO ""Filter"" (""BackupID"", ""Order"", ""Include"", ""Expression"") VALUES (?, ?, ?, ?)",
+ (f) => new object[] { id, f.Order, f.Include, f.Expression }
+ );
+
+ if (tr != null)
+ tr.Commit();
+ }
+ }
+
+ internal ISetting[] GetSettings(long id)
+ {
+ lock(m_lock)
+ return ReadFromDb(
+ (rd) => (ISetting)new Setting() {
+ Filter = ConvertToString(rd.GetValue(0)) ?? "",
+ Name = ConvertToString(rd.GetValue(1)) ?? "",
+ Value = ConvertToString(rd.GetValue(2)) ?? ""
+ //TODO: Attach the argument information
+ },
+ @"SELECT ""Filter"", ""Name"", ""Value"" FROM ""Option"" WHERE ""BackupID"" = ?", id)
+ .ToArray();
+ }
+
+ internal void SetSettings(IEnumerable values, long id, System.Data.IDbTransaction transaction = null)
+ {
+ lock(m_lock)
+ using(var tr = transaction == null ? m_connection.BeginTransaction() : null)
+ {
+ OverwriteAndUpdateDb(
+ tr,
+ @"DELETE FROM ""Option"" WHERE ""BackupID"" = ?", new object[] { id },
+ values,
+ @"INSERT INTO ""Option"" (""BackupID"", ""Filter"", ""Name"", ""Value"") VALUES (?, ?, ?, ?)",
+ (f) => new object[] { id, f.Filter, f.Name, f.Value }
+ );
+
+ if (tr != null)
+ tr.Commit();
+ }
+ }
+
+ internal string[] GetSources(long id)
+ {
+ lock(m_lock)
+ return ReadFromDb(
+ (rd) => ConvertToString(rd.GetValue(0)),
+ @"SELECT ""Path"" FROM ""Source"" WHERE ""BackupID"" = ?", id)
+ .ToArray();
+ }
+
+ internal void SetSources(IEnumerable values, long id, System.Data.IDbTransaction transaction)
+ {
+ lock(m_lock)
+ using(var tr = transaction == null ? m_connection.BeginTransaction() : null)
+ {
+ OverwriteAndUpdateDb(
+ tr,
+ @"DELETE FROM ""Source"" WHERE ""BackupID"" = ?", new object[] { id },
+ values,
+ @"INSERT INTO ""Source"" (""BackupID"", ""Path"") VALUES (?, ?)",
+ (f) => new object[] { id, f }
+ );
+
+ if (tr != null)
+ tr.Commit();
+ }
+ }
+
+ internal long[] GetBackupIDsForTags(string[] tags)
+ {
+ if (tags == null || tags.Length == 0)
+ return new long[0];
+
+ if (tags.Length == 1 && tags[0].StartsWith("ID="))
+ return new long[] { long.Parse(tags[0].Substring("ID=".Length)) };
+
+ lock(m_lock)
+ using(var cmd = m_connection.CreateCommand())
+ {
+ var sb = new StringBuilder();
+
+ foreach(var t in tags)
+ {
+ if (sb.Length != 0)
+ sb.Append(" OR ");
+ sb.Append(@" ("","" || ""Tag"" || "","" LIKE ""%,"" || ? || "",%"") ");
+
+ cmd.Parameters.Add(t);
+ }
+
+ cmd.CommandText = @"SELECT ""ID"" FROM ""Backup"" WHERE " + sb.ToString();
+
+ return Read(cmd, (rd) => ConvertToInt64(rd.GetValue(0))).ToArray();
+ }
+ }
+
+ internal IBackup GetBackup(long id)
+ {
+ lock(m_lock)
+ {
+ var bk = ReadFromDb(
+ (rd) => new Backup() {
+ ID = ConvertToInt64(rd.GetValue(0)),
+ Name = ConvertToString(rd.GetValue(1)),
+ Tags = (ConvertToString(rd.GetValue(2)) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
+ TargetURL = ConvertToString(rd.GetValue(3)),
+ DBPath = ConvertToString(rd.GetValue(4)),
+ },
+ @"SELECT ""ID"", ""Name"", ""Tag"", ""TargetURL"", ""DBPath"" FROM ""Backup"" WHERE ID = ?", id)
+ .FirstOrDefault();
+
+ if (bk != null)
+ bk.LoadChildren(this);
+
+ return bk;
+ }
+ }
+
+ internal void AddOrUpdateBackup(IBackup item)
+ {
+ lock(m_lock)
+ using(var tr = m_connection.BeginTransaction())
+ {
+ bool update = item.ID >= 0;
+ OverwriteAndUpdateDb(
+ tr,
+ update ? @"DELETE FROM ""Backup"" WHERE ""ID"" = ?" : null,
+ new object[] { item.ID },
+ new IBackup[] { item },
+ update ?
+ @"UPDATE ""Backup"" SET ""Name""=?, ""Tag""=?, ""TargetURL""=? WHERE ""ID""=?" :
+ @"INSERT INTO ""Backup"" (""Name"", ""Tag"", ""TargetURL"", ""DBPath"") VALUES (?,?,?,?)",
+ (n) => new object[] {
+ n.Name,
+ string.Join(",", n.Tags),
+ n.TargetURL,
+ update ? (object)item.ID : (object)n.DBPath
+ });
+
+ if (!update)
+ using(var cmd = m_connection.CreateCommand())
+ {
+ cmd.Transaction = tr;
+ cmd.CommandText = @"SELECT last_insert_rowid;";
+ item.ID = ConvertToInt64(cmd.ExecuteScalar());
+ }
+
+ SetSources(item.Sources, item.ID, tr);
+ SetSettings(item.Settings, item.ID, tr);
+ SetFilters(item.Filters, item.ID, tr);
+ SetMetadata(item.Metadata, item.ID, tr);
+
+ tr.Commit();
+ }
+ }
+
+ public IBackup[] Backups
+ {
+ get
+ {
+ lock(m_lock)
+ {
+ var lst = ReadFromDb(
+ (rd) => (IBackup)new Backup() {
+ ID = ConvertToInt64(rd.GetValue(0)),
+ Name = ConvertToString(rd.GetValue(1)),
+ Tags = (ConvertToString(rd.GetValue(2)) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
+ TargetURL = ConvertToString(rd.GetValue(3)),
+ DBPath = ConvertToString(rd.GetValue(4)),
+ },
+ @"SELECT ""ID"", ""Name"", ""Tag"", ""TargetURL"", ""DBPath"" FROM ""Backup"" ")
+ .ToArray();
+
+ foreach(var n in lst)
+ n.Metadata = GetMetadata(n.ID);
+
+ return lst;
+ }
+ }
+ }
+
+ public ISchedule[] Schedules
+ {
+ get
+ {
+ lock(m_lock)
+ return ReadFromDb(
+ (rd) => (ISchedule)new Schedule() {
+ ID = ConvertToInt64(rd.GetValue(0)),
+ Tags = (ConvertToString(rd.GetValue(1)) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
+ Time = ConvertToDateTime(rd.GetValue(2)),
+ Repeat = ConvertToString(rd.GetValue(3)),
+ LastRun = ConvertToDateTime(rd.GetValue(4)),
+ Rule = ConvertToString(rd.GetValue(5)),
+ },
+ @"SELECT ""ID"", ""Tag"", ""Time"", ""Repeat"", ""LastRun"", ""Rule"" FROM ""Schedule"" ")
+ .ToArray();
+ }
+ }
+
+
+ public IFilter[] Filters
+ {
+ get { return GetFilters(ANY_BACKUP_ID); }
+ set { SetFilters(value, ANY_BACKUP_ID); }
+ }
+
+ public ISetting[] Settings
+ {
+ get { return GetSettings(ANY_BACKUP_ID); }
+ set { SetSettings(value, ANY_BACKUP_ID); }
+ }
+
+ ///
+ /// Normalizes a DateTime instance floor'ed to seconds and in UTC
+ ///
+ /// The normalised date time
+ /// The input time
+ public static DateTime NormalizeDateTime(DateTime input)
+ {
+ var ticks = input.ToUniversalTime().Ticks;
+ ticks -= ticks % TimeSpan.TicksPerSecond;
+ return new DateTime(ticks, DateTimeKind.Utc);
+ }
+
+ private static long NormalizeDateTimeToEpochSeconds(DateTime input)
+ {
+ return (long)Math.Floor((NormalizeDateTime(input) - Library.Utility.Utility.EPOCH).TotalSeconds);
+ }
+
+ private static DateTime ConvertToDateTime(object r)
+ {
+ var unixTime = ConvertToInt64(r);
+ if (unixTime == 0)
+ return new DateTime(0);
+
+ return Library.Utility.Utility.EPOCH.AddSeconds(unixTime);
+ }
+
+ private static bool ConvertToBoolean(object r)
+ {
+ return ConvertToInt64(r) == 1;
+ }
+
+ private static string ConvertToString(object r)
+ {
+ if (r == null || r == DBNull.Value)
+ return null;
+ else
+ return r.ToString();
+ }
+
+ private static long ConvertToInt64(object r, long @default = 0)
+ {
+ if (r == null || r == DBNull.Value)
+ return @default;
+ else
+ return Convert.ToInt64(r);
+ }
+
+ private static IEnumerable Read(System.Data.IDbCommand cmd, Func f)
+ {
+ using(var rd = cmd.ExecuteReader())
+ while(rd.Read())
+ yield return f(rd);
+ }
+
+ private static IEnumerable Read(System.Data.IDataReader rd, Func f)
+ {
+ while(rd.Read())
+ yield return f();
+ }
+
+ private IEnumerable ReadFromDb(Func f, string sql, params object[] args)
+ {
+ using(var cmd = m_connection.CreateCommand())
+ {
+ cmd.CommandText = sql;
+ if (args != null)
+ foreach(var a in args)
+ cmd.Parameters.Add(a);
+
+ return Read(cmd, f);
+ }
+ }
+
+ private void OverwriteAndUpdateDb(System.Data.IDbTransaction transaction, string deleteSql, object[] deleteArgs, IEnumerable values, string insertSql, Func f)
+ {
+ using(var cmd = m_connection.CreateCommand())
+ {
+ cmd.Transaction = transaction;
+
+ if (!string.IsNullOrEmpty(deleteSql))
+ {
+ cmd.CommandText = deleteSql;
+ if (deleteArgs != null)
+ foreach(var a in deleteArgs)
+ cmd.Parameters.Add(a);
+
+ cmd.ExecuteNonQuery();
+ cmd.Parameters.Clear();
+ }
+
+ foreach(var n in values)
+ {
+ var r = f(n);
+ if (r == null)
+ continue;
+
+ while (cmd.Parameters.Count < r.Length)
+ cmd.Parameters.Add(cmd.CreateParameter());
+
+ for(var i = 0; i < r.Length; i++)
+ cmd.Parameters[i] = r[i];
+
+ cmd.ExecuteNonQuery();
+ }
+ }
+ }
+
+ #region IDisposable implementation
+ public void Dispose()
+ {
+ try
+ {
+ if (m_connection != null)
+ m_connection.Dispose();
+ }
+ catch
+ {
+ }
+ }
+ #endregion
+ }
+
+}
+
diff --git a/Duplicati/Server/Database/Database Schema/Schema.sql b/Duplicati/Server/Database/Database Schema/Schema.sql
new file mode 100644
index 000000000..9d134a937
--- /dev/null
+++ b/Duplicati/Server/Database/Database Schema/Schema.sql
@@ -0,0 +1,102 @@
+/*
+ * The primary table that stores all backups.
+ *
+ * The name and tag are free form user strings.
+ * The tags are comma seperated
+ * the TargetURL is the url to remote storage,
+ * and the DBPath is the path to the local database
+ */
+CREATE TABLE "Backup" (
+ "ID" INTEGER PRIMARY KEY,
+ "Name" TEXT NOT NULL,
+ "Tag" TEXT NOT NULL,
+ "TargetURL" TEXT NOT NULL,
+ "DBPath" TEXT NOT NULL
+);
+
+/*
+ * The table that stores all schedules
+ *
+ * Tags is a comma separated parsed field that indicates
+ * which backups * to run when activated.
+ * special tags are ID:1 which means backup with ID = 1
+ *
+ * Time is the scheduled time, and lastRun is the last time the backup was executed
+ *
+ * Rule is a special parsed field
+ */
+CREATE TABLE "Schedule" (
+ "ID" INTEGER PRIMARY KEY,
+ "Tags" TEXT NOT NULL,
+ "Time" INTEGER NOT NULL,
+ "Repeat" INTEGER NOT NULL,
+ "LastRun" INTEGER NOT NULL,
+ "Rule" TEXT NOT NULL
+);
+
+/*
+ * The source table is a list of source folders and files
+ */
+CREATE TABLE "Source" (
+ "BackupID" INTEGER NOT NULL,
+ "Path" TEXT NOT NULL
+);
+
+/*
+ * The filter table contains all filters associated with a backup.
+ * The special backupID -1 means "applied to all backups"
+ * The expression is the filter, if the filter is a regular
+ * expression, it is surrounded by hard brackets [ ]
+ */
+CREATE TABLE "Filter" (
+ "BackupID" INTEGER NOT NULL,
+ "Order" INTEGER NOT NULL,
+ "Include" INTEGER NOT NULL,
+ "Expression" TEXT NOT NULL
+);
+
+/*
+ * All options are stored in this table
+ *
+ * The special backupID -1 means "applied to all backups".
+ *
+ * The filter is used to indicate what the option applies to,
+ * for instance backend:s3 will only apply to backends of type S3
+ *
+ * The name and value are the option name and value
+ */
+CREATE TABLE "Option" (
+ "BackupID" INTEGER NOT NULL,
+ "Filter" TEXT NOT NULL,
+ "Name" TEXT NOT NULL,
+ "Value" TEXT NOT NULL
+);
+
+/*
+ * Recorded metadata about a backup
+ * This table contains metadata, such as when the backup was last started,
+ * how long it took, how many files there were, how big the backup set was,
+ * how much data was uploaded, downloaded, how fast, how much space is left,
+ * and similar data. Programs can use this information to improve the display,
+ * but cannot count on these values being present
+ */
+CREATE TABLE "Metadata" (
+ "BackupID" INTEGER NOT NULL,
+ "Name" TEXT NOT NULL,
+ "Value" TEXT NOT NULL
+);
+
+/*
+ * The log of operations initiated by the scheduler/user
+ */
+CREATE TABLE "Log" (
+ "BackupID" INTEGER NOT NULL,
+ "Description" TEXT NOT NULL,
+ "Start" INTEGER NOT NULL,
+ "Finish" INTEGER NOT NULL,
+ "Result" TEXT NOT NULL
+ "SuggestedIcon" TEXT NOT NULL
+);
+
+
+
diff --git a/Duplicati/Server/Database/Filter.cs b/Duplicati/Server/Database/Filter.cs
new file mode 100644
index 000000000..4127fccaa
--- /dev/null
+++ b/Duplicati/Server/Database/Filter.cs
@@ -0,0 +1,31 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Database
+{
+ public class Filter : Duplicati.Server.Serialization.Interface.IFilter
+ {
+ public long Order { get; set; }
+
+ public bool Include { get; set; }
+
+ public string Expression { get; set; }
+ }
+}
+
diff --git a/Duplicati/Server/Database/Schedule.cs b/Duplicati/Server/Database/Schedule.cs
new file mode 100644
index 000000000..82a8b30e7
--- /dev/null
+++ b/Duplicati/Server/Database/Schedule.cs
@@ -0,0 +1,79 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using System.Linq;
+
+namespace Duplicati.Server.Database
+{
+ public class Schedule
+ {
+ public long ID { get; set; }
+ public string[] Tags { get; set; }
+ public DateTime Time { get; set; }
+ public string Repeat { get; set; }
+ public DateTime LastRun { get; set; }
+ public string Rule { get; set; }
+
+ public DayOfWeek[] AllowedDays
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(this.Rule))
+ return null;
+
+ var days = (from n in this.Rule.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries)
+ where n.StartsWith("AllowedWeekDays=", StringComparison.InvariantCultureIgnoreCase)
+ select n.Substring("AllowedWeekDays=".Length).Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries))
+ .FirstOrDefault();
+
+
+ if (days == null)
+ return null;
+
+ DayOfWeek dw = DayOfWeek.Monday;
+ return (from n in days
+ where Enum.TryParse(n, true, out dw)
+ select (DayOfWeek)Enum.Parse(typeof(DayOfWeek), n, true))
+ .ToArray();
+ }
+ set
+ {
+
+ var parts =
+ string.IsNullOrEmpty(this.Rule) ?
+ new string[0] :
+ (from n in this.Rule.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries)
+ where !n.StartsWith("AllowedWeekDays=", StringComparison.InvariantCultureIgnoreCase)
+ select n);
+
+ if (value != null && value.Length != 0)
+ parts.Union(new string[] {
+ "AllowedWeekDays=" +
+ string.Join(
+ ",",
+ (from n in value
+ select Enum.GetName(typeof(DayOfWeek), n))
+ .Distinct())
+ });
+
+ this.Rule = string.Join(";", parts);
+ }
+ }
+ }
+}
+
diff --git a/Duplicati/Server/Database/Setting.cs b/Duplicati/Server/Database/Setting.cs
new file mode 100644
index 000000000..9103ce091
--- /dev/null
+++ b/Duplicati/Server/Database/Setting.cs
@@ -0,0 +1,40 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Database
+{
+ public class Setting
+ {
+ public string Filter { get; set; }
+ ///
+ /// The setting option
+ ///
+ public string Name { get; set; }
+ ///
+ /// The setting value
+ ///
+ public string Value { get; set; }
+
+ ///
+ /// The actual option arguments
+ ///
+ public Duplicati.Library.Interface.ICommandLineArgument Argument { get; private set; }
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Duplicati.Server.Serialization.csproj b/Duplicati/Server/Duplicati.Server.Serialization/Duplicati.Server.Serialization.csproj
index 94d99bb02..042eefa50 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/Duplicati.Server.Serialization.csproj
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Duplicati.Server.Serialization.csproj
@@ -36,9 +36,6 @@
Duplicati.snk
-
- ..\..\..\thirdparty\LightDataModel\LightDatamodel.dll
-
@@ -52,18 +49,20 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -86,4 +85,7 @@
-->
+
+
+
\ No newline at end of file
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Enums.cs b/Duplicati/Server/Duplicati.Server.Serialization/Enums.cs
index ffdef921e..b0a1ca331 100755
--- a/Duplicati/Server/Duplicati.Server.Serialization/Enums.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Enums.cs
@@ -42,30 +42,10 @@ namespace Duplicati.Server.Serialization
Backup,
Restore,
List,
- Remove
- }
-
- public enum DuplicatiOperationMode
- {
- Backup,
- BackupFull,
- BackupIncremental,
- Restore,
- RestoreControlfiles,
- List,
- GetBackupSets,
- ListCurrentFiles,
- ListSourceFolders,
- ListActualSignatureFiles,
- DeleteAllButNFull,
- DeleteAllButN,
- DeleteOlderThan,
- CleanUp,
- CreateFolder,
- FindLastFileVersion,
+ Remove,
Verify
}
-
+
public enum SuggestedStatusIcon
{
Ready,
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/IBackendSettings.cs b/Duplicati/Server/Duplicati.Server.Serialization/IBackendSettings.cs
deleted file mode 100644
index a6794162d..000000000
--- a/Duplicati/Server/Duplicati.Server.Serialization/IBackendSettings.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Duplicati.Server.Serialization
-{
- public interface IBackendSettings
- {
- ///
- /// Gets or sets a string with all relevant properties encoded as a semi-valid URI
- ///
- string ConnectionURI { get; set; }
-
- ///
- /// The username used to connect to the server
- ///
- string Username { get; set; }
-
- ///
- /// The password used to connect to the server
- ///
- string Password { get; set; }
-
- ///
- /// A lookup table with settings applied to the backend
- ///
- IDictionary Settings { get; set; }
- }
-}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/IFilterSet.cs b/Duplicati/Server/Duplicati.Server.Serialization/IFilterSet.cs
deleted file mode 100644
index 5e2af774e..000000000
--- a/Duplicati/Server/Duplicati.Server.Serialization/IFilterSet.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Duplicati.Server.Serialization
-{
- public enum FilterType
- {
- Include,
- Exclude,
- IncludeRegexp,
- ExcludeRegexp,
- ExcludeSize,
- ExcludeOlderThan,
- ExcludeNewerThan
- }
-
- ///
- /// Interface for a single filter set
- ///
- public interface IFilterSet
- {
- ///
- /// Name of the filterset
- ///
- string Name { get; set; }
-
- ///
- /// List of filters in this set
- ///
- IList> Filters { get; set; }
- }
-}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/BackendSettings.cs b/Duplicati/Server/Duplicati.Server.Serialization/Implementations/BackendSettings.cs
deleted file mode 100644
index 41734e526..000000000
--- a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/BackendSettings.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Duplicati.Server.Serialization.Implementations
-{
- public class BackendSettings : IBackendSettings
- {
- public string ConnectionURI { get; set; }
- public string Username { get; set; }
- public string Password { get; set; }
- public IDictionary Settings { get; set; }
- }
-}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/FilterSet.cs b/Duplicati/Server/Duplicati.Server.Serialization/Implementations/FilterSet.cs
deleted file mode 100644
index 4c6e8150d..000000000
--- a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/FilterSet.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Duplicati.Server.Serialization.Implementations
-{
- internal class FilterSet : IFilterSet
- {
- public string Name { get; set; }
- public IList> Filters { get; set; }
- }
-}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ProgressEventData.cs b/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ProgressEventData.cs
index 2563473bb..0c1d7f2a7 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ProgressEventData.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ProgressEventData.cs
@@ -5,12 +5,10 @@ using System.Text;
namespace Duplicati.Server.Serialization.Implementations
{
- internal class ProgressEventData : IProgressEventData
+ internal class ProgressEventData : Interface.IProgressEventData
{
public DuplicatiOperation Operation { get; set; }
- public DuplicatiOperationMode Mode { get; set; }
-
public string Message { get; set; }
public string SubMessage { get; set; }
@@ -21,7 +19,7 @@ namespace Duplicati.Server.Serialization.Implementations
public long LastEventID { get; set; }
- public IProgressEventData Clone()
+ public Interface.IProgressEventData Clone()
{
return (ProgressEventData)this.MemberwiseClone();
}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ServerStatus.cs b/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ServerStatus.cs
index 0319889c7..d9aea50d9 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ServerStatus.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Implementations/ServerStatus.cs
@@ -1,22 +1,21 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Duplicati.Server.Serialization.Implementations
-{
- internal class ServerStatus : IServerStatus
- {
- public RunnerState ActiveBackupState { get; set; }
- public long ActiveScheduleId { get; set; }
- public LiveControlState ProgramState { get; set; }
- public IList SchedulerQueueIds { get; set; }
- public bool HasError { get; set; }
- public bool HasWarning { get; set; }
- public SuggestedStatusIcon SuggestedStatusIcon { get; set; }
- public DateTime LastLogUpdate { get; set; }
- public DateTime EstimatedPauseEnd { get; set; }
- public long LastEventID { get; set; }
- public long LastDataUpdateID { get; set; }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Duplicati.Server.Serialization.Implementations
+{
+ internal class ServerStatus : Interface.IServerStatus
+ {
+ public RunnerState ActiveBackupState { get; set; }
+ public long ActiveScheduleId { get; set; }
+ public LiveControlState ProgramState { get; set; }
+ public IList SchedulerQueueIds { get; set; }
+ public bool HasError { get; set; }
+ public bool HasWarning { get; set; }
+ public SuggestedStatusIcon SuggestedStatusIcon { get; set; }
+ public DateTime EstimatedPauseEnd { get; set; }
+ public long LastEventID { get; set; }
+ public long LastDataUpdateID { get; set; }
+ }
+}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Interface/IBackup.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IBackup.cs
new file mode 100644
index 000000000..d7b482095
--- /dev/null
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IBackup.cs
@@ -0,0 +1,70 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using System.Collections.Generic;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ ///
+ /// All settings for a single backup
+ ///
+ public interface IBackup
+ {
+ ///
+ /// The backup ID
+ ///
+ long ID { get; set; }
+ ///
+ /// The backup name
+ ///
+ string Name { get; set; }
+ ///
+ /// The backup tags
+ ///
+ string[] Tags { get; set; }
+ ///
+ /// The backup target url, excluding username/password
+ ///
+ string TargetURL { get; set; }
+ ///
+ /// The path to the local database
+ ///
+ string DBPath { get; }
+
+ ///
+ /// The backup source folders and files
+ ///
+ string[] Sources { get; set; }
+
+ ///
+ /// The backup settings
+ ///
+ ISetting[] Settings { get; set; }
+
+ ///
+ /// The filters applied to the source files
+ ///
+ IFilter[] Filters { get; set; }
+
+ ///
+ /// The backup metadata
+ ///
+ IDictionary Metadata { get; set; }
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Interface/IDynamicModule.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IDynamicModule.cs
new file mode 100644
index 000000000..ed66a4b84
--- /dev/null
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IDynamicModule.cs
@@ -0,0 +1,42 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+using System.Collections.Generic;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ ///
+ /// The dynamic module
+ ///
+ public interface IDynamicModule
+ {
+ ///
+ /// The module key
+ ///
+ string Key { get; }
+ ///
+ /// The localized module description
+ ///
+ string Description { get; }
+ ///
+ /// The options supported by the module
+ ///
+ Duplicati.Library.Interface.ICommandLineArgument[] Options { get; }
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Interface/IFilter.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IFilter.cs
new file mode 100644
index 000000000..3c68dfe01
--- /dev/null
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IFilter.cs
@@ -0,0 +1,44 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ ///
+ /// Represents a single filter
+ ///
+ public interface IFilter
+ {
+ ///
+ /// The sort order
+ ///
+ long Order { get; set; }
+
+ ///
+ /// True if the filter includes the items, false if it excludes
+ ///
+ bool Include { get; set; }
+
+ ///
+ /// The filter expression.
+ /// If the filter is a regular expression, it starts and ends with hard brackets [ ]
+ ///
+ string Expression { get; set; }
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/IProgressEventData.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IProgressEventData.cs
similarity index 77%
rename from Duplicati/Server/Duplicati.Server.Serialization/IProgressEventData.cs
rename to Duplicati/Server/Duplicati.Server.Serialization/Interface/IProgressEventData.cs
index 4da86651e..098bb2771 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/IProgressEventData.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IProgressEventData.cs
@@ -3,12 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
-namespace Duplicati.Server.Serialization
+namespace Duplicati.Server.Serialization.Interface
{
public interface IProgressEventData
{
DuplicatiOperation Operation { get; }
- DuplicatiOperationMode Mode { get; }
string Message { get; }
string SubMessage { get; }
int Progress { get; }
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Interface/ISchedule.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/ISchedule.cs
new file mode 100644
index 000000000..38fb4c204
--- /dev/null
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/ISchedule.cs
@@ -0,0 +1,54 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ ///
+ /// A single schedule
+ ///
+ public interface ISchedule
+ {
+ ///
+ /// The Schedule ID
+ ///
+ long ID { get; set; }
+ ///
+ /// The tags that this schedule affects
+ ///
+ string[] Tags { get; set; }
+ ///
+ /// The time this schedule is based on
+ ///
+ DateTime Time { get; set; }
+ ///
+ /// How often the backup is repeated
+ ///
+ string Repeat { get; set; }
+ ///
+ /// The time this schedule was last executed
+ ///
+ /// The last run.
+ DateTime LastRun { get; set; }
+ ///
+ /// The rule that is parsed to figure out when to run this backup next time
+ ///
+ DayOfWeek[] AllowedDays { get; set; }
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Interface/IServerSettings.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IServerSettings.cs
new file mode 100644
index 000000000..d0d8fb26b
--- /dev/null
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IServerSettings.cs
@@ -0,0 +1,54 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ ///
+ /// Gets all server settings
+ ///
+ public interface IServerSettings
+ {
+ ///
+ /// The backend modules known by the server
+ ///
+ IDynamicModule[] BackendModules { get; }
+ ///
+ /// The encryption modules known by the server
+ ///
+ IDynamicModule[] EncryptionModules { get; }
+ ///
+ /// The compression modules known by the server
+ ///
+ IDynamicModule[] CompressionModules { get; }
+ ///
+ /// The generic modules known by the server
+ ///
+ IDynamicModule[] GenericModules { get; }
+
+ ///
+ /// The filters that are applied to all backups
+ ///
+ IFilter[] Filters { get; }
+ ///
+ /// The settings applied to all backups by default
+ ///
+ ISetting[] Settings { get; }
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/IServerStatus.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IServerStatus.cs
similarity index 84%
rename from Duplicati/Server/Duplicati.Server.Serialization/IServerStatus.cs
rename to Duplicati/Server/Duplicati.Server.Serialization/Interface/IServerStatus.cs
index e2306e17b..fc30f2e6e 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/IServerStatus.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/IServerStatus.cs
@@ -1,20 +1,19 @@
-using System;
-using System.Collections.Generic;
-
-namespace Duplicati.Server.Serialization
-{
- public interface IServerStatus
- {
- RunnerState ActiveBackupState { get; }
- long ActiveScheduleId { get; }
- LiveControlState ProgramState { get; }
- System.Collections.Generic.IList SchedulerQueueIds { get; }
- bool HasWarning { get; }
- bool HasError { get; }
- SuggestedStatusIcon SuggestedStatusIcon { get; }
- DateTime LastLogUpdate { get; }
- DateTime EstimatedPauseEnd { get; }
- long LastEventID { get; }
- long LastDataUpdateID { get; }
- }
-}
+using System;
+using System.Collections.Generic;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ public interface IServerStatus
+ {
+ RunnerState ActiveBackupState { get; }
+ long ActiveScheduleId { get; }
+ LiveControlState ProgramState { get; }
+ System.Collections.Generic.IList SchedulerQueueIds { get; }
+ bool HasWarning { get; }
+ bool HasError { get; }
+ SuggestedStatusIcon SuggestedStatusIcon { get; }
+ DateTime EstimatedPauseEnd { get; }
+ long LastEventID { get; }
+ long LastDataUpdateID { get; }
+ }
+}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Interface/ISetting.cs b/Duplicati/Server/Duplicati.Server.Serialization/Interface/ISetting.cs
new file mode 100644
index 000000000..daad19397
--- /dev/null
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Interface/ISetting.cs
@@ -0,0 +1,47 @@
+// Copyright (C) 2011, Kenneth Skovhede
+
+// http://www.hexad.dk, opensource@hexad.dk
+//
+// This library is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation; either version 2.1 of the
+// License, or (at your option) any later version.
+//
+// This library 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+using System;
+
+namespace Duplicati.Server.Serialization.Interface
+{
+ ///
+ /// A single setting
+ ///
+ public interface ISetting
+ {
+ ///
+ /// The filter expression
+ ///
+ string Filter { get; }
+ ///
+ /// The setting option
+ ///
+ string Name { get; set; }
+ ///
+ /// The setting value
+ ///
+ string Value { get; set; }
+
+ ///
+ /// The actual option arguments
+ ///
+ Duplicati.Library.Interface.ICommandLineArgument Argument { get; }
+
+ }
+}
+
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/InterfaceResolver.cs b/Duplicati/Server/Duplicati.Server.Serialization/InterfaceResolver.cs
index 774e06d47..c0c7fb35d 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/InterfaceResolver.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/InterfaceResolver.cs
@@ -6,35 +6,19 @@ using Newtonsoft.Json.Converters;
namespace Duplicati.Server.Serialization
{
- public class SerializableStatusCreator : CustomCreationConverter
+ public class SerializableStatusCreator : CustomCreationConverter
{
- public override IServerStatus Create(Type objectType)
+ public override Interface.IServerStatus Create(Type objectType)
{
return new Implementations.ServerStatus();
}
}
- public class ProgressEventDataCreator : CustomCreationConverter
+ public class ProgressEventDataCreator : CustomCreationConverter
{
- public override IProgressEventData Create(Type objectType)
+ public override Interface.IProgressEventData Create(Type objectType)
{
return new Implementations.ProgressEventData();
}
}
-
- public class BackendSettingsCreator : CustomCreationConverter
- {
- public override IBackendSettings Create(Type objectType)
- {
- return new Implementations.BackendSettings();
- }
- }
-
- public class FilterSetCreator : CustomCreationConverter
- {
- public override IFilterSet Create(Type objectType)
- {
- return new Implementations.FilterSet();
- }
- }
}
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/JsonSerializer.cs b/Duplicati/Server/Duplicati.Server.Serialization/JsonSerializer.cs
index 0e3fee1c8..1cf393ad6 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/JsonSerializer.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/JsonSerializer.cs
@@ -26,82 +26,29 @@ namespace Duplicati.Server.Serialization
{
internal class JsonSerializer : DefaultContractResolver
{
- private static readonly Dictionary m_ignoreList;
- private static readonly Dictionary m_renameList;
-
static JsonSerializer()
{
- m_ignoreList = new Dictionary();
- m_ignoreList.Add("Duplicati.Datamodel.ApplicationSettings!RawOptions", null);
- m_ignoreList.Add("Duplicati.Datamodel.Task!Extensions", null);
- m_ignoreList.Add("Duplicati.Datamodel.Task!SortedFilters", null);
- m_ignoreList.Add("Duplicati.Datamodel.Task!EncodedFilter", null);
- m_ignoreList.Add("Duplicati.Datamodel.Task!ExistsInDb", null);
- m_ignoreList.Add("Duplicati.Datamodel.Schedule!ExistsInDb", null);
-
- m_renameList = new Dictionary();
- m_renameList.Add("Duplicati.Datamodel.Schedule!MetadataLookup", "Metadata");
- m_renameList.Add("Duplicati.Datamodel.Task!BackendSettingsLookup", "BackendSettings");
- m_renameList.Add("Duplicati.Datamodel.Task!TaskExtensionsLookup", "Extensions");
- m_renameList.Add("Duplicati.Datamodel.Task!TaskOverridesLookup", "Overrides");
- m_renameList.Add("Duplicati.Datamodel.Task!EncryptionSettingsLookup", "EncryptionSettings");
- m_renameList.Add("Duplicati.Datamodel.Task!CompressionSettingsLookup", "CompressionSettings");
- m_renameList.Add("Duplicati.Datamodel.Task!FilterXml", "Filter");
}
private static string MemberInfoAsKey(MemberInfo mi) { return mi.DeclaringType.FullName + "!" + mi.Name; }
private static string ExposedNamed(MemberInfo mi)
{
- string newname;
+ /*string newname;
if (!m_renameList.TryGetValue(MemberInfoAsKey(mi), out newname))
newname = mi.Name;
- return newname;
+ return newname;*/
+ return mi.Name;
}
protected override List GetSerializableMembers(Type objectType)
{
- return base.GetSerializableMembers(objectType).Where(x => !m_ignoreList.ContainsKey(MemberInfoAsKey(x))).ToList();
+ //return base.GetSerializableMembers(objectType).Where(x => !m_ignoreList.ContainsKey(MemberInfoAsKey(x))).ToList();
+ return base.GetSerializableMembers(objectType);
}
protected override JsonObjectContract CreateObjectContract (Type objectType)
{
- if (typeof(System.Data.LightDatamodel.IDataFetcher).IsAssignableFrom(objectType))
- {
- //If this type was ever serialized, it would expose the entire internal object cache, and we do NOT want that :)
- throw new Exception("Internal error, a non-serializable type was hit");
- }
- else if (typeof(System.Data.LightDatamodel.IDataClass).IsAssignableFrom(objectType))
- {
- JsonObjectContract joc = new JsonObjectContract(objectType);
- joc.OverrideConstructor = objectType.GetConstructor(Type.EmptyTypes);
-
- foreach(var pi in objectType.GetProperties( BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance ))
- {
- var customs = pi.GetCustomAttributes(false);
- bool isRef = customs.Select(x => x.GetType()).Contains(typeof(System.Data.LightDatamodel.DataClassAttributes.Affects));
- bool isParent = typeof(System.Data.LightDatamodel.IDataFetcher).IsAssignableFrom(pi.PropertyType);
- isRef |= typeof(System.Data.LightDatamodel.IDataClass).IsAssignableFrom(pi.PropertyType);
- bool ignored = isRef || isParent || m_ignoreList.ContainsKey(MemberInfoAsKey(pi));
-
- if (!ignored)
- {
- joc.Properties.Add(new JsonProperty()
- {
- PropertyName = ExposedNamed(pi),
- PropertyType = pi.PropertyType,
- Ignored = ignored,
- UnderlyingName = pi.Name,
- Readable = pi.CanRead,
- Writable = pi.CanWrite & pi.Name != "ID",
- ValueProvider = CreateMemberValueProvider(pi)
- });
- }
- }
-
- return joc;
- }
- else
- return base.CreateObjectContract (objectType);
+ return base.CreateObjectContract (objectType);
}
protected override IValueProvider CreateMemberValueProvider(MemberInfo member)
diff --git a/Duplicati/Server/Duplicati.Server.Serialization/Serializer.cs b/Duplicati/Server/Duplicati.Server.Serialization/Serializer.cs
index 1ce128bce..659dfaa38 100644
--- a/Duplicati/Server/Duplicati.Server.Serialization/Serializer.cs
+++ b/Duplicati/Server/Duplicati.Server.Serialization/Serializer.cs
@@ -19,9 +19,7 @@ namespace Duplicati.Server.Serialization
m_jsonSettings.ContractResolver = new JsonSerializer();
m_jsonSettings.Converters = new JsonConverter[] {
new SerializableStatusCreator(),
- new ProgressEventDataCreator(),
- new BackendSettingsCreator(),
- new FilterSetCreator(),
+ new ProgressEventDataCreator()
}.ToList();
}
diff --git a/Duplicati/Server/Duplicati.Server.csproj b/Duplicati/Server/Duplicati.Server.csproj
index ad186ae39..2f8a686c3 100644
--- a/Duplicati/Server/Duplicati.Server.csproj
+++ b/Duplicati/Server/Duplicati.Server.csproj
@@ -48,9 +48,6 @@
..\..\thirdparty\HttpServer\HttpServer.MVC.dll
-
- ..\..\thirdparty\LightDataModel\LightDatamodel.dll
-
@@ -66,17 +63,12 @@
-
-
-
-
- DuplicatiRunner.resx
@@ -103,14 +95,22 @@
TrueTrue
-
+
+
+
+
+
+
+
+
-
+
+
@@ -125,18 +125,10 @@
{81765A64-3661-4E3E-B850-2F6F87A51F74}Duplicati.CommandLine
-
- {B60D0993-B0C5-457A-90D9-DB6EEB33CE47}
- Datamodel
- {FC9B7611-836F-4127-8B44-A7C31F506807}Duplicati.Library.Backend.File
-
- {42C91180-11EB-4590-82EA-80FE9D4DEBEC}
- Duplicati.Library.Backend.GoogleDocs
- {CCD76347-7DC7-4B42-B7E1-E500E624CAC3}Duplicati.Library.Backend.SkyDrive
@@ -236,6 +228,8 @@
+
+
-
- 1D
- 13:00:00
-
-
- aes
- zip
-
-
- true
- true
- false
- true
- false
- true
- 50MB
-
-
- true
- 4
- 1M
-
-
- *\Thumbs.db
-
-
-
-
-
\ No newline at end of file
diff --git a/Duplicati/Server/newbackup.json b/Duplicati/Server/newbackup.json
new file mode 100644
index 000000000..fcfaaf0a5
--- /dev/null
+++ b/Duplicati/Server/newbackup.json
@@ -0,0 +1,13 @@
+{
+ Backup: {
+ Settings: {
+ "encryption-module": "aes",
+ "compression-module": "zip",
+ "dblock-size": "50mb"
+ }
+ },
+ Schedule: {
+ Repeat: "1D"
+ Time: "13:00:00"
+ }
+}
\ No newline at end of file