public HeaderedView Create(ViewState state)
        {
            var converter = new TailViewToStateConverter();
            var converted = converter.Convert(state.State);

            var file = converted.FileName;
            var viewModel = CreateView(new FileInfo(file));

            var restorer = (IPersistentView)viewModel;
            restorer.Restore(state);
            return new HeaderedView(new FileHeader(new FileInfo(file)), viewModel);
        }
 public void Restore(ViewState state)
 {
     _tailViewStateRestorer.Restore(_tailView, state.State);
 }
Exemple #3
0
        void IPersistentView.Restore(ViewState state)
        {
            //When this is called, we assume that FileInfo has not been set!
            _persister.Restore(state);

            //this controller responsible for loading and persisting user search stuff as the user changes stuff
            _stateMonitor.Disposable = _tailViewStateControllerFactory.Create(this,false);
        }
 private IEnumerable<ViewState> GetChildrenState(XElement element)
 {
     return element.Elements(XmlStructure.ViewNode.Children)
         .SelectMany(shells => shells.Elements(XmlStructure.ViewNode.ViewState))
         .Select(viewStateElement =>
         {
             var key = viewStateElement.AttributeOrThrow(XmlStructure.ViewNode.Key);
             var version = viewStateElement.AttributeOrThrow(XmlStructure.ViewNode.Version).ParseInt().Value;
             var state = viewStateElement.Value;
             var viewstate = new ViewState(key, new State(version, state));
             return viewstate;
         });
 }