private void ProjectItemNameChanged(object sender, NameChangedEventArgs e) { ISharePointProjectItem projectItem = (ISharePointProjectItem)sender; string message = String.Format("The name of the {0} item changed to: {1}", e.OldName, projectItem.Name); projectService.Logger.WriteLine(message, LogCategory.Message); }
// The name of a project was changed. void projectService_ProjectNameChanged(object sender, NameChangedEventArgs e) { ISharePointProject project = (ISharePointProject)sender; string message = String.Format("The project named {0} was changed to {1}.", e.OldName, project.Name); project.ProjectService.Logger.WriteLine(message, LogCategory.Message); }
protected virtual void OnNameChanged(NameChangedEventArgs e) { if (NameChanged != null) { NameChanged(this, e); } }
public void ReverseScriptNameChange(object e) { NameChangedEventArgs eArgs = e as NameChangedEventArgs; if (eArgs == null) { return; } if (ignoreThisNewScriptName == eArgs.NewName) { ignoreThisNewScriptName = null; return; } NWN2GameScript script = eArgs.Item as NWN2GameScript; if (script != null) { Thread.Sleep(1000); try { ignoreThisNewScriptName = eArgs.OldName; script.Name = eArgs.OldName; } catch (Exception) { } } }
private void PlanGrid_NameChanged(object sender, NameChangedEventArgs e) { if (sender is FloorPlanGrid floorPlanGrid) { TabItem targetTabItem = tabControl.Items.OfType <TabItem>().FirstOrDefault(x => x.Content is FloorPlanGrid tab && tab.GetFloorPlanGuid() == floorPlanGrid.GetFloorPlanGuid()); if (targetTabItem != null && targetTabItem.Header is StackPanel headerStack) { TextBlock headerText = headerStack.Children.OfType <TextBlock>().FirstOrDefault(); if (headerText != null) { headerText.Text = e.NewName; } } } else if (sender is RoomPlanGrid roomPlanGrid) { TabItem targetTabItem = tabControl.Items.OfType <TabItem>().FirstOrDefault(x => x.Content is RoomPlanGrid tab && tab.GetRoomPlanGuid() == roomPlanGrid.GetRoomPlanGuid()); if (targetTabItem != null && targetTabItem.Header is StackPanel headerStack) { TextBlock headerText = headerStack.Children.OfType <TextBlock>().FirstOrDefault(); if (headerText != null) { headerText.Text = e.NewName; } } } }
public void InvokeNameChangedEvent(NameChangedEventArgs e) { var handler = NameChangedEvent; if (handler != null) { handler(this, e); } }
protected virtual void OnScriptNameChanged(object sender, NameChangedEventArgs e) { NameChangedEventHandler handler = ScriptNameChanged; if (handler != null) { handler(sender, e); } }
protected virtual void OnConversationNameChanged(object sender, NameChangedEventArgs e) { NameChangedEventHandler handler = ConversationNameChanged; if (handler != null) { handler(sender, e); } }
private void MetadataOnNameChanged(object sender, NameChangedEventArgs e) { if (string.IsNullOrEmpty(e.NewText)) { throw new ValidationException("Name Cannot be Empty"); } if (AugmentedCollection.Count(q => q.Name == e.NewText.Trim()) > 1) { throw new ValidationException("Duplicate Name Found"); } }
void ElementNameChanged(object sender, NameChangedEventArgs e) { if (string.IsNullOrEmpty(e.Element.Name)) { throw new ArgumentException("Invalid object name"); } m_allElements.Remove(e.OldName); m_elements[e.Element.ElemType].Remove(e.OldName); m_allElements.Add(e.Element.Name, e.Element); m_elements[e.Element.ElemType].Add(e.Element.Name, e.Element); if (ElementRenamed != null) ElementRenamed(this, e); }
protected void EhChild_NameChanged(object sender, NameChangedEventArgs e) { // we remove the old value from the hash and store it under the new value GraphDocument graph = m_GraphsByName[e.OldName]; if (graph != null) { if (m_GraphsByName.ContainsKey(e.NewName)) { throw new ApplicationException(string.Format("The GraphDocumentCollection contains already a Graph named {0}, renaming the old graph {1} fails.", e.NewName, e.OldName)); } m_GraphsByName.Remove(e.OldName); m_GraphsByName[e.NewName] = graph; this.OnSelfChanged(ChangedEventArgs.IfItemRenamed); } }
private void Property_NameChanged(object sender, NameChangedEventArgs e) { if (!_properties.ContainsKey(e.OldName)) { throw new ArgumentException("The collection does not contain a property keyed by the old name: '" + e.OldName + "'"); } if (_properties.ContainsKey(e.NewName)) { throw new ArgumentException("There is an existing property with the new name '" + e.NewName + "' in the collection"); } if (_reservedNames.Contains(e.NewName)) { throw new ArgumentException("The requested name is reserved: '" + e.NewName + "'"); } Property item = _properties[e.OldName]; _properties.Remove(e.OldName); _properties[e.NewName] = item; OnPropertyRenamed(e); OnModified(EventArgs.Empty); }
private void OnNameContentAttributeNameChanged(object sender, NameChangedEventArgs e) { NotifyChanged(new MetadataEventArgs(this)); }
protected virtual void OnNameChanged(NameChangedEventArgs e) { // If NameChange == null then do nothing NameChanged?.Invoke(this, e); }
public void InvokeNameChangedEvent(NameChangedEventArgs e) { var handler = NameChangedEvent; if (handler != null) handler(this, e); }
void Elements_ElementRenamed(object sender, NameChangedEventArgs e) { string oldName = e.OldName; string newName = e.Element.Name; RenamedNode(oldName, newName); if (ElementsUpdated != null) ElementsUpdated(); }
public event EventHandler OnNameChanged(object sender, NameChangedEventArgs e); = delegate { };
private void FloorPlan_FloorNameChanged(object sender, NameChangedEventArgs e) { OnFloorNameChanged(e); }
static void OnNameChangeConcat(object sender, NameChangedEventArgs args) { Console.WriteLine($"Concat {args.ExistingName}{args.NewName}"); }
private void Project_NameChanged(object aSender, NameChangedEventArgs aEventArgs) { UpdateTitle(); }
private void model_OnNamedChangedEvent(object sender, NameChangedEventArgs e) { textbox.text = e.Name; }
protected virtual void OnRoomNameChanged(NameChangedEventArgs e) { RoomNameChanged?.Invoke(this, e); }
/// <summary> /// Evénement lorsqu'une classe est modifiée /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void _frmEditClasse_Changed(object sender, NameChangedEventArgs e) { // Maintenement on renomme le répertoire physiquement string _srcDir = m_applClass.RootDir + "\\" + m_applClass.Param.ExportDirectory + "\\" + e.OldName; string _destDir = m_applClass.RootDir + "\\" + m_applClass.Param.ExportDirectory + "\\" + e.NewName; if (_srcDir.Equals(_destDir)) { return; } else { if (Directory.Exists(_srcDir)) { Directory.Move(_srcDir, _destDir); } } }
private static void DoSomthingWhenEventFires(object sender, NameChangedEventArgs args) { Console.WriteLine(String.Format("The MyOtherName Property was changed from '{0}' to '{1}'", args.ExistingName, args.NewName)); }
protected virtual void OnPropertyRenamed(NameChangedEventArgs e) { PropertyRenamed(this, e); }
static void OnNameChanged(object sender, NameChangedEventArgs args) { Console.WriteLine($"Name of book changing from {args.CurrentName} to {args.NewName}"); }
public void OnDispatcherNameChanged(object sender, NameChangedEventArgs e) => Console.WriteLine($"Dispatcher's name changed to {e.Name}.");
static void OnNameChange(object sender, NameChangedEventArgs args) { Console.WriteLine($"Grade book changing name from {args.ExistingName} to {args.NewName}"); }
protected virtual void OnNameChanged (NameChangedEventArgs e) { if (NameChanged != null) { NameChanged(this, e); } }
private void Vm_RoomNameChanged(object sender, NameChangedEventArgs e) { OnRoomNameChanged(e); }
protected virtual void OnFloorNameChanged(NameChangedEventArgs e) { FloorNameChanged?.Invoke(this, e); }
void Elements_ElementRenamed(object sender, NameChangedEventArgs e) { string oldName = e.OldName; string newName = e.Element.Name; RenamedNode(this, new RenamedNodeEventArgs { OldName = oldName, NewName = newName }); if (ElementsUpdated != null) ElementsUpdated(this, new EventArgs()); }
private void NameChangedCallback(object state, bool timedOut) { SafeCollabData eventData = null; int errorCode = 0; Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "NameChangedCallback() called."); while (true){ NameChangedEventArgs nameChangedArgs = null; // // Get the event data for the fired event // try{ lock (LockNameChangedEvent){ if (m_safeNameChangedEvent.IsInvalid) return; errorCode = UnsafeCollabNativeMethods.PeerCollabGetEventData(m_safeNameChangedEvent, out eventData); } if (errorCode == UnsafeCollabReturnCodes.PEER_S_NO_EVENT_DATA) break; else if (errorCode != 0){ Logging.P2PTraceSource.TraceEvent(TraceEventType.Error, 0, "PeerCollabGetEventData returned with errorcode {0}", errorCode); throw PeerToPeerException.CreateFromHr(SR.GetString(SR.Collab_GetNameChangedDataFailed), errorCode); } PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), typeof(PEER_COLLAB_EVENT_DATA)); if (ped.eventType == PeerCollabEventType.EndPointChanged){ PEER_EVENT_ENDPOINT_CHANGED_DATA endpointData = ped.endpointChangedData; PeerContact peerContact = null; PeerEndPoint peerEndPoint = null; string newName = null; if (endpointData.pContact != IntPtr.Zero){ PEER_CONTACT pc = (PEER_CONTACT)Marshal.PtrToStructure(endpointData.pContact, typeof(PEER_CONTACT)); peerContact = CollaborationHelperFunctions.ConvertPEER_CONTACTToPeerContact(pc); } if (endpointData.pEndPoint != IntPtr.Zero){ PEER_ENDPOINT pe = (PEER_ENDPOINT)Marshal.PtrToStructure(endpointData.pEndPoint, typeof(PEER_ENDPOINT)); peerEndPoint = CollaborationHelperFunctions.ConvertPEER_ENDPOINTToPeerEndPoint(pe); newName = peerEndPoint.Name; } nameChangedArgs = new NameChangedEventArgs(peerEndPoint, peerContact, newName); } } finally{ if(eventData != null) eventData.Dispose(); } // // Fire the callback with the marshalled event args data // EventHandler<NameChangedEventArgs> handlerCopy = m_nameChanged; if ((nameChangedArgs != null) && (handlerCopy != null)){ if (SynchronizingObject != null && SynchronizingObject.InvokeRequired) SynchronizingObject.BeginInvoke(handlerCopy, new object[] { this, nameChangedArgs }); else handlerCopy(this, nameChangedArgs); Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Fired the name changed event callback."); } } Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Leaving NameChangedCallback()."); }
/// <summary> /// Evénement lorsqu'une classe est modifiée /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void _frmEditClasse_Changed(object sender, NameChangedEventArgs e) { foreach (IElement _element in p_SessionBase.Content.ListElement) { _element.Class = e.NewName; // Pour chaque photo, on met à jour le nom de la Classe foreach (FilePhoto _photo in _element.Photos) { _photo.ClassName = e.NewName; } } // Maintenement on renomme le répertoire physiquement string _srcDir = p_applClass.RootDir + "\\" + p_applClass.Param.ExportDirectory + "\\" + e.OldName; string _destDir = p_applClass.RootDir + "\\" + p_applClass.Param.ExportDirectory + "\\" + e.NewName; if (Directory.Exists(_srcDir) && _srcDir != _destDir) { Directory.Move(_srcDir, _destDir); } this.ClearListe(); this.ChargeListe(p_SessionBase.Content.ListElement); this.InitNavigation(); this.actualiseCompteurs(); }
private void ProjectOverview_ProjectNameChanged(object sender, NameChangedEventArgs e) { OnProjectNameChanged(e); }
static void OnNameChanged(object sender, NameChangedEventArgs args) { }
void OnNameChanged(Object o, NameChangedEventArgs args) { Console.WriteLine("Grade book changing from {0} to {1}", args.ExistingName, args.NewName); }
private static void NameChangedCallback(object state, bool timedOut) { SafeCollabData eventData = null; int errorCode = 0; Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "NameChangedCallback() called."); while (true){ NameChangedEventArgs nameChangedArgs = null; // // Get the event data for the fired event // try{ lock (LockNameChangedEvent) { if (s_safeNameChangedEvent.IsInvalid) return; errorCode = UnsafeCollabNativeMethods.PeerCollabGetEventData(s_safeNameChangedEvent, out eventData); } if (errorCode == UnsafeCollabReturnCodes.PEER_S_NO_EVENT_DATA) break; else if (errorCode != 0){ Logging.P2PTraceSource.TraceEvent(TraceEventType.Error, 0, "PeerCollabGetEventData returned with errorcode {0}", errorCode); throw PeerToPeerException.CreateFromHr(SR.GetString(SR.Collab_GetNameChangedDataFailed), errorCode); } PEER_COLLAB_EVENT_DATA ped = (PEER_COLLAB_EVENT_DATA)Marshal.PtrToStructure(eventData.DangerousGetHandle(), typeof(PEER_COLLAB_EVENT_DATA)); if (ped.eventType == PeerCollabEventType.MyEndPointChanged){ if (ped.endpointChangedData.pEndPoint != IntPtr.Zero){ // // This means its an endpoint on my contact which is not on the local machine // so we dont care // return; } string newName = PeerCollaboration.LocalEndPointName; nameChangedArgs = new NameChangedEventArgs( null, null, newName); } } finally{ if (eventData != null) eventData.Dispose(); } // // Fire the callback with the marshalled event args data // EventHandler<NameChangedEventArgs> handlerCopy = s_nameChanged; if ((nameChangedArgs != null) && (handlerCopy != null)){ if (SynchronizingObject != null && SynchronizingObject.InvokeRequired) SynchronizingObject.BeginInvoke(handlerCopy, new object[] { null, nameChangedArgs }); else handlerCopy(null, nameChangedArgs); Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Fired the name changed event callback."); } } Logging.P2PTraceSource.TraceEvent(TraceEventType.Information, 0, "Leaving NameChangedCallback()."); }
static void WhenNameChanged(object sender, NameChangedEventArgs args) { ListTests.wasNameChanged = true; }