FlatRedBall.Glue.ElementRuntime.SetCustomVariableWithNoSourceObject C# (CSharp) Method

SetCustomVariableWithNoSourceObject() private method

private SetCustomVariableWithNoSourceObject ( CustomVariable cv, object valueToSetTo ) : void
cv FlatRedBall.Glue.SaveClasses.CustomVariable
valueToSetTo object
return void
        private void SetCustomVariableWithNoSourceObject(CustomVariable cv, object valueToSetTo)
        {
            // This is just a simple custom variable.  We still need to handle this and raise events
            VariableSetArgs vse = new VariableSetArgs();
            vse.Value = valueToSetTo;
            vse.VariableName = cv.Name;

            if (BeforeVariableApply != null)
            {
                BeforeVariableApply(this, vse);
            }

            SetCustomVariableValue(cv.Name, valueToSetTo);

            if (AfterVariableApply != null)
            {
                AfterVariableApply(this, vse);
            }
        }