/// <summary> /// With Windows Explorer, open the local folder of a CmisSync synchronized folder. /// </summary> /// <param name="name">Name of the synchronized folder</param> public void OpenCmisSyncFolder(string name) { Config.SyncConfig.Folder folder = ConfigManager.CurrentConfig.getFolder(name); if (folder != null) { Utils.OpenFolder(folder.LocalPath); } else if (String.IsNullOrWhiteSpace(name)) { OpenCmisSyncFolder(); } else { Logger.Warn("Could not find requested config for \"" + name + "\""); } }
public void OpenCmisSyncFolder(string name) { Config.SyncConfig.Folder f = ConfigManager.CurrentConfig.getFolder(name); if (f != null) { Utils.OpenFolder(f.LocalPath); } else if (String.IsNullOrWhiteSpace(name)) { OpenCmisSyncFolder(); } else { Logger.Warn("Folder not found: " + name); } }
/// <summary> /// Opens the sync target folder for the repository with the given name. /// </summary> /// <param name="name">Name of the repository.</param> public void OpenCmisSyncFolder(string name) { var f = ConfigManager.CurrentConfig.GetRepoInfo(name); if (f != null) { Utils.OpenFolder(f.LocalPath); } else if (string.IsNullOrWhiteSpace(name)) { this.OpenCmisSyncFolder(); } else { Logger.Warn("Folder not found: " + name); } }
public void OpenCmisSyncFolder() { Utils.OpenFolder(ConfigManager.CurrentConfig.FoldersPath); }
/// <summary> /// With Windows Explorer, open the local folder of a CmisSync synchronized folder. /// </summary> /// <param name="name">Name of the synchronized folder</param> public void OpenCmisSyncFolder(string name) { Utils.OpenFolder(ConfigManager.GetFullPath(name)); }
public TransmissionMenuItem(FileTransmissionEvent e) : base(e.Type.ToString()) { Path = e.Path; Type = e.Type; TypeString = Type.ToString(); switch (Type) { case FileTransmissionType.DOWNLOAD_NEW_FILE: Image = new Image(UIHelpers.GetIcon("dataspacesync-downloading", 16)); TypeString = Properties_Resources.NotificationFileDownload; break; case FileTransmissionType.UPLOAD_NEW_FILE: Image = new Image(UIHelpers.GetIcon("dataspacesync-uploading", 16)); TypeString = Properties_Resources.NotificationFileUpload; break; case FileTransmissionType.DOWNLOAD_MODIFIED_FILE: TypeString = Properties_Resources.NotificationFileUpdateLocal; Image = new Image(UIHelpers.GetIcon("dataspacesync-updating", 16)); break; case FileTransmissionType.UPLOAD_MODIFIED_FILE: TypeString = Properties_Resources.NotificationFileUpdateRemote; Image = new Image(UIHelpers.GetIcon("dataspacesync-updating", 16)); break; } double percent = (e.Status.Percent == null)? 0:(double)e.Status.Percent; Label text = this.Child as Label; if (text != null) { text.Text = String.Format("{0}: {1} ({2})", TypeString, System.IO.Path.GetFileName(Path), CmisSync.Lib.Utils.FormatPercent(percent)); } if (ConfigManager.CurrentConfig.Notifications) { NotificationUtils.NotifyAsync(String.Format("{0}: {1}", TypeString, System.IO.Path.GetFileName(Path)), Path); } e.TransmissionStatus += delegate(object sender, TransmissionProgressEventArgs status) { TimeSpan diff = DateTime.Now - updateTime; if (diff.Seconds < 1) { return; } updateTime = DateTime.Now; percent = (status.Percent != null)? (double)status.Percent: 0; long?bitsPerSecond = status.BitsPerSecond; if (status.Percent != null && bitsPerSecond != null && text != null) { Application.Invoke(delegate { text.Text = String.Format("{0}: {1} ({2} {3})", TypeString, System.IO.Path.GetFileName(Path), CmisSync.Lib.Utils.FormatPercent(percent), CmisSync.Lib.Utils.FormatBandwidth((long)bitsPerSecond)); }); } }; this.Activated += delegate(object sender, EventArgs args) { Utils.OpenFolder(System.IO.Directory.GetParent(Path).FullName); }; Sensitive = true; }
void TransmissionEventMenuItem_Click(object sender, EventArgs e) { Utils.OpenFolder(System.IO.Directory.GetParent(Path).FullName); }