Files
DP44/DataPRO/IService/.svn/pristine/bd/bdfe7049a05040da78cf91ee739493b46c9f0357.svn-base

37 lines
1.3 KiB
Plaintext
Raw Normal View History

2026-04-17 14:55:32 -04:00
using System;
// ReSharper disable once CheckNamespace
namespace DTS.DASLib.Service
{
/// <inheritdoc />
/// <summary>
/// This attribute is used to control whether a gain is available to unmodified gen 3 SPS
/// http://fogbugz/fogbugz/default.asp?10080
/// the gain should still be available for modified SPS
/// this attribute is optional, it is assumed to be available unless explicitly marked as
/// unavailable
/// </summary>
public class GainAvailableUnmodifiedAttribute : Attribute
{
/// <summary>
/// returns whether gain is available to unmodified SPS gen 3 or not
/// http://fogbugz/fogbugz/default.asp?10080
/// </summary>
/// <param name="o"></param>
/// <returns></returns>
public static bool IsGainAvailableToUnmodified(object o)
{
if (o == null) return true;
var mi = o.GetType().GetMember(o.ToString());
if (mi.Length <= 0) return true;
return !(GetCustomAttribute(mi[0], typeof(GainAvailableUnmodifiedAttribute)) is GainAvailableUnmodifiedAttribute attr) || attr._bAvailable;
}
private readonly bool _bAvailable;
public GainAvailableUnmodifiedAttribute(bool available)
{
_bAvailable = available;
}
}
}