aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/Tango.Scripting.Basic/ReferenceAssembly.cs
blob: 4b04270c10585bfca31d20ee942f0d99d6ee89ec (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
31
32
33
34
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Scripting.Basic
{
    public class ReferenceAssembly
    {
        public String File { get; set; }

        [JsonIgnore]
        public String Name
        {
            get { return Path.GetFileNameWithoutExtension(File); }
        }

        public static ReferenceAssembly FromType(Type type)
        {
            ReferenceAssembly reference = new ReferenceAssembly();
            var assembly = type.Assembly;
            reference.File = assembly.Location;
            return reference;
        }

        public static ReferenceAssembly FromFile(String file)
        {
            return new ReferenceAssembly() { File = file };
        }
    }
}