Ejemplo n.º 1
0
    protected virtual void RegisterForCommands()
    {
        var type       = GetType();
        var attributes = type.GetCustomAttributes(typeof(RecievesCommandAttribute), true).Cast <RecievesCommandAttribute>();

        foreach (var attr in attributes)
        {
            commands.RegisterCommandReceiver(attr.CommandCode, this);
        }
    }