System.Xml.Serialization.ReflectionAwareCodeGen.WriteLocalDecl C# (CSharp) Method

WriteLocalDecl() private method

private WriteLocalDecl ( string typeFullName, string variableName, string initValue, bool useReflection ) : void
typeFullName string
variableName string
initValue string
useReflection bool
return void
        internal void WriteLocalDecl(string typeFullName, string variableName, string initValue, bool useReflection)
        {
            if (useReflection)
                typeFullName = "object";
            _writer.Write(typeFullName);
            _writer.Write(" ");
            _writer.Write(variableName);
            if (initValue != null)
            {
                _writer.Write(" = ");
                if (!useReflection && initValue != "null")
                {
                    _writer.Write("(" + typeFullName + ")");
                }
                _writer.Write(initValue);
            }
            _writer.WriteLine(";");
        }