private static bool isVotingEnumAlawaysVotable(VotingTypeEnum value) { var type = typeof(VotingTypeEnum); var memInfo = type.GetMember(value.ToString()); var attributes = memInfo[0].GetCustomAttributes(typeof(AlwaysVotableAttribute), false); return(((AlwaysVotableAttribute)attributes[0]).Value); }
private static void add <T>(VotingTypeEnum votingType) where T : class { var type = typeof(T); #if DEBUG if (viewModelTypes.ContainsKey(votingType)) { throw new Exception("We have that type!(" + votingType.ToString() + ")"); } #endif viewModelTypes.Add(votingType, type); }