コード例 #1
0
        public LoadDataSetViewModel(IMessageManager messageManager, IParsingService parsingService)
        {
            this._messageManager = messageManager;
            this._parsingService = parsingService;

            this.DisplayName = "SharpSentinel - open data set";

            this.SelectFolderCommand = FluidCommand.Sync(this.SelectFolder);

            this.CancelCommand      = FluidCommand.Sync(() => this.TryClose(false));
            this.LoadDataSetCommand = FluidCommand.Async(this.LoadDataSet).CanExecute(this.CanLoadDataSet);
        }
コード例 #2
0
        public ShellViewModel(IWindowManager windowManager)
        {
            this._windowManager = windowManager;

            this.DisplayName = "SharpSentinel - Data Viewer";

            this.LoadDataSetCommand  = FluidCommand.Sync(this.OpenDataSet);
            this.CloseDataSetCommand = FluidCommand.Sync(this.ClostDataSet);
            this.OpenSettingsCommand = FluidCommand.Sync(this.OpenSettings);
            this.OpenAboutCommand    = FluidCommand.Sync(this.OpenAbout);

            this.FileTreeViewModel = IoC.Get <FileTreeViewModel>();
        }
コード例 #3
0
        public FileTreeItem(FileInfo fileInfo, object data = null, string toolTip = "")
            : base(fileInfo.Name, FluidCommand.Sync(() => Process.Start(fileInfo.FullName)), toolTip: toolTip)
        {
            this.FileInfo = fileInfo;

            this.SetIconByFileExtension(fileInfo.Extension);

            if (data == null)
            {
                return;
            }

            this.Data = data;

            if (this.Data is IFile file)
            {
                var fileViewModel = IoC.Get <FileTreeItemDetailViewModel>();
                fileViewModel.Initialize(file.File);
                this.DetailPages.Add(fileViewModel);
            }

            if (this.Data is IXmlFile xmlFile)
            {
                var xmlViewModel = IoC.Get <XmlTreeItemDetailViewModel>();
                xmlViewModel.Intialize(xmlFile.RawXml);
                this.DetailPages.Add(xmlViewModel);
            }

            if (this.Data is IHtmlFile htmlFile)
            {
                var htmlViewModel = IoC.Get <HtmlTreeItemDetailViewModel>();
                htmlViewModel.Initialize(htmlFile.HtmlText);
                this.DetailPages.Add(htmlViewModel);
            }

            if (this.Data is IImageFile imageFile)
            {
                var imageViewModel = IoC.Get <ImageTreeItemDetailViewModel>();
                imageViewModel.Initialize(imageFile.File.FullName);
                this.DetailPages.Add(imageViewModel);
            }

            if (this.Data is Manifest manifest)
            {
                var metaDataViewModel = IoC.Get <MetaDataTreeItemDetailViewModel>();
                metaDataViewModel.Initialize(manifest.MetaData);
                this.DetailPages.Add(metaDataViewModel);
            }
        }
コード例 #4
0
 public FileTreeItemDetailViewModel()
     : base(1, PackIconModernKind.Page)
 {
     this.OpenLocationCommand = FluidCommand.Sync(() => Process.Start(this.File.DirectoryName));
     this.OpenFileCommand     = FluidCommand.Sync(() => Process.Start(this.File.FullName));
 }
コード例 #5
0
 public DirectoryTreeItem(DirectoryInfo directoryInfo)
     : base(directoryInfo.Name, FluidCommand.Sync(() => Process.Start(directoryInfo.FullName)), PackIconModernKind.Folder)
 {
     this.Children      = new BindableCollection <TreeItem>();
     this.DirectoryInfo = directoryInfo;
 }
コード例 #6
0
 public XmlTreeItemDetailViewModel()
     : base(2, PackIconModernKind.PageXml)
 {
     this.LoadEntireFileCommand = FluidCommand.Sync(this.LoadEntireFile);
 }