aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.DAL.Local/DB/CONFIGURATION.cs
blob: bbefb6dff5cb6296edeb74279b59994bad966ce3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Tango.DAL.Local.DB
{
    using System;
    using System.Collections.Generic;
    
    public partial class CONFIGURATION
    {
        public long ID { get; set; }
        public string GUID { get; set; }
        public System.DateTime LAST_UPDATED { get; set; }
        public string NAME { get; set; }
        public System.DateTime CREATION_DATE { get; set; }
        public string APPLICATION_VERSION_GUID { get; set; }
        public string APPLICATION_OS_VERSION_GUID { get; set; }
        public string APPLICATION_FIRMWARE_VERSION_GUID { get; set; }
        public string APPLICATION_DISPLAY_PANEL_VERSION_GUID { get; set; }
        public string EMBEDDED_FIRMWARE_VERSION_GUID { get; set; }
        public string EMBEDDED_SOFTWARE_VERSION_GUID { get; set; }
        public string HARDWARE_VERSION_GUID { get; set; }
    }
}
"nc">MainWindow : MetroWindow { private String _sourceFolder; private CompilerFolderResult _lastFolderResult; public RelayCommand LoadFileCommand { get; set; } public RelayCommand LoadFolderCommand { get; set; } public RelayCommand CompileCommand { get; set; } public RelayCommand SaveCommand { get; set; } public List<Item> SourceItems { get { return (List<Item>)GetValue(SourceItemsProperty); } set { SetValue(SourceItemsProperty, value); } } public static readonly DependencyProperty SourceItemsProperty = DependencyProperty.Register("SourceItems", typeof(List<Item>), typeof(MainWindow), new PropertyMetadata(null)); public String CurrentContent { get { return (String)GetValue(CurrentContentProperty); } set { SetValue(CurrentContentProperty, value); } } public static readonly DependencyProperty CurrentContentProperty = DependencyProperty.Register("CurrentContent", typeof(String), typeof(MainWindow), new PropertyMetadata(null)); public List<ICompilerResult> TargetItems { get { return (List<ICompilerResult>)GetValue(TargetItemsProperty); } set { SetValue(TargetItemsProperty, value); } } public static readonly DependencyProperty TargetItemsProperty = DependencyProperty.Register("TargetItems", typeof(List<ICompilerResult>), typeof(MainWindow), new PropertyMetadata(null)); public CompilerLanguage CompilerLanguage { get { return (CompilerLanguage)GetValue(CompilerLanguageProperty); } set { SetValue(CompilerLanguageProperty, value); } } public static readonly DependencyProperty CompilerLanguageProperty = DependencyProperty.Register("CompilerLanguage", typeof(CompilerLanguage), typeof(MainWindow), new PropertyMetadata(CompilerLanguage.CSharp)); public MainWindow() { SourceItems = new List<Item>(); TargetItems = new List<ICompilerResult>(); LoadFileCommand = new RelayCommand(LoadFile); LoadFolderCommand = new RelayCommand(LoadFolder); CompileCommand = new RelayCommand(Compile); SaveCommand = new RelayCommand(Save); InitializeComponent(); } private void LoadFolder() { var dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = true; CommonFileDialogResult result = dialog.ShowDialog(); if (result == CommonFileDialogResult.Ok) { _sourceFolder = dialog.FileName; SourceItems = ItemProvider.GetItems(_sourceFolder); } } private void LoadFile() { throw new NotImplementedException(); } private void Source_TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) { if (e.NewValue is FileItem) { CurrentContent = File.ReadAllText((e.NewValue as FileItem).Path); } else if (e.NewValue is CompilerFileResult) { CurrentContent = (e.NewValue as CompilerFileResult).Content; } else { CurrentContent = String.Empty; } } private void Compile() { IProtoCompiler compiler = CompilerFactory.CreateCompiler(CompilerLanguage); try { _lastFolderResult = compiler.CompileFolder(_sourceFolder, txtIncludes.Text.Split(',')); TargetItems = _lastFolderResult.Results.ToList(); } catch (CompilerException ex) { ExceptionWindow exWin = new ExceptionWindow(ex.Issues); exWin.Owner = this; exWin.ShowDialog(); } } private void Save() { if (_lastFolderResult != null) { var dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = true; CommonFileDialogResult result = dialog.ShowDialog(); if (result == CommonFileDialogResult.Ok) { _lastFolderResult.Save(dialog.FileName); } } } } }