This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using System;
// ReSharper disable once CheckNamespace
namespace DTS.DASLib.Service
{
/// <summary>
/// this attribute controls whether a gain is disabled or not
/// this was done for
/// http://fogbugz/fogbugz/default.asp?10080
/// to prevent the higher range gains which were considered just not useful
/// this attribute is optional, it is assume the gain is not disabled
/// unless it's explicitly marked as disabled
/// </summary>
public class GainDisabledAttribute : Attribute
{
/// <summary>
/// returns whether the gain is disabled or not
/// http://fogbugz/fogbugz/default.asp?10080
/// </summary>
/// <param name="o"></param>
/// <returns></returns>
public static bool IsGainDisabled(object o)
{
if (o == null) return false;
var mi = o.GetType().GetMember(o.ToString());
if (mi.Length <= 0) return false;
return GetCustomAttribute(mi[0], typeof(GainDisabledAttribute)) is GainDisabledAttribute attr && attr._bDisabled;
}
private readonly bool _bDisabled;
public GainDisabledAttribute(bool disabled)
{
_bDisabled = disabled;
}
}
}