EventArgs for the ResolveNameEventHandler. This event is used by the serialization process to match a name to an object instance.
Inheritance: System.EventArgs
コード例 #1
0
 protected virtual void OnResolveName(ResolveNameEventArgs e)
 {
     if (_resolveNameHandler != null)
     {
         _resolveNameHandler(this, e);
     }
 }
コード例 #2
0
        private object RequestInstance(string name)
        {
            ResolveNameEventArgs args = new ResolveNameEventArgs(name);

            this.OnResolveName(args);
            return(args.Value);
        }
コード例 #3
0
        object IDesignerSerializationManager.GetInstance(string name)
        {
            object obj2 = null;

            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            this.CheckSession();
            if (this.instancesByName != null)
            {
                obj2 = this.instancesByName[name];
            }
            if (((obj2 == null) && this.PreserveNames) && (this.Container != null))
            {
                obj2 = this.Container.Components[name];
            }
            if (obj2 == null)
            {
                ResolveNameEventArgs e = new ResolveNameEventArgs(name);
                this.OnResolveName(e);
                obj2 = e.Value;
            }
            return(obj2);
        }
コード例 #4
0
 private void OnResolveName(object sender, ResolveNameEventArgs e)
 {
     using (CodeDomSerializerBase.TraceScope("RootCodeDomSerializer::OnResolveName"))
     {
         if (e.Value == null)
         {
             IDesignerSerializationManager manager = (IDesignerSerializationManager)sender;
             e.Value = this.DeserializeName(manager, e.Name, null);
         }
     }
 }
コード例 #5
0
		private object RequestInstance (string name)
		{
			ResolveNameEventArgs args = new ResolveNameEventArgs (name);
			this.OnResolveName (args);
			return args.Value;
		}
コード例 #6
0
		protected virtual void OnResolveName (ResolveNameEventArgs e)
		{
			if (_resolveNameHandler != null) {
				_resolveNameHandler (this, e);
			}
		}	
コード例 #7
0
 private void OnResolveName(object sender, ResolveNameEventArgs e)
 {
     using (CodeDomSerializerBase.TraceScope("RootCodeDomSerializer::OnResolveName"))
     {
         if (e.Value == null)
         {
             IDesignerSerializationManager manager = (IDesignerSerializationManager) sender;
             e.Value = this.DeserializeName(manager, e.Name, null);
         }
     }
 }
コード例 #8
0
		///     Retrieves an instance of a created object of the given name, or
		///     null if that object does not exist.
		object IDesignerSerializationManager.GetInstance(string name) 
		{
			object instance = null;
        
			if (name == null) 
			{
				throw new ArgumentNullException("name");
			}
        
			// Check our local nametable first
			//
			if (_instancesByName != null) 
			{
				instance = _instancesByName[name];
			}
        
			if (instance == null && _loader.LoaderHost != null) 
			{
				instance = _loader.LoaderHost.Container.Components[name];
			}
        
			if (instance == null && _resolveNameEventHandler != null) 
			{
				ResolveNameEventArgs e = new ResolveNameEventArgs(name);
				_resolveNameEventHandler(this, e);
				instance = e.Value;
			}
        
			return instance;
		}
コード例 #9
0
 /// <summary>Raises the <see cref="E:System.ComponentModel.Design.Serialization.IDesignerSerializationManager.ResolveName" /> event. </summary>
 /// <param name="e">A <see cref="T:System.ComponentModel.Design.Serialization.ResolveNameEventArgs" /> that contains the event data. </param>
 protected virtual void OnResolveName(ResolveNameEventArgs e)
 {
     this.resolveNameEventHandler?.Invoke(this, e);
 }
 object IDesignerSerializationManager.GetInstance(string name)
 {
     object obj2 = null;
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     this.CheckSession();
     if (this.instancesByName != null)
     {
         obj2 = this.instancesByName[name];
     }
     if (((obj2 == null) && this.PreserveNames) && (this.Container != null))
     {
         obj2 = this.Container.Components[name];
     }
     if (obj2 == null)
     {
         ResolveNameEventArgs e = new ResolveNameEventArgs(name);
         this.OnResolveName(e);
         obj2 = e.Value;
     }
     return obj2;
 }
コード例 #11
0
		protected virtual void OnResolveName(ResolveNameEventArgs e)
		{
			if (ResolveName != null) {
				ResolveName(this, e);
			}
		}
コード例 #12
0
 object IDesignerSerializationManager.GetInstance(string name)
 {
     object instance = null;
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (this._instancesByName != null)
     {
         instance = this._instancesByName[name];
     }
     if ((instance == null) && (this._loader.LoaderHost != null))
     {
         instance = this._loader.LoaderHost.Container.Components[name];
     }
     if ((instance == null) && (this.ResolveName != null))
     {
         ResolveNameEventArgs e = new ResolveNameEventArgs(name);
         this.ResolveName(this, e);
         instance = e.Value;
     }
     return instance;
 }
 void OnResolveName(object sender, ResolveNameEventArgs e)
 {
     if (this.resolveNameEventHandler != null)
         this.resolveNameEventHandler(this, e);
 }
 private void OnResolveName(object sender, ResolveNameEventArgs e)
 {
     if (!this._nameResolveGuard.ContainsKey(e.Name))
     {
         this._nameResolveGuard.Add(e.Name, true);
         try
         {
             IDesignerSerializationManager manager = (IDesignerSerializationManager) sender;
             if (this.ResolveName(manager, e.Name, false))
             {
                 e.Value = manager.GetInstance(e.Name);
             }
         }
         finally
         {
             this._nameResolveGuard.Remove(e.Name);
         }
     }
 }
コード例 #15
0
 protected virtual void OnResolveName(ResolveNameEventArgs e)
 {
     throw null;
 }