/[RomCheater]/trunk/RomCheater.PluginFramework/Core/AssemblyGuid.cs
ViewVC logotype

Annotation of /trunk/RomCheater.PluginFramework/Core/AssemblyGuid.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 889 - (hide annotations) (download)
Wed Sep 17 04:55:52 2014 UTC (7 years, 1 month ago) by william
File size: 1163 byte(s)


1 william 437 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using System.Reflection;
6     using System.Runtime.InteropServices;
7 william 889 using RomCheater.Interfaces;
8 william 437
9     namespace RomCheater.PluginFramework.Core
10     {
11     internal class _AssemblyGuid : IAssemblyGuid
12     {
13     //public _AssemblyGuid() : this(new Guid()) { }
14     public _AssemblyGuid(Assembly asm) : this(new Guid((asm.GetCustomAttributes(typeof(GuidAttribute), true)[0] as GuidAttribute).Value)) { }
15     public _AssemblyGuid(Type type) : this(type.Assembly) { }
16     public _AssemblyGuid(Guid guid) { _guid = guid; }
17    
18     #region IAssemblyGuid members
19     private Guid _guid;
20     public Guid guid { get { return _guid; } }
21     #endregion
22     }
23     public static class AssemblyGuid
24     {
25     //public static Guid GetGuid() { IAssemblyGuid g = new _AssemblyGuid(); return g.guid; }
26     public static Guid GetGuid(Assembly assembly) { IAssemblyGuid g = new _AssemblyGuid(assembly); return g.guid; }
27     public static Guid GetGuid(Type type) { IAssemblyGuid g = new _AssemblyGuid(type); return g.guid; }
28     }
29     }

  ViewVC Help
Powered by ViewVC 1.1.22