Exemple #1
0
        public bool Equals(StoredCar other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Model.Equals(other.Model) &&
                   Position.Equals(other.Position) &&
                   Angle.Equals(other.Angle) &&
                   Flags.Equals(other.Flags) &&
                   Color1.Equals(other.Color1) &&
                   Color2.Equals(other.Color2) &&
                   Radio.Equals(other.Radio) &&
                   Extra1.Equals(other.Extra1) &&
                   Extra2.Equals(other.Extra2) &&
                   Bomb.Equals(other.Bomb));
        }
Exemple #2
0
        public bool Equals(StoredCar other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Model.Equals(other.Model) &&
                   Position.Equals(other.Position) &&
                   Math.Abs(Heading - other.Heading) < 0.001 &&
                   Math.Abs(Pitch - other.Pitch) < 0.001 &&
                   Traction.Equals(other.Traction) &&
                   Flags.Equals(other.Flags) &&
                   Color1.Equals(other.Color1) &&
                   Color2.Equals(other.Color2) &&
                   Radio.Equals(other.Radio) &&
                   Extra1.Equals(other.Extra1) &&
                   Extra2.Equals(other.Extra2));
        }
Exemple #3
0
        /// <summary>
        /// Guarda una entrada en el registro del sistema, indicando los cambios que se realizaron en este elemento.
        /// </summary>
        private void GuardarLog()
        {
            System.Text.StringBuilder Extra1 = null;
            try {
                // Genero una lista de cambios
                foreach (Lazaro.Orm.Data.ColumnValue Fl in this.m_Registro.Fields)
                {
                    object ValorOriginal = null, ValorNuevo = this.m_Registro[Fl.ColumnIdentifier];
                    if (this.m_RegistroOriginal != null && this.m_RegistroOriginal.Fields != null)
                    {
                        ValorOriginal = this.m_RegistroOriginal[Fl.ColumnIdentifier];
                    }

                    if (Lfx.Types.Object.CompareByValue(ValorOriginal, ValorNuevo) != 0 && Fl.ColumnIdentifier.EqualsByName("contrasena") == false)
                    {
                        if (Extra1 == null)
                        {
                            Extra1 = new StringBuilder();
                        }
                        else
                        {
                            Extra1.Append("; ");
                        }

                        Extra1.Append(Fl.ColumnIdentifier + "=");
                        if (ValorOriginal != null)
                        {
                            Extra1.Append("\'" + this.Connection.EscapeString(ValorOriginal.ToString()) + "\'->");
                        }
                        else
                        {
                            Extra1.Append("NULL->");
                        }

                        if (ValorNuevo != null)
                        {
                            Extra1.Append("\'" + this.Connection.EscapeString(ValorNuevo.ToString()) + "\'");
                        }
                        else
                        {
                            Extra1.Append("NULL");
                        }
                    }
                }
            } catch {
                if (Lfx.Workspace.Master.DebugMode)
                {
                    throw;
                }
            }

            try {
                //System.Console.WriteLine(Extra1);
                Lbl.Sys.Config.ActionLog(this.Connection, Sys.Log.Acciones.Save, this, Extra1 == null ? null : Extra1.ToString());
            } catch {
                if (Lfx.Workspace.Master.DebugMode)
                {
                    throw;
                }
            }
        }