Exemple #1
0
        public ObjectDefProperty GetProperty(string propName)
        {
            ObjectDefProperty prop = null;

            prop = (from p in Properties where p.Name.Equals(propName, StringComparison.InvariantCultureIgnoreCase) select p).SingleOrDefault();
            return(prop);
        }
Exemple #2
0
        public ObjectDefProperty CreateProperty(string name, string displayName, string description,
                                                string columnName, string typeName, bool isKey, int propertyOrder, int length
                                                )
        {
            var p = new ObjectDefProperty()
            {
                ColumnName        = columnName,
                DisplayName       = displayName,
                Description       = description,
                PropertyOrder     = propertyOrder,
                ObjectDefName     = this.Name,
                Name              = name,
                IsKey             = isKey,
                TypeName          = typeName,
                Length            = length,
                ListDisplay       = true,
                EditDisplay       = true,
                DataSource        = "",
                DefaultExpression = "",
                IsUserKey         = false,
                SortOrder         = 0,
                SortType          = SortType.None
            };

            p.SetNew();
            Properties.Add(p);
            return(p);
        }
Exemple #3
0
        /// <summary>
        /// Creates a [name]Text property used for displaying the text rather thank the value for data source properties.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="displayName"></param>
        /// <param name="description"></param>
        /// <param name="columnName"></param>
        /// <param name="typeName"></param>
        /// <param name="isKey"></param>
        /// <param name="propertyOrder"></param>
        /// <param name="length"></param>
        /// <param name="dataSource"></param>
        /// <returns></returns>
        public ObjectDefProperty CreateDataSourceTextProperty(string name, string displayName, string description,
                                                              string columnName, string typeName, bool isKey, int propertyOrder, int length,
                                                              string dataSource
                                                              )
        {
            ObjectDefProperty p = GetProperty(name);

            if (p == null)
            {
                p = CreateProperty(name, displayName, description, columnName, typeName, isKey, propertyOrder, length);
            }
            p.DataSource  = dataSource;
            p.ListDisplay = false;
            var textp = CreateProperty(name + "Text", displayName, description, columnName, typeName, isKey, p.PropertyOrder + 1, length);

            textp.DataSource  = dataSource;
            textp.EditDisplay = false;
            textp.IgnoreColumnDataOperation = DataOperation.All;
            return(textp);
        }