aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/CustomResolver.cs
blob: ee1acccae7b28756ddde504c7d17d7ca3435e205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using RazorEngine.Compilation;
using RazorEngine.Compilation.ReferenceResolver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.CodeGeneration
{
    internal class CustomResolver : IReferenceResolver
    {
        public IEnumerable<CompilerReference> GetReferences(TypeContext context, IEnumerable<CompilerReference> includeAssemblies)
        {
            return new UseCurrentAssembliesReferenceResolver()
                        .GetReferences(context, includeAssemblies)
                        .Where(f => !f.GetFile().EndsWith(".winmd"));
        }
    }
}
/// <seealso cref="Tango.SharedUI.ViewModel" /> public abstract class DialogViewVM : ViewModel { public event Action Accepted; public event Action Canceled; /// <summary> /// Initializes a new instance of the <see cref="DialogViewVM"/> class. /// </summary> public DialogViewVM() { CanClose = true; CloseCommand = new RelayCommand(Cancel, (x) => CanClose); } private bool _canClose; /// <summary> /// Gets or sets a value indicating whether this dialog can be closed. /// </summary> public bool CanClose { get { return _canClose; } set { _canClose = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } } /// <summary> /// Gets or sets the close command. /// </summary> public RelayCommand CloseCommand { get; set; } /// <summary> /// Called when the dialog has been shown. /// </summary> public virtual void OnShow() { } /// <summary> /// Invokes the <see cref="Accepted"/> event. /// </summary> protected virtual void Accept() { Accepted?.Invoke(); } /// <summary> /// Invokes the <see cref="Canceled"/> event. /// </summary> protected virtual void Cancel() { Canceled?.Invoke(); } } }