Questions tagged [conditional-attribute]

19 questions
0
votes
2 answers

Do pre-processor directives protect server code from the client?

I'm developing a client-server library. Some of the classes can be used by either the client or the server but are executed differently and yield slightly different results for each. As well, the server code may contain additional methods that will…
0
votes
1 answer

Ruby Conditional argument to method

I have some 'generic' methods that extract data based on css selectors that usually are the same in many websites. However I have another method that accept as argument the css selector for a given website. I need to call the get_title method if…
0
votes
1 answer

How to leverage power of TextWriterFormat for printfn style in combination with ConditionalAttribute which requires unit result

I set myself to creating a trace function that behaves like sprintf or printfn, but is disabled (JIT removes it on call site) for Release builds by using the ConditionalAttribute. Result so far: I don't think it is possible. The problem centers…
Abel
  • 56,041
  • 24
  • 146
  • 247
0
votes
1 answer

Getting a specific attribute instance using ConditionString

This might be a silly question. I am trying to understand the concept of conditional attribute.My aim is to get a specific attribute instance and ended up in getting NullReferenceException instead of the output "CONDITION1". class Program { …
Dev
  • 1,451
  • 20
  • 30
1
2