// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; namespace Microsoft.AspNet.Mvc { public class FormContext { private readonly Dictionary _renderedFields = new Dictionary(StringComparer.Ordinal); private Dictionary _formData; /// /// Property bag for any information you wish to associate with a <form/> in an /// implementation or extension method. /// public IDictionary FormData { get { if (_formData == null) { _formData = new Dictionary(StringComparer.Ordinal); } return _formData; } } public bool RenderedField([NotNull] string fieldName) { bool result; _renderedFields.TryGetValue(fieldName, out result); return result; } public void RenderedField([NotNull] string fieldName, bool value) { _renderedFields[fieldName] = value; } } }