Beispiel #1
0
        public void addView(IIwView view)
        {
            if ( view == null )
            {
                Debug.LogError ( "Error in " + this + " View can't be null." );
                return;
            }

            if ( hasView ( view.name ) )
            {
                Debug.LogError ( "Error in " + this + " View '" + view.name + "' already registered." );
                return;
            }

            lock ( _viewList )
            {
                _viewList [view.name] = view;
                view.dispatcher = _dispatcher;

                if ( view.eventsToHand != null && view.eventsToHand.Count > 0 )
                {
                    foreach ( string eventToHand in view.eventsToHand )
                    {
                        if ( _viewsForNotify.ContainsKey ( eventToHand ) )
                        {
                            _viewsForNotify[eventToHand].Add ( view );
                        }
                        else
                        {
                            List<IIwView> viewListsByEvent = new List<IIwView> ();
                            viewListsByEvent.Add ( view );
                            _viewsForNotify[eventToHand] = viewListsByEvent;
                        }
                    }
                }

                view.initialize ();
            }
        }
Beispiel #2
0
 public void addView( IIwView view )
 {
     System.Diagnostics.Debug.Assert (_viewsMgr == null, "View Manager not exists!!!");
     _viewsMgr.addView (view);
 }