Newer
Older
/*
* This file is part of VECTO.
*
* Copyright © 2012-2019 European Union
*
* Developed by Graz University of Technology,
* Institute of Internal Combustion Engines and Thermodynamics,
* Institute of Technical Informatics
*
* VECTO is licensed under the EUPL, Version 1.1 or - as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use VECTO except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/community/eupl/og_page/eupl
*
* Unless required by applicable law or agreed to in writing, VECTO
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*
* Authors:
* Stefan Hausberger, hausberger@ivt.tugraz.at, IVT, Graz University of Technology
* Christian Kreiner, christian.kreiner@tugraz.at, ITI, Graz University of Technology
* Michael Krisper, michael.krisper@tugraz.at, ITI, Graz University of Technology
* Raphael Luz, luz@ivt.tugraz.at, IVT, Graz University of Technology
* Markus Quaritsch, markus.quaritsch@tugraz.at, IVT, Graz University of Technology
* Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology
*/
using System.Windows;
using HashingTool.ViewModel.UserControl;
namespace HashingTool.Views
{
/// <summary>
/// Interaction logic for VectoXMLFileSelector.xaml
/// </summary>

Markus QUARITSCH
committed
public partial class VectoXMLFileSelector

Markus QUARITSCH
committed
public static readonly DependencyProperty XMLFileProperty = DependencyProperty.Register("XMLFile",
typeof(XMLFileSelector),
typeof(VectoXMLFileSelector));
public VectoXMLFileSelector()
{
InitializeComponent();
(Content as FrameworkElement).DataContext = this;
}

Markus QUARITSCH
committed
public XMLFileSelector XMLFile
get => (XMLFileSelector)GetValue(XMLFileProperty);
set => SetValue(XMLFileProperty, value);
private void btnDetails_Click(object sender, RoutedEventArgs e)
{
var dialog = new XMLValidationErrorsDialog();
dialog.XMLErrors = XMLFile.XMLValidationErrors;

Markus QUARITSCH
committed
dialog.ErrorCount = XMLFile.XMLValidationErrors.Count;
private void XMLFileBrowser_Drop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop)) {
var files = (string[])e.Data.GetData(DataFormats.FileDrop);
XMLFile.SetXMLFileCommnd.Execute(files?[0]);
}
}
private void XMLFileBrowser_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Handled = true;
}