示例#1
0
        /// <summary>
        /// Gets the error message for the property with the given name.
        /// </summary>
        /// <param name="columnName">The name of the property whose error message to get.</param>
        /// <returns>The error message for the property. The default is an empty string ("").</returns>
        public string this[string columnName]
        {
            get
            {
                string error = string.Empty;
                switch (columnName)
                {
                case "LocationName":
                    if (LocationName.IsStringMissing())
                    {
                        error = Strings.TroveLocation_Error_LocationNameMissing;
                    }
                    break;

                case "LocationPath":
                    if (LocationPath.IsStringMissing())
                    {
                        error = Strings.TroveLocation_Error_LocationPathMissing;
                    }
                    else if (!File.Exists(Path.Combine(LocationPath, TroveExecutableFileName)))
                    {
                        error = Strings.TroveLocation_Error_LocationPathInvalid;
                    }
                    break;
                }
                return(error);
            }
        }