Home > Net >  TMP? SetValue (name, value); This is what mean??
TMP? SetValue (name, value); This is what mean??

Time:01-21

I found it after the whole class into one message to write code that IDE also does not have an error, what is this mean?

 
Public static void AddItem (string node, string name, object value)
{
RegistryKey TMP=SOFTWARE. CreateSubKey (node);
TMP? SetValue (name, value);
}

CodePudding user response:

NULL check operator, if TMP is empty, is not on the back of the SetValue action

CodePudding user response:

TMP? SetValue (name, value);
Equivalent
If (TMP!=null)
TMP. SetValue (name, value);

C # 7.0 syntactic sugar

CodePudding user response:

If (TMP!=null)
{
TMP. SetValue (name, value)
}

CodePudding user response:

Question mark means determine whether is empty

CodePudding user response:

The calculating do not calculate three unary? I always thought that the ternary must have? And, in order to be, are now to simplify
  •  Tags:  
  • C#
  • Related