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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 437 - (show annotations) (download)
Tue May 28 18:08:23 2013 UTC (8 years, 5 months ago) by william
File size: 1179 byte(s)
+ current wip for custom usercontrol plugins

1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using RomCheater.PluginFramework.Interfaces;
6 using System.Reflection;
7 using System.Runtime.InteropServices;
8
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