protected virtual void OnResolveName(ResolveNameEventArgs e) { if (_resolveNameHandler != null) { _resolveNameHandler(this, e); } }
private object RequestInstance(string name) { ResolveNameEventArgs args = new ResolveNameEventArgs(name); this.OnResolveName(args); return(args.Value); }
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); }
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); } } }
private object RequestInstance (string name) { ResolveNameEventArgs args = new ResolveNameEventArgs (name); this.OnResolveName (args); return args.Value; }
protected virtual void OnResolveName (ResolveNameEventArgs e) { if (_resolveNameHandler != null) { _resolveNameHandler (this, e); } }
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); } } }
/// 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; }
/// <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; }
protected virtual void OnResolveName(ResolveNameEventArgs e) { if (ResolveName != null) { ResolveName(this, e); } }
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); } } }
protected virtual void OnResolveName(ResolveNameEventArgs e) { throw null; }