Beispiel #1
0
        /// <summary>
        /// Get the value for a given column.
        /// </summary>
        /// <param name="column">The column to get the value for.</param>
        /// <returns></returns>
        public String getValue(int column)
        {
            if (simElementManager != null)
            {
                switch (column)
                {
                case NAME_COL:
                    return(simElementManager.Name);

                case TYPE_COL:
                    return(simElementManager.GetType().Name);
                }
            }
            return(null);
        }
Beispiel #2
0
 /// <summary>
 /// Determine if the given string is in the correct format for this
 /// property to parse.
 /// </summary>
 /// <param name="column"></param>
 /// <param name="value">The value to try to parse.</param>
 /// <param name="errorMessage">An error message if the function returns false.</param>
 /// <returns>True if the string can be parsed.</returns>
 public bool canParseString(int column, string value, out string errorMessage)
 {
     if (column == NAME_COL && value != null && value != String.Empty)
     {
         SimElementManagerDefinition def = subScene.getSimElementManager(value);
         if (simElementManager == null || def != simElementManager)
         {
             if (def == null)
             {
                 errorMessage = String.Format("Could not find a SimElementManagerDefinition named {0}", value);
                 return(false);
             }
             if (subScene.hasTypeBindings(def))
             {
                 errorMessage = String.Format("This SubSceneDefinition already has a binding for the type {0}", def.GetType().Name);
                 return(false);
             }
         }
     }
     errorMessage = null;
     return(true);
 }