SND\AstrorEnales_cp 5505f7dcbf - Added PlatformSystem Plugins layer
- Started Windows, Metro and Linux Platform-Plugins
- Moved the RecordingSample to the Samples folder
- Started two samples for using the graphics device in a WinForms and Wpf Editor
- Refactorings in the AddIn-System
- Moved the Window initialization-code to the Platform modules
- Changed the License text in all code files which is now way smaller
- Started ProjectConverter tool which converts all the projects and solution to the target configuration
- Changed the SupportedPlatform names in the Resource files
- Changed the WIN8 define to WINDOWSMETRO which is actually meant
- Removed NLog and started our own Logger class
- Many more stuff...
2012-08-09 09:45:04 +00:00

96 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Reflection;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANXStatusComparer.Data
{
public class EventElement : BaseObjectElement
{
public EventInfo Handle
{
get;
private set;
}
public MethodInfo AddMethod
{
get;
private set;
}
public MethodInfo RemoveMethod
{
get;
private set;
}
public EventElement(EventInfo method, string setKeyName)
: base(setKeyName)
{
Handle = method;
AddMethod = Handle.GetAddMethod();
RemoveMethod = Handle.GetRemoveMethod();
}
public override bool IsCorrect(BaseObjectElement otherElement)
{
EventElement other = otherElement as EventElement;
bool isCorrect = true;
if (otherElement.KeyName != KeyName)
{
isCorrect = false;
}
if (AddMethod != null &&
other.AddMethod != null)
{
if (AddMethod.IsPublic != other.AddMethod.IsPublic)
{
isCorrect = false;
}
if (AddMethod.IsFamily != other.AddMethod.IsFamily)
{
isCorrect = false;
}
}
if (RemoveMethod != null &&
other.RemoveMethod != null)
{
if (RemoveMethod.IsPublic != other.RemoveMethod.IsPublic)
{
isCorrect = false;
}
if (RemoveMethod.IsFamily != other.RemoveMethod.IsFamily)
{
isCorrect = false;
}
}
return isCorrect;
}
public override string GetDescription()
{
string result = "";
if (AddMethod != null)
{
result += (AddMethod.IsPublic ? "[PUBLIC ADD] " : "") +
(AddMethod.IsFamily ? "[PROTECTED ADD] " : "");
}
if (RemoveMethod != null)
{
result += (RemoveMethod.IsPublic ? "[PUBLIC REMOVE] " : "") +
(RemoveMethod.IsFamily ? "[PROTECTED REMOVE] " : "");
}
result += Handle.ToString();
return result;
}
}
}