public static ProxyFactory GetInstance( String Context ) { ProxyFactory factory = null; try { factory = ProxyFactory.InstanceMap[ Context ]; } catch ( Exception ) { factory = new ProxyFactory( Context ); ProxyFactory.InstanceMap.Add( Context, factory ); } return factory; }
public virtual IFacade Initialize( Dictionary<String, Object> initProperties ) { if( this.Initialized ) return this; this.Initialized = true; #if DEBUG Debug.WriteLine( this + ".Initialize();\n\tName: " + this.Name + ";\n\tContext: " + this.Context + "\n---" ); #endif // store the init Properties this.initProperties = initProperties; // get the core components into the application context this.notifier = Notifier.getInstance( this.Context ); this.proxyFactory = ProxyFactory.GetInstance( this.Context ); this.mediatorFactory = MediatorFactory.GetInstance( this.Context ); // lookup for possible NotificationCommandInterests, and add them to the notifier Instance NotificationAttributeParser.GetInstance().ParseCommandInterestAttributes( this.Context ); // initialize the core components of the framework ( this.notifier as Notifier ).Initialize(); this.proxyFactory.Initialize(); this.mediatorFactory.Initialize(); // after looking up for interests add them to the notifier add Notification interests to the Notifier object this.Add( this.NotificationListenerList ); return this; }