コード例 #1
0
ファイル: CustomAction.cs プロジェクト: Helen1987/edu
 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);
 }
コード例 #2
0
        // 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);
        }
コード例 #3
0
ファイル: Layer.cs プロジェクト: Jorch72/CS-Treefrog
 protected virtual void OnNameChanged(NameChangedEventArgs e)
 {
     if (NameChanged != null)
     {
         NameChanged(this, e);
     }
 }
コード例 #4
0
        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) { }
            }
        }
コード例 #5
0
        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;
                    }
                }
            }
        }
コード例 #6
0
ファイル: CustomAction.cs プロジェクト: lightman2/skiaming
        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);
        }
コード例 #7
0
ファイル: Folder.cs プロジェクト: poxet/sizeexplorer
        public void InvokeNameChangedEvent(NameChangedEventArgs e)
        {
            var handler = NameChangedEvent;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #8
0
        protected virtual void OnScriptNameChanged(object sender, NameChangedEventArgs e)
        {
            NameChangedEventHandler handler = ScriptNameChanged;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
コード例 #9
0
        protected virtual void OnConversationNameChanged(object sender, NameChangedEventArgs e)
        {
            NameChangedEventHandler handler = ConversationNameChanged;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
コード例 #10
0
        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");
            }
        }
コード例 #11
0
ファイル: Elements.cs プロジェクト: JatinR/quest
        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);
        }
コード例 #12
0
        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);
            }
        }
コード例 #13
0
        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);
        }
コード例 #14
0
 private void OnNameContentAttributeNameChanged(object sender, NameChangedEventArgs e)
 {
     NotifyChanged(new MetadataEventArgs(this));
 }
コード例 #15
0
 protected virtual void OnNameChanged(NameChangedEventArgs e)
 {
     // If NameChange == null then do nothing
     NameChanged?.Invoke(this, e);
 }
コード例 #16
0
ファイル: Folder.cs プロジェクト: poxet/tharga-sizeexplorer
 public void InvokeNameChangedEvent(NameChangedEventArgs e)
 {
     var handler = NameChangedEvent;
     if (handler != null)
         handler(this, e);
 }
コード例 #17
0
ファイル: EditorController.cs プロジェクト: Pertex/Quest
        void Elements_ElementRenamed(object sender, NameChangedEventArgs e)
        {
            string oldName = e.OldName;
            string newName = e.Element.Name;

            RenamedNode(oldName, newName);
            if (ElementsUpdated != null) ElementsUpdated();
        }
コード例 #18
0
 public event EventHandler OnNameChanged(object sender, NameChangedEventArgs e); = delegate { };
コード例 #19
0
 private void FloorPlan_FloorNameChanged(object sender, NameChangedEventArgs e)
 {
     OnFloorNameChanged(e);
 }
コード例 #20
0
 static void OnNameChangeConcat(object sender, NameChangedEventArgs args)
 {
     Console.WriteLine($"Concat {args.ExistingName}{args.NewName}");
 }
コード例 #21
0
 private void Project_NameChanged(object aSender, NameChangedEventArgs aEventArgs)
 {
     UpdateTitle();
 }
コード例 #22
0
 private void model_OnNamedChangedEvent(object sender, NameChangedEventArgs e)
 {
     textbox.text = e.Name;
 }
コード例 #23
0
 protected virtual void OnRoomNameChanged(NameChangedEventArgs e)
 {
     RoomNameChanged?.Invoke(this, e);
 }
コード例 #24
0
ファイル: frmEdit.cs プロジェクト: StephOfPixVert/ShootingLab
 /// <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); }
     }
 }
コード例 #25
0
 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));
 }
コード例 #26
0
 protected virtual void OnPropertyRenamed(NameChangedEventArgs e)
 {
     PropertyRenamed(this, e);
 }
コード例 #27
0
 static void OnNameChanged(object sender, NameChangedEventArgs args)
 {
     Console.WriteLine($"Name of book changing from {args.CurrentName} to {args.NewName}");
 }
コード例 #28
0
ファイル: Handler.cs プロジェクト: AndrewTheM/OOP
 public void OnDispatcherNameChanged(object sender, NameChangedEventArgs e)
 => Console.WriteLine($"Dispatcher's name changed to {e.Name}.");
コード例 #29
0
 static void OnNameChange(object sender, NameChangedEventArgs args)
 {
     Console.WriteLine($"Grade book changing name from {args.ExistingName} to {args.NewName}");
 }
コード例 #30
0
ファイル: Layer.cs プロジェクト: Elof3/Treefrog
 protected virtual void OnNameChanged (NameChangedEventArgs e)
 {
     if (NameChanged != null) {
         NameChanged(this, e);
     }
 }
コード例 #31
0
 private void Vm_RoomNameChanged(object sender, NameChangedEventArgs e)
 {
     OnRoomNameChanged(e);
 }
コード例 #32
0
 protected virtual void OnFloorNameChanged(NameChangedEventArgs e)
 {
     FloorNameChanged?.Invoke(this, e);
 }
コード例 #33
0
ファイル: EditorController.cs プロジェクト: hyrmedia/quest
        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());
        }
コード例 #34
0
        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().");
        }
コード例 #35
0
 /// <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();
 }
コード例 #36
0
 private void ProjectOverview_ProjectNameChanged(object sender, NameChangedEventArgs e)
 {
     OnProjectNameChanged(e);
 }
コード例 #37
0
 static void OnNameChanged(object sender, NameChangedEventArgs args)
 {
 }
コード例 #38
0
 void OnNameChanged(Object o, NameChangedEventArgs args)
 {
     Console.WriteLine("Grade book changing from {0} to {1}", args.ExistingName, args.NewName);
 }
コード例 #39
0
        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().");
        }
コード例 #40
0
ファイル: ListTests.cs プロジェクト: jamesthe500/ListMaker
 static void WhenNameChanged(object sender, NameChangedEventArgs args)
 {
     ListTests.wasNameChanged = true;
 }