/// <exclude/> public LookupValue(SerializationInfo serializationInfo, StreamingContext streamingContext) { int version = 0; if (SerializationVersionExists) { try { version = serializationInfo.GetInt32("SerializationVersion"); } catch (SerializationException) { // ignore SerializationVersionExists = false; } } _alias = serializationInfo.GetString("Alias"); _aliasPlural = serializationInfo.GetString("AliasPlural"); _enabled = serializationInfo.GetBoolean("Enabled"); _isUserDefined = serializationInfo.GetBoolean("IsUserDefined"); _name = serializationInfo.GetString("Name"); _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList); _id = serializationInfo.GetValue("Id", ModelTypes.Object); _description = serializationInfo.GetString("Description"); _Parent = (Lookup)serializationInfo.GetValue("Parent", ModelTypes.Lookup); }
public LookupValue(string name, bool isUserDefined, object id, string description, Lookup parent) : base(name, isUserDefined) { _id = id; _description = description; _Parent = parent; ResetDefaults(); }
public FormLookup(Lookup lookup) { InitializeComponent(); BackColor = Slyce.Common.Colors.BackgroundColor; _Lookup = lookup; ucHeading1.Text = ""; Interfaces.Events.ShadeMainForm(); }
public bool AliasPluralValidate(Lookup lookup, out string failReason) { failReason = ""; /*Don't check items that are not enabled*/ if (!lookup.Enabled) { return true; } if (string.IsNullOrEmpty(lookup.AliasPlural)) { failReason = "AliasPlural cannot be zero-length."; return false; } if (lookup.AliasPlural.IndexOf(" ") >= 0) { failReason = "AliasPlural cannot have spaces."; return false; } foreach (Lookup sibling in lookup.Database.Lookups) { if (sibling != lookup && sibling.Enabled && ArchAngel.Providers.Database.Helper.Script.StringsAreEqual(sibling.AliasPlural, lookup.AliasPlural, false)) { failReason = "Duplicate AliasPlural: " + lookup.AliasPlural; return false; } } return true; }
public virtual string AliasPluralDefault(Lookup lookup) { return ArchAngel.Providers.Database.Helper.Script.GetPlural(lookup.Alias); }
public LookupValue(string name, bool isUserDefined, Lookup parent) : base(name, isUserDefined) { _Parent = parent; ResetDefaults(); }
/// <summary> /// TODO: I don't think this should be exposed to the user??? /// </summary> /// <param name="serializationInfo"></param> /// <param name="streamingContext"></param> public Column(SerializationInfo serializationInfo, StreamingContext streamingContext) { if (SerializerHelper.UseFastSerialization) { using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[])))) { UniqueId = reader.ReadString(); Lookups.Add(UniqueId, this); _alias = reader.ReadString(); _aliasDisplay = reader.ReadString(); _characterMaximumLength = reader.ReadInt32(); _dataType = reader.ReadString(); _default = reader.ReadString(); _enabled = reader.ReadBoolean(); _inPrimaryKey = reader.ReadBoolean(); _isIdentity = reader.ReadBoolean(); _isNullable = reader.ReadBoolean(); _isUserDefined = reader.ReadBoolean(); _name = reader.ReadString(); _ordinalPosition = reader.ReadInt32(); // Parent _readOnly = reader.ReadBoolean(); _userOptions = (List<IUserOption>)reader.ReadObject(); _IsCalculated = reader.ReadBoolean(); _precision = reader.ReadInt32(); _scale = reader.ReadInt32(); for (int i = 0; i < _userOptions.Count; i++) { _userOptions[i].Owner = this; } } } else { int version = 0; if (SerializationVersionExists) { try { version = serializationInfo.GetInt32("SerializationVersion"); } catch (SerializationException) { // ignore SerializationVersionExists = false; } } _alias = serializationInfo.GetString("Alias"); _aliasDisplay = serializationInfo.GetString("AliasDisplay"); _characterMaximumLength = serializationInfo.GetInt32("CharacterMaximumLength"); _dataType = serializationInfo.GetString("DataType"); _default = serializationInfo.GetString("Default"); _enabled = serializationInfo.GetBoolean("Enabled"); //this._exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ObjectType); _inPrimaryKey = serializationInfo.GetBoolean("InPrimaryKey"); _isIdentity = serializationInfo.GetBoolean("IsIdentity"); _isNullable = serializationInfo.GetBoolean("IsNullable"); _isUserDefined = serializationInfo.GetBoolean("IsUserDefined"); _name = serializationInfo.GetString("Name"); _ordinalPosition = serializationInfo.GetInt32("OrdinalPosition"); _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject); _readOnly = serializationInfo.GetBoolean("ReadOnly"); _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList); if (version >= 2) { _IsCalculated = serializationInfo.GetBoolean("IsCalculated"); if (version >= 3) { _precision = serializationInfo.GetInt32("Precision"); _scale = serializationInfo.GetInt32("Scale"); if (version >= 8) { _description = serializationInfo.GetString("Description"); if (version >= 9) { _Lookup = (Lookup)serializationInfo.GetValue("Lookup", ModelTypes.Lookup); //_Lookup.SubscribingObjects.Add(this); } } } } } }
private void FormLookup_Load(object sender, EventArgs e) { if (Lookup == null) { IsNew = true; Text = "Add New Lookup"; _Lookup = new Lookup("NewLookup", true); Database.AddLookup(_Lookup); } else { Text = "Edit Lookup " + Lookup.Name; txtName.Text = Lookup.Name; txtAlias.Text = Lookup.Alias; txtDescription.Text = Lookup.Description; foreach (LookupValue lookupValue in Lookup.LookupValues) { AddLookupValueToGrid(lookupValue); } } PopulateTables(); PopulateSubscribingColumns(); txtName.Focus(); }
public void AddLookup(Lookup lookup) { _lookups.Add(lookup); lookup.Database = this; }
private Node AddLookupNode(Node lookupNodes, Lookup lookup, Images image) { Node lookupNode = AddNode(lookupNodes, lookup.Alias, lookup, image, true, lookup.Enabled); //UpdateScriptObjectNode(scriptObjectNode, scriptObject, Images.Lookup); return lookupNode; }
/// <summary> /// TODO: I don't think this should be exposed to the user??? /// </summary> /// <param name="serializationInfo"></param> /// <param name="streamingContext"></param> public Column(SerializationInfo serializationInfo, StreamingContext streamingContext) { if (SerializerHelper.UseFastSerialization) { using (SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[])))) { UniqueId = reader.ReadString(); Lookups.Add(UniqueId, this); _alias = reader.ReadString(); _aliasDisplay = reader.ReadString(); _characterMaximumLength = reader.ReadInt32(); _dataType = reader.ReadString(); _default = reader.ReadString(); _enabled = reader.ReadBoolean(); _inPrimaryKey = reader.ReadBoolean(); _isIdentity = reader.ReadBoolean(); _isNullable = reader.ReadBoolean(); _isUserDefined = reader.ReadBoolean(); _name = reader.ReadString(); _ordinalPosition = reader.ReadInt32(); // Parent _readOnly = reader.ReadBoolean(); _userOptions = (List <IUserOption>)reader.ReadObject(); _IsCalculated = reader.ReadBoolean(); _precision = reader.ReadInt32(); _scale = reader.ReadInt32(); for (int i = 0; i < _userOptions.Count; i++) { _userOptions[i].Owner = this; } } } else { int version = 0; if (SerializationVersionExists) { try { version = serializationInfo.GetInt32("SerializationVersion"); } catch (SerializationException) { // ignore SerializationVersionExists = false; } } _alias = serializationInfo.GetString("Alias"); _aliasDisplay = serializationInfo.GetString("AliasDisplay"); _characterMaximumLength = serializationInfo.GetInt32("CharacterMaximumLength"); _dataType = serializationInfo.GetString("DataType"); _default = serializationInfo.GetString("Default"); _enabled = serializationInfo.GetBoolean("Enabled"); //this._exposedUserOptions = serializationInfo.GetValue("ExposedUserOptions", ObjectType); _inPrimaryKey = serializationInfo.GetBoolean("InPrimaryKey"); _isIdentity = serializationInfo.GetBoolean("IsIdentity"); _isNullable = serializationInfo.GetBoolean("IsNullable"); _isUserDefined = serializationInfo.GetBoolean("IsUserDefined"); _name = serializationInfo.GetString("Name"); _ordinalPosition = serializationInfo.GetInt32("OrdinalPosition"); _parent = (ScriptObject)serializationInfo.GetValue("Parent", ModelTypes.ScriptObject); _readOnly = serializationInfo.GetBoolean("ReadOnly"); _userOptions = (List <IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList); if (version >= 2) { _IsCalculated = serializationInfo.GetBoolean("IsCalculated"); if (version >= 3) { _precision = serializationInfo.GetInt32("Precision"); _scale = serializationInfo.GetInt32("Scale"); if (version >= 8) { _description = serializationInfo.GetString("Description"); if (version >= 9) { _Lookup = (Lookup)serializationInfo.GetValue("Lookup", ModelTypes.Lookup); //_Lookup.SubscribingObjects.Add(this); } } } } } }