本文整理汇总了C#中Duplicati类的典型用法代码示例。如果您正苦于以下问题:C# Duplicati类的具体用法?C# Duplicati怎么用?C# Duplicati使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Duplicati类属于命名空间,在下文中一共展示了Duplicati类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MenuItemWrapper
public MenuItemWrapper(RumpsRunner parent, string text, Duplicati.GUI.TrayIcon.MenuIcons icon, Action callback, IList<Duplicati.GUI.TrayIcon.IMenuItem> subitems)
{
m_parent = parent;
Key = Guid.NewGuid().ToString("N");
m_text = text ?? "";
Callback = callback;
m_enabled = true;
m_default = false;
if (subitems != null)
Subitems = subitems.Cast<MenuItemWrapper>().ToList();
}
开发者ID:AlexFRAN,项目名称:duplicati,代码行数:11,代码来源:RumpsRunner.cs
示例2: GetSourceNames
private Dictionary<string, string> GetSourceNames(Duplicati.Server.Serialization.Interface.IBackup backup)
{
var systemIO = Duplicati.Library.Snapshots.SnapshotUtility.SystemIO;
return backup.Sources.Distinct().Select(x => {
var sp = SpecialFolders.TranslateToDisplayString(x);
if (sp != null)
return new KeyValuePair<string, string>(x, sp);
x = SpecialFolders.ExpandEnvironmentVariables(x);
try {
var nx = x;
if (nx.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
nx = nx.Substring(0, nx.Length - 1);
var n = systemIO.PathGetFileName(nx);
if (!string.IsNullOrWhiteSpace(n))
return new KeyValuePair<string, string>(x, n);
} catch {
}
if (x.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()) && x.Length > 1)
return new KeyValuePair<string, string>(x, x.Substring(0, x.Length - 1).Substring(x.Substring(0, x.Length - 1).LastIndexOf("/") + 1));
else
return new KeyValuePair<string, string>(x, x);
}).ToDictionary(x => x.Key, x => x.Value);
}
开发者ID:admz,项目名称:duplicati,代码行数:27,代码来源:GetBackup.cs
示例3: DynamicModule
/// <summary>
/// Constructor for webmodule interface
/// </summary>
public DynamicModule(Duplicati.Library.Interface.IWebModule module)
{
this.Key = module.Key;
this.Description = module.Description;
this.DisplayName = module.DisplayName;
if (module.SupportedCommands != null)
this.Options = module.SupportedCommands.ToArray();
}
开发者ID:HITSUN2015,项目名称:duplicati,代码行数:11,代码来源:ServerSettings.cs
示例4: SettingsDialog
/// <summary>
/// Edit Settings
/// </summary>
/// <remarks>
/// Here a global password may be set. If set, User may use it for backups, or not as User is want.
/// The bubbles thing is not used now.
/// </remarks>
/// <param name="aSettings">Settings to edit</param>
public SettingsDialog(Duplicati.Scheduler.Data.SchedulerDataSet.SettingsDataTable aSettings)
{
InitializeComponent();
this.Settings = aSettings;
OriginalXML = XmlFromTable(aSettings);
this.checkBox1.Checked = this.Settings.UseGlobalPassword;
this.passwordControl1.CheckMod = this.Settings.Values.CheckMod;
this.passwordControl1.Checksum = this.Settings.Values.Checksum;
this.numericUpDown1.Value = (decimal)this.Settings.Values.LogFileAgeDays;
if (this.Settings.Values.IsShowBubblesNull()) this.Settings.Values.ShowBubbles = true;
this.BubbleCheckBox.Checked = this.Settings.Values.ShowBubbles;
}
开发者ID:pacificIT,项目名称:Duplicati,代码行数:20,代码来源:SettingsDialog.cs
示例5: SetSummary
/// <summary>
/// Set the values
/// </summary>
/// <param name="aRow">The job row</param>
/// <param name="aDetails">Text description of the job trigger</param>
public void SetSummary(Duplicati.Scheduler.Data.SchedulerDataSet.JobsRow aRow, string aDetails)
{
this.nameTextBox.Text = aRow.Name;
this.DescriptionTextBox.Text = aDetails;
this.sourceTextBox.Text = aRow.Source;
this.destinationTextBox.Text = aRow.Destination;
this.LastModLabel.Text = (aRow.IsLastModNull() || aRow.LastMod == DateTime.MinValue) ? "Never edited" : "Last edited: " + aRow.LastMod.ToString("ddd, dd MMMM yyyy hh:mm tt");
if (aRow.FullOnly || (aRow.FullRepeatDays == 0 && aRow.FullAfterN == 0)) this.fullRepeatStrTextBox.Text = "Always do full backups";
else this.fullRepeatStrTextBox.Text = aRow.FullRepeatDays > 0 ? aRow.FullRepeatDays + " days " : aRow.FullAfterN.ToString()+" incrementals";
this.MaxFullTextBox.Text = aRow.MaxFulls > 0 ? "the last "+aRow.MaxFulls.ToString("N0") : "all" ;
this.MaxAgeTextBox.Text = aRow.MaxAgeDays > 0 ? aRow.MaxAgeDays.ToString("N0") + " days" : "<no limit>" ;
this.PassRichTextBox.Text = new string[] { "not password protected.", "protected by local password.", "protected by global password." }[aRow.GetCheckSrc()];
}
开发者ID:pacificIT,项目名称:Duplicati,代码行数:18,代码来源:JobSummary.cs
示例6: EnumerateFilesInDList
public static IEnumerable<Duplicati.Library.Main.Volumes.IFileEntry> EnumerateFilesInDList(string file, Duplicati.Library.Utility.IFilter filter, Dictionary<string, string> options)
{
var p = Library.Main.Volumes.VolumeBase.ParseFilename(file);
using(var cm = Library.DynamicLoader.CompressionLoader.GetModule(p.CompressionModule, file, options))
using(var filesetreader = new Library.Main.Volumes.FilesetVolumeReader(cm, new Duplicati.Library.Main.Options(options)))
foreach(var f in filesetreader.Files)
{
if (f.Type != Duplicati.Library.Main.FilelistEntryType.File)
continue;
bool result;
Library.Utility.IFilter evfilter;
bool match = filter.Matches(f.Path, out result, out evfilter);
if (!match || (match && result))
yield return f;
}
}
开发者ID:HITSUN2015,项目名称:duplicati,代码行数:17,代码来源:List.cs
示例7: MenuItemWrapper
public MenuItemWrapper(string text, Duplicati.GUI.TrayIcon.MenuIcons icon, Action callback, IList<Duplicati.GUI.TrayIcon.IMenuItem> subitems)
{
if (text == "-")
m_item = NSMenuItem.SeparatorItem;
else
{
m_item = new NSMenuItem(text, ClickHandler);
m_callback = callback;
if (subitems != null && subitems.Count > 0)
{
m_item.Submenu = new NSMenu();
foreach(var itm in subitems)
m_item.Submenu.AddItem(((MenuItemWrapper)itm).MenuItem);
}
}
}
开发者ID:admz,项目名称:duplicati,代码行数:17,代码来源:CocoaRunner.cs
示例8: CreateListTask
public static IRunnerData CreateListTask(Duplicati.Server.Serialization.Interface.IBackup backup, string[] filters, bool onlyPrefix, bool allVersions, bool folderContents, DateTime time)
{
var dict = new Dictionary<string, string>();
if (onlyPrefix)
dict["list-prefix-only"] = "true";
if (allVersions)
dict["all-versions"] = "true";
if (time.Ticks > 0)
dict["time"] = Duplicati.Library.Utility.Utility.SerializeDateTime(time.ToUniversalTime());
if (folderContents)
dict["list-folder-contents"] = "true";
return CreateTask(
DuplicatiOperation.List,
backup,
dict,
filters);
}
开发者ID:rlugojr,项目名称:duplicati,代码行数:18,代码来源:Runner.cs
示例9: JobDialog
/// <summary>
/// Edit a Job
/// </summary>
/// <param name="aRow">Row to edit</param>
public JobDialog(Duplicati.Scheduler.Data.SchedulerDataSet.JobsRow aRow)
{
InitializeComponent();
if (!string.IsNullOrEmpty(Properties.Settings.Default.TreeViewState))
this.folderSelectControl1.State = Properties.Settings.Default.TreeViewState;
this.Text = "Edit job " + aRow.Name + "(" + Utility.User.UserName + ")";
// Dang background colors in tab pages - can't trust them.
foreach (TabPage P in this.MainTabControl.TabPages)
P.BackColor = this.BackColor;
foreach (TabPage P in this.SourceTabControl.TabPages)
P.BackColor = this.BackColor;
this.folderSelectControl1.BackColor = this.BackColor;
// Add radio buttons for backends; put the backend in the tag
this.BackEndTableLayoutPanel.Controls.AddRange(
(from Library.Interface.IBackend qB in Duplicati.Library.DynamicLoader.BackendLoader.Backends
orderby qB.DisplayName
select BackendRadioButton(qB)).ToArray());
// Put the tooltip text at the bottom of the screen for easy user viewage
this.ExplainToolStripLabel.Text = this.MainTabControl.SelectedTab.ToolTipText;
// And use the row
SetRow(aRow);
}
开发者ID:pacificIT,项目名称:Duplicati,代码行数:26,代码来源:JobDialog.cs
示例10: FilterHandler
public FilterHandler(Snapshots.ISnapshotService snapshot, FileAttributes attributeFilter, Duplicati.Library.Utility.IFilter sourcefilter, Duplicati.Library.Utility.IFilter filter, Options.SymlinkStrategy symlinkPolicy, Options.HardlinkStrategy hardlinkPolicy, ILogWriter logWriter)
{
m_snapshot = snapshot;
m_attributeFilter = attributeFilter;
m_sourcefilter = sourcefilter;
m_emitfilter = filter;
m_symlinkPolicy = symlinkPolicy;
m_hardlinkPolicy = hardlinkPolicy;
m_logWriter = logWriter;
m_hardlinkmap = new Dictionary<string, string>();
m_mixinqueue = new Queue<string>();
bool includes;
bool excludes;
Library.Utility.FilterExpression.AnalyzeFilters(filter, out includes, out excludes);
if (includes && !excludes)
{
m_enumeratefilter = Library.Utility.FilterExpression.Combine(filter, new Duplicati.Library.Utility.FilterExpression("*" + System.IO.Path.DirectorySeparatorChar, true));
}
else
m_enumeratefilter = m_emitfilter;
}
开发者ID:AlexFRAN,项目名称:duplicati,代码行数:23,代码来源:BackupHandler.cs
示例11: EnumerateFilesAndFolders
/// <summary>
/// Enumerates all files and folders in the snapshot
/// </summary>
/// <param name="startpath">The path from which to retrieve files and folders</param>
/// <param name="callback">The callback to invoke with each found path</param>
public void EnumerateFilesAndFolders(string startpath, Duplicati.Library.Utility.Utility.EnumerationCallbackDelegate callback)
{
foreach (string s in m_sourcefolders)
if (s.Equals(startpath, Utility.Utility.ClientFilenameStringComparision))
{
Utility.Utility.EnumerateFileSystemEntries(s, callback, this.ListFolders, this.ListFiles, this.GetAttributes);
return;
}
throw new InvalidOperationException(string.Format(Strings.Shared.InvalidEnumPathError, startpath));
}
开发者ID:pacificIT,项目名称:Duplicati,代码行数:16,代码来源:NoSnapshot.cs
示例12: TestIfOptionApplies
private static bool TestIfOptionApplies(Duplicati.Server.Serialization.Interface.IBackup backup, DuplicatiOperation mode, string filter)
{
//TODO: Implement to avoid warnings
return true;
}
开发者ID:rlugojr,项目名称:duplicati,代码行数:5,代码来源:Runner.cs
示例13: CreateRestoreTask
public static IRunnerData CreateRestoreTask(Duplicati.Server.Serialization.Interface.IBackup backup, string[] filters, DateTime time, string restoreTarget, bool overwrite, bool restore_permissions, bool skip_metadata)
{
var dict = new Dictionary<string, string>();
dict["time"] = Duplicati.Library.Utility.Utility.SerializeDateTime(time.ToUniversalTime());
if (!string.IsNullOrWhiteSpace(restoreTarget))
dict["restore-path"] = SpecialFolders.ExpandEnvironmentVariables(restoreTarget);
if (overwrite)
dict["overwrite"] = "true";
if (restore_permissions)
dict["restore-permissions"] = "true";
if (skip_metadata)
dict["skip-metadata"] = "true";
return CreateTask(
DuplicatiOperation.Restore,
backup,
dict,
filters);
}
开发者ID:rlugojr,项目名称:duplicati,代码行数:19,代码来源:Runner.cs
示例14: BackendEvent
public void BackendEvent(Duplicati.Library.Main.BackendActionType action, Duplicati.Library.Main.BackendEventType type, string path, long size)
{
lock(m_lock)
{
m_state.m_backendAction = action;
m_state.m_backendPath = path;
if (type == Duplicati.Library.Main.BackendEventType.Started)
m_state.m_backendFileSize = size;
else if (type == Duplicati.Library.Main.BackendEventType.Progress)
m_state.m_backendFileProgress = size;
else
{
m_state.m_backendFileSize = 0;
m_state.m_backendFileProgress = 0;
m_state.m_backendSpeed = 0;
}
}
}
开发者ID:rlugojr,项目名称:duplicati,代码行数:18,代码来源:Runner.cs
示例15: FilterHandler
public FilterHandler(Snapshots.ISnapshotService snapshot, FileAttributes attributeFilter, Duplicati.Library.Utility.IFilter sourcefilter, Duplicati.Library.Utility.IFilter filter, Options.SymlinkStrategy symlinkPolicy, Options.HardlinkStrategy hardlinkPolicy, ILogWriter logWriter)
{
m_snapshot = snapshot;
m_attributeFilter = attributeFilter;
m_sourcefilter = sourcefilter;
m_filter = filter;
m_symlinkPolicy = symlinkPolicy;
m_hardlinkPolicy = hardlinkPolicy;
m_logWriter = logWriter;
m_hardlinkmap = new Dictionary<string, string>();
}
开发者ID:Berimor66,项目名称:duplicati,代码行数:11,代码来源:BackupHandler.cs
示例16: ParseFilename
public BackupEntryBase ParseFilename(Duplicati.Library.Interface.IFileEntry fe)
{
bool oldFilename = false;
Match m = m_filenameRegExp.Match(fe.Name);
if (!m.Success)
m = m_shortRegExp.Match(fe.Name);
if (!m.Success)
{
m = m_oldFilenameRegExp.Match(fe.Name);
oldFilename = true;
}
if (!m.Success)
{
m = m_verificationRegExp.Match(fe.Name);
if (m.Success && m.Value == fe.Name)
{
DateTime verificationtime = DateTime.ParseExact(m.Groups["time"].Value, TIMESTAMP_FORMAT, System.Globalization.CultureInfo.InvariantCulture).ToLocalTime();
return new VerificationEntry(fe.Name, fe, verificationtime, m.Groups["time"].Value);
}
m = m_deleteTransactionRegExp.Match(fe.Name);
if (m.Success && m.Value == fe.Name)
{
return new DeleteTransactionEntry(fe, m.Groups["encryption"].Value);
}
}
if (!m.Success)
return null;
if (m.Value != fe.Name)
return null; //Accept only full matches
bool isFull = m.Groups["inc"].Value == FULL || m.Groups["inc"].Value == FULL_SHORT;
bool isShortName = m.Groups["inc"].Value.Length == 1;
string timeString = m.Groups["time"].Value;
DateTime time;
if (isShortName)
time = new DateTime(long.Parse(timeString, System.Globalization.NumberStyles.HexNumber) * TimeSpan.TicksPerSecond, DateTimeKind.Utc).ToLocalTime();
else
{
if (oldFilename)
time = DateTime.Parse(timeString.Replace(m.Groups["timeseparator"].Value, ":"));
else
time = DateTime.ParseExact(timeString, TIMESTAMP_FORMAT, System.Globalization.CultureInfo.InvariantCulture).ToLocalTime();
}
string extension = m.Groups["extension"].Value;
int volNumber = -1;
if (m.Groups["volumenumber"].Success)
volNumber = int.Parse(m.Groups["volumenumber"].Value);
else if (m.Groups["extension"].Success && m.Groups["extension"].Value.StartsWith(VOLUME))
{
//The extension must be present, but the volumenumber is optional, so the greedy regexp takes it
if (!int.TryParse(m.Groups["extension"].Value.Substring(VOLUME.Length), out volNumber))
volNumber = -1;
}
string compression = extension;
string encryption = null;
int dotIndex = compression.IndexOf(".");
if (dotIndex > 0)
{
encryption = compression.Substring(dotIndex + 1);
compression = compression.Substring(0, dotIndex);
}
if (Array.IndexOf<string>(new string[] { MANIFEST_OLD , MANIFEST_OLD_SHORT ,MANIFEST_A , MANIFEST_A_SHORT, MANIFEST_B, MANIFEST_B_SHORT }, m.Groups["type"].Value) >= 0)
return new ManifestEntry(fe.Name, fe, time, isFull, timeString, encryption, m.Groups["type"].Value != MANIFEST_B && m.Groups["type"].Value != MANIFEST_B_SHORT);
else if (m.Groups["type"].Value == SIGNATURE || m.Groups["type"].Value == SIGNATURE_SHORT)
return new SignatureEntry(fe.Name, fe, time, isFull, timeString, encryption, compression, volNumber);
else if (m.Groups["type"].Value == CONTENT || m.Groups["type"].Value == CONTENT_SHORT)
return new ContentEntry(fe.Name, fe, time, isFull, timeString, encryption, compression, volNumber);
else
return null;
}
开发者ID:pacificIT,项目名称:Duplicati,代码行数:77,代码来源:FilenameStrategy.cs
示例17: UpdateMetadataError
private static void UpdateMetadataError(Duplicati.Server.Serialization.Interface.IBackup backup, Exception ex)
{
backup.Metadata["LastErrorDate"] = Library.Utility.Utility.SerializeDateTime(DateTime.UtcNow);
backup.Metadata["LastErrorMessage"] = ex.Message;
if (!backup.IsTemporary)
Program.DataConnection.SetMetadata(backup.Metadata, long.Parse(backup.ID), null);
System.Threading.Interlocked.Increment(ref Program.LastDataUpdateID);
Program.DataConnection.RegisterNotification(
NotificationType.Error,
backup.IsTemporary ?
"Error" : string.Format("Error while running {0}", backup.Name),
ex.Message,
ex,
backup.ID,
"backup:show-log",
(n, a) => {
return a.Where(x => x.BackupID == backup.ID).FirstOrDefault() ?? n;
}
);
}
开发者ID:rlugojr,项目名称:duplicati,代码行数:22,代码来源:Runner.cs
示例18: LocalizeTaskType
/// <summary>
/// Returns a localized name for a task type
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
public static string LocalizeTaskType(Duplicati.Server.Serialization.DuplicatiOperation type)
{
switch (type)
{
case Duplicati.Server.Serialization.DuplicatiOperation.Backup:
return Strings.TaskType.FullBackup;
case Duplicati.Server.Serialization.DuplicatiOperation.List:
return Strings.TaskType.IncrementalBackup;
case Duplicati.Server.Serialization.DuplicatiOperation.Remove:
return Strings.TaskType.ListActualFiles;
case Duplicati.Server.Serialization.DuplicatiOperation.Verify:
return Strings.TaskType.ListBackupEntries;
case Duplicati.Server.Serialization.DuplicatiOperation.Restore:
return Strings.TaskType.ListBackups;
default:
return type.ToString();
}
}
开发者ID:kztao,项目名称:duplicati,代码行数:23,代码来源:Program.cs
示例19: CreateMenuItem
protected override Duplicati.GUI.TrayIcon.IMenuItem CreateMenuItem (string text, Duplicati.GUI.TrayIcon.MenuIcons icon, Action callback, System.Collections.Generic.IList<Duplicati.GUI.TrayIcon.IMenuItem> subitems)
{
return new MenuItemWrapper(this, text, icon, callback, subitems);
}
开发者ID:AlexFRAN,项目名称:duplicati,代码行数:4,代码来源:RumpsRunner.cs
示例20: EnumerateFilesAndFolders
/// <summary>
/// Enumerates all files and folders in the snapshot
/// </summary>
/// <param name="filter">The filter to apply when evaluating files and folders</param>
/// <param name="callback">The callback to invoke with each found path</param>
public IEnumerable<string> EnumerateFilesAndFolders(Duplicati.Library.Utility.Utility.EnumerationFilterDelegate callback)
{
return m_entries.SelectMany(
s => Utility.Utility.EnumerateFileSystemEntries(s.Key, callback, this.ListFolders, this.ListFiles, this.GetAttributes)
);
}
开发者ID:lumic,项目名称:duplicati,代码行数:11,代码来源:LinuxSnapshot.cs
注:本文中的Duplicati类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论