/// <summary> /// Raises the UriChanged event and performs custom processing</summary> /// <param name="e">UriChangedEventArgs containing event data</param> protected override void OnUriChanged(UriChangedEventArgs e) { UpdateControlInfo(); base.OnUriChanged(e); }
private void SledDocumentUriChanged(object sender, UriChangedEventArgs e) { // Uri changed in a SledDocument so if we // were watching it we need to remove it. // This happens when documents are "save-as"'d var sd = sender as ISledDocument; KeyValuePair<ISledDocument, SledFileSystemWatcher>? sentinelWatcher = null; KeyValuePair<ISledDocument, SledFileSystemFileStats>? sentinelStats = null; // We do this ReferenceEqual checking because the Uri has changed // in the SledDocument and that makes the dictionary built-in // checks invalid (since they're using a comparer that uses the Uri // property for checking equality and obtaining a hash code). // Search for watcher foreach (var kv in m_dict) { if (!ReferenceEquals(kv.Key, sd)) continue; sentinelWatcher = kv; break; } // Search for stats foreach (var kv in m_dictFileStats) { if (!ReferenceEquals(kv.Key, sd)) continue; sentinelStats = kv; break; } // Remove file system watcher if (sentinelWatcher.HasValue) { sentinelWatcher.Value.Value.EnableRaisingEvents = false; sentinelWatcher.Value.Value.Changed -= WatcherChanged; sentinelWatcher.Value.Value.Dispose(); m_dict.Remove(sentinelWatcher.Value); } // Remove file system stats if (sentinelStats.HasValue) m_dictFileStats.Remove(sentinelStats.Value); }
private void SledDocumentUriChanged(object sender, UriChangedEventArgs e) { var sd = sender as ISledDocument; if (sd == null) return; var file = sd.SledProjectFile; if (file == null) return; // Update name & path since this is a project file file.Name = Path.GetFileName(sd.Uri.LocalPath); file.Path = SledUtil.GetRelativePath(sd.Uri.LocalPath, AssetDirectory); file.Uri = sd.Uri; }
protected virtual void OnUriChanged(UriChangedEventArgs e) { UriChanged.Raise(this, e); }
private void m_document_UriChanged(object sender, UriChangedEventArgs e) { UpdateControlInfo(m_gameDocumentRegistry.MasterDocument); }