Ejemplo n.º 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public UIPConfigSettings( )
        {
            //Init the hashtables
            _iLayoutManagerCollection = new HybridDictionary();
            _iViewManagerCollection = new HybridDictionary();
            _stateCollection = new HybridDictionary();
            _interceptorCollection = new HybridDictionary();
            _statePersistenceCollection = new HybridDictionary();

            _viewByNameCollection = new Hashtable();
            _stateKeyByNameCollection = new Hashtable();
            _controllerByNameCollection = new Hashtable();

            _navigatorCollection = new HybridDictionary();
            _globalSharedTransitions=new HybridDictionary();
            _hostedControlsCollection = new HybridDictionary();
            _isStateCacheEnabled = true;
            _defaultViewManager = null;
            _defaultState = null;
            _defaultStatePersistence = null;
            _allowBackButton = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns an instance of <see cref="IStatePersistence"/>
        /// for the given <see cref="UIProcess.StatePersistenceProviderSettings"/>.
        /// </summary>
        /// <param name="providerSettings">The settings for  state persistence.</param>
        /// <returns>The instance of IStatePersistence. It gets this from the internal cache, if possible.</returns>
        public static IStatePersistence Create( StatePersistenceProviderSettings providerSettings )
        {
            string statePersistenceKey = providerSettings.Type + "," + providerSettings.Assembly;
            IStatePersistence spp = (IStatePersistence)_statePersistenceCache[ statePersistenceKey ];
            if( spp == null )
            {
                try
                {
                    //  now create instance based on that type info
                    spp = (IStatePersistence)GenericFactory.Create( providerSettings );

                    //  pass in parameters to spp init method.  this is where spp's find data they need such as
                    //  connection strings, etc.
                    spp.Init(providerSettings.AdditionalAttributes);
                }
                catch ( Exception e )
                {
                    throw new Exception(string.Format("ExceptionCantCreateStatePersistenceProvider: {0} - {1}.",
                                                      providerSettings.Type, e.Message));
                }

                //  lock collection
                lock (_statePersistenceCache.SyncRoot)
                    _statePersistenceCache[statePersistenceKey] = spp;
            }

            //  return it
            return spp;
        }
Ejemplo n.º 3
0
        /*private void LoadWizards(XmlNode configNode, IFormatProvider formatProvider)
        {
            foreach (XmlNode wizardNode in configNode.SelectNodes( NodeWizardsXPath ) )
            {
                WizardSettings wizard = new WizardSettings(_defaultStatePersistence.Name,_defaultState.Name,wizardNode);
                NavigationGraphSettings navigationGraph = new NavigationGraphSettings(wizard.GetNavGraphXmlNode(formatProvider));
                _navigatorCollection.Add(navigationGraph.Name, navigationGraph);

            }
        }*/
        private void LoadViewManagementObjects(XmlNode configNode)
        {
            if (configNode.SelectSingleNode(NodeObjectTypesXPath) == null)
                return;

            //Get the configured IViewManager object types
            ObjectTypeSettings typedObject;
            foreach( XmlNode objectTypeNode in configNode.SelectSingleNode( NodeObjectTypesXPath ).ChildNodes )
            {
                switch( objectTypeNode.LocalName )
                {
                    case NodeILayoutManagerXPath :
                        typedObject = new ObjectTypeSettings( objectTypeNode );
                        _iLayoutManagerCollection.Add( typedObject.Name, typedObject );
                        break;
                    case NodeIViewManagerXPath:
                        typedObject = new ObjectTypeSettings( objectTypeNode );
                        _iViewManagerCollection.Add( typedObject.Name, typedObject );
                        if (IsDefault(objectTypeNode))
                            _defaultViewManager = typedObject;
                        break;
                    case NodeStateXPath:
                        typedObject = new ObjectTypeSettings( objectTypeNode );
                        _stateCollection.Add( typedObject.Name, typedObject );
                        if (IsDefault(objectTypeNode))
                            _defaultState = typedObject;
                        break;

                    case NodeCallInterceptorXpath:
                        typedObject = new ObjectTypeSettings(objectTypeNode);
                        _interceptorCollection.Add(typedObject.Name, typedObject);
                        break;

                    case NodePersistProviderXPath:
                        typedObject = new StatePersistenceProviderSettings( objectTypeNode );
                        _statePersistenceCollection.Add( typedObject.Name, typedObject );
                        if (IsDefault(objectTypeNode))
                            _defaultStatePersistence = (StatePersistenceProviderSettings)typedObject;
                        break;
                }
            }
        }