Exemplo n.º 1
0
 void IStructuredSerializable.ReadContent( IStructuredReader sr )
 {
     sr.Xml.Read();
     sr.ReadInlineObjectStructuredElement( "PluginStatusCollection", PluginStatusCollection );
     sr.ReadInlineObjectStructuredElement( UriHistoryCollection.EntryName + "Collection", UriHistoryCollection );
     sr.GetService<ISharedDictionaryReader>( true ).ReadPluginsDataElement( "Plugins", this );
 }
Exemplo n.º 2
0
 void IStructuredSerializable.ReadContent(IStructuredReader sr)
 {
     sr.Xml.Read();
     sr.ReadInlineObjectStructuredElement("PluginStatusCollection", PluginStatusCollection);
     sr.ReadInlineObjectStructuredElement(UriHistoryCollection.EntryName + "Collection", UriHistoryCollection);
     sr.GetService <ISharedDictionaryReader>(true).ReadPluginsDataElement("Plugins", this);
 }
Exemplo n.º 3
0
        public IReadOnlyList <ISimpleErrorMessage> LoadUserConfig(IStructuredReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            IList <ReadElementObjectInfo> objs;

            using (var dr = _dic.RegisterReader(reader, MergeMode.ReplaceExistingTryMerge))
            {
                reader.ReadInlineObjectStructuredElement("User", _userConfiguration);
                objs = dr.ErrorCollector;
            }
            _userConfiguration.UriHistoryCollection.FireLoadedChangedEvents();
            IsUserConfigDirty = false;
            return(objs.ToReadOnlyList());
        }
Exemplo n.º 4
0
        public IReadOnlyList <ISimpleErrorMessage> LoadContext(IStructuredReader reader)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            IList <ReadElementObjectInfo> errors;

            using (ISharedDictionaryReader dr = _dic.RegisterReader(reader, MergeMode.None))
            {
                XmlReader r = reader.Xml;
                r.ReadStartElement("CKContext");
                reader.ReadInlineObjectStructuredElement("RequirementLayer", _reqLayer);
                dr.ReadPluginsDataElement("PluginData", _proxifiedContext);
                r.ReadEndElement();
                errors = dr.ErrorCollector;
            }
            return(errors.ToReadOnlyList());
        }
Exemplo n.º 5
0
        void IStructuredSerializable.ReadContent( IStructuredReader sr )
        {
            XmlReader r = sr.Xml;
            Debug.Assert( r.Name == "Keyboard" );

            Rename( r.GetAttribute( "Name" ) );
            r.ReadStartElement( "Keyboard" );

            sr.ReadInlineObjectStructuredElement( "RequirementLayer", _reqLayer );

            if( r.IsStartElement( "Modes" ) )
            {
                string currentMode = r.GetAttribute( "Current" );
                if( r.IsEmptyElement )  r.Read();
                else
                {
                    r.Read();

                    IKeyboardMode futureAvailableMode = Context.EmptyMode;
                    while( r.IsStartElement( "Mode" ) )
                    {
                        futureAvailableMode = futureAvailableMode.Add( Context.ObtainMode( r.ReadElementContentAsString() ) );
                    }
                    AvailableMode = futureAvailableMode;
                    CurrentMode = Context.ObtainMode( currentMode );
                    r.ReadEndElement(); // Modes;
                }
            }
            sr.ReadInlineObjectStructuredElement( "Zones", Zones );
            sr.ReadInlineObjectStructuredElement( "Layouts", Layouts );
        }
Exemplo n.º 6
0
        public IReadOnlyList<ISimpleErrorMessage> LoadSystemConfig( IStructuredReader reader )
        {
            if( reader == null ) throw new ArgumentNullException( "reader" );

            // Creates reader.
            IList<ReadElementObjectInfo> objs;
            using( var dr = _dic.RegisterReader( reader, MergeMode.ReplaceExistingTryMerge ) )
            {
                reader.ReadInlineObjectStructuredElement( "System", _systemConfiguration );                
                objs = dr.ErrorCollector;
            }
            _systemConfiguration.UriHistoryCollection.FireLoadedChangedEvents();
            IsSystemConfigDirty = false;
            return objs.ToReadOnlyList();
        }