当前位置: 首页>>代码示例>>C#>>正文


C# Duplicati类代码示例

本文整理汇总了C#中Duplicati的典型用法代码示例。如果您正苦于以下问题:C# Duplicati类的具体用法?C# Duplicati怎么用?C# Duplicati使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Duplicati类属于命名空间,在下文中一共展示了Duplicati类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的Duplicati类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。