I have this code:
public IfStatement? m_IfStatement; public struct IfStatement { public string Statement { get; private set; } public string Comparison { get; private set; } public string ConditionValue { get; private set; } public string IfCondition_True { get; private set; } public string IfCondition_False { get; private set; } } and when I'm trying to set values to the struct like this:
m_IfStatement = new IfStatement(); m_IfStatement.Statement = cboIfStatement.SelectedItem.ToString(); m_IfStatement.Comparison = cboComparison.SelectedItem.ToString(); m_IfStatement.ConditionValue = txtIfValue.Text; m_IfStatement.IfTrue = ""; m_IfStatement.IfFalse = ""; I'm getting this error by the compailer:
'System.Nullable<Core.BaseControls.IntegrationTool.frmDataManipulation.IfStatement>' does not contain a definition for 'Statement' and no extension method 'Statement' accepting a first argument of type 'System.Nullable<Core.BaseControls.IntegrationTool.frmDataManipulation.IfStatement>' could be found (are you missing a using directive or an assembly reference?) What does it mean ? and how do I solve this...? please. Both statements are in the same scope (e.g. in the same class).
privatem_IfStatement.Value.Statementand also a public setter. But why use nullable anyway? Since a struct cannot benull.