コード例 #1
0
ファイル: LookupValue.cs プロジェクト: uQr/Visual-NHibernate
        /// <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);
        }
コード例 #2
0
ファイル: LookupValue.cs プロジェクト: uQr/Visual-NHibernate
 public LookupValue(string name, bool isUserDefined, object id, string description, Lookup parent)
     : base(name, isUserDefined)
 {
     _id = id;
     _description = description;
     _Parent = parent;
     ResetDefaults();
 }
コード例 #3
0
ファイル: FormLookup.cs プロジェクト: uQr/Visual-NHibernate
 public FormLookup(Lookup lookup)
 {
     InitializeComponent();
     BackColor = Slyce.Common.Colors.BackgroundColor;
     _Lookup = lookup;
     ucHeading1.Text = "";
     Interfaces.Events.ShadeMainForm();
 }
コード例 #4
0
ファイル: Lookup.cs プロジェクト: uQr/Visual-NHibernate
        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;
        }
コード例 #5
0
ファイル: Lookup.cs プロジェクト: uQr/Visual-NHibernate
 public virtual string AliasPluralDefault(Lookup lookup)
 {
     return ArchAngel.Providers.Database.Helper.Script.GetPlural(lookup.Alias);
 }
コード例 #6
0
ファイル: LookupValue.cs プロジェクト: uQr/Visual-NHibernate
 public LookupValue(string name, bool isUserDefined, Lookup parent)
     : base(name, isUserDefined)
 {
     _Parent = parent;
     ResetDefaults();
 }
コード例 #7
0
ファイル: Column.cs プロジェクト: uQr/Visual-NHibernate
        /// <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);
                            }
                        }
                    }
                }
            }
        }
コード例 #8
0
ファイル: FormLookup.cs プロジェクト: uQr/Visual-NHibernate
        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();
        }
コード例 #9
0
ファイル: Database.cs プロジェクト: windygu/Visual-NHibernate
 public void AddLookup(Lookup lookup)
 {
     _lookups.Add(lookup);
     lookup.Database = this;
 }
コード例 #10
0
ファイル: EditModel.cs プロジェクト: uQr/Visual-NHibernate
 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;
 }
コード例 #11
0
        /// <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);
                            }
                        }
                    }
                }
            }
        }
コード例 #12
0
 public LookupValue(string name, bool isUserDefined, object id, string description, Lookup parent)
     : base(name, isUserDefined)
 {
     _id          = id;
     _description = description;
     _Parent      = parent;
     ResetDefaults();
 }
コード例 #13
0
 public LookupValue(string name, bool isUserDefined, Lookup parent)
     : base(name, isUserDefined)
 {
     _Parent = parent;
     ResetDefaults();
 }