Exemple #1
0
 public XmlViewerVM(XmlViewerService service, CommandBindingCollection commandBindings, string path)
     : this(service, commandBindings, new BigworldXmlReader(path))
 {
     if (!UnifiedPath.IsInPackage(path))
     {
         this.SavePath      = path;
         _defaultSaveAsPath = path;
     }
     else
     {
         var gameClient = RepositoryManager.Instance.FindOwner(path);
         if (gameClient != null)
         {
             _defaultSaveAsPath = gameClient.GetCorrespondedModPath(path);
         }
     }
 }
Exemple #2
0
        private XmlViewerVM(XmlViewerService service, CommandBindingCollection commandBindings, BigworldXmlReader reader)
        {
            _dispatcher = Dispatcher.CurrentDispatcher;

            _service    = service;
            _encodeType = reader.EncodeType;

            var document = XDocument.Load(reader);

            document.TrimText();

            this.Content      = document.ToString();
            this.SavedContent = this.Content;

            commandBindings.Add(new CommandBinding(ApplicationCommands.Save, this.ExecuteSave, this.CanExecuteSave));
            commandBindings.Add(new CommandBinding(ApplicationCommands.SaveAs, this.ExecuteSaveAs));
        }
Exemple #3
0
 public XmlViewerVM(XmlViewerService service, CommandBindingCollection commandBindings, Stream stream)
     : this(service, commandBindings, new BigworldXmlReader(stream))
 {
 }