예제 #1
0
        public static ColumnSetting CreateFromDefault(ColumnSetting def, Account account)
        {
            var clone = new ColumnProperties();

            foreach (var prop in def.Properties)
            {
                if (prop.Value != null)
                {
                    string key       = string.Copy(prop.Key);
                    int    valueType = (int)prop.Value.GetTypeCode();

                    if (valueType >= 2 && valueType <= 15)
                    {
                        clone.Add(key, prop.Value);
                    }
                    else if (valueType == 16)
                    {
                        clone.Add(key, prop.Value.ToString());
                    }
                }
            }

            return(new ColumnSetting(def.Type, account, clone));
        }
예제 #2
0
 public ColumnSetting(ColumnType type, Account account, ColumnProperties properties = null)
 {
     Type        = type;
     UserId      = account.Id;
     _properties = properties;
 }
예제 #3
0
 public ColumnSetting(ColumnType type, long userId, ColumnProperties properties = null)
 {
     Type        = type;
     UserId      = userId;
     _properties = properties;
 }