int.Equals(int)

Here are the examples of the csharp api int.Equals(int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

777 Examples 7

19 Source : MainWindow.xaml.cs
with GNU General Public License v3.0
from 1RedOne

private void CMServerName_TextChanged(object sender, TextChangedEventArgs e)
        {
            CmServer = CMServerName.Text;
            if (CmServer.Length.Equals(0))
            {
                CMSettingsStatusLabel.Content = "CM Settings: ❌";
                CreateClientsButton.Background = Brushes.PaleVioletRed;
                CreateClientsButton.IsEnabled = false;
            }
            {
                CMSettingsStatusLabel.Content = "CM Settings: ✔";
                CreateClientsButton.Background = Brushes.LawnGreen;
                CreateClientsButton.IsEnabled = true;
            }
        }

19 Source : AddServerForm.cs
with GNU General Public License v3.0
from 2dust

private void MenuItemImport(int type)
        {
            ClearServer();

            OpenFileDialog fileDialog = new OpenFileDialog
            {
                Multiselect = false,
                Filter = "Config|*.json|All|*.*"
            };
            if (fileDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            string fileName = fileDialog.FileName;
            if (Utils.IsNullOrEmpty(fileName))
            {
                return;
            }
            string msg;
            VmessItem vmessItem;
            if (type.Equals(1))
            {
                vmessItem = V2rayConfigHandler.ImportFromClientConfig(fileName, out msg);
            }
            else
            {
                vmessItem = V2rayConfigHandler.ImportFromServerConfig(fileName, out msg);
            }
            if (vmessItem == null)
            {
                UI.ShowWarning(msg);
                return;
            }

            txtAddress.Text = vmessItem.address;
            txtPort.Text = vmessItem.port.ToString();
            txtId.Text = vmessItem.id;
            txtAlterId.Text = vmessItem.alterId.ToString();
            txtRemarks.Text = vmessItem.remarks;
            cmbNetwork.Text = vmessItem.network;
            cmbHeaderType.Text = vmessItem.headerType;
            txtRequestHost.Text = vmessItem.requestHost;
            txtPath.Text = vmessItem.path;
            cmbStreamSecurity.Text = vmessItem.streamSecurity;
        }

19 Source : JsonData.cs
with MIT License
from 404Lcc

public bool Equals (JsonData x)
        {
            if (x == null)
                return false;

            if (x.type != this.type)
                return false;

            switch (this.type) {
            case JsonType.None:
                return true;

            case JsonType.Object:
                return this.inst_object.Equals (x.inst_object);

            case JsonType.Array:
                return this.inst_array.Equals (x.inst_array);

            case JsonType.String:
                return this.inst_string.Equals (x.inst_string);

            case JsonType.Int:
                return this.inst_int.Equals (x.inst_int);

            case JsonType.Long:
                return this.inst_long.Equals (x.inst_long);

            case JsonType.Double:
                return this.inst_double.Equals (x.inst_double);

            case JsonType.Boolean:
                return this.inst_boolean.Equals (x.inst_boolean);
            }

            return false;
        }

19 Source : Form1.cs
with Apache License 2.0
from abaga129

public void ReceiveCallback(IAsyncResult asyncResult)
        {
            Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            try
            {
                StateObject state = (StateObject)asyncResult.AsyncState;
                client = state.client;
                int bytesRead = client.EndReceive(asyncResult);

                if(bytesRead.Equals(160))
                    SetPins(Encoding.ASCII.GetString(state.buffer, 0, bytesRead));

                string message = GetMessage();
                Send(client, message);

                if (continueRecv)
                {
                    client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state);
                }
                else
                {
                    client.Close();
                    StatusLabel.Text = "Disconnected From Server";
                }
            }
            catch (Exception E)
            {
                StatusLabel.Text = "Disconnected by Host";
            }
        }

19 Source : CustomQuickInfoProvider.cs
with MIT License
from Actipro

public override bool Equals(object obj) {
				LineNumberMarginContext context = obj as LineNumberMarginContext;
				if (context != null)
					return context.LineIndex.Equals(this.LineIndex);
				else
					return false;
			}

19 Source : BigDecimal.cs
with MIT License
from AdamWhiteHat

public bool Equals(BigDecimal other)
		{
			this.Normalize();
			other.Normalize();

			bool matchMantissa = this.Mantissa.Equals(other.Mantissa);
			bool matchExponent = this.Exponent.Equals(other.Exponent);
			bool matchSign = this.Sign.Equals(other.Sign);

			if (matchMantissa && matchExponent && matchSign)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

19 Source : ApiError.cs
with MIT License
from Adyen

public bool Equals(ApiError other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
                return false;

            return
                (
                    this.Status == other.Status ||
                  
                    this.Status.Equals(other.Status)
                ) &&
                (
                    this.ErrorCode == other.ErrorCode ||
                    this.ErrorCode != null &&
                    this.ErrorCode.Equals(other.ErrorCode)
                ) &&
                (
                    this.Message == other.Message ||
                    this.Message != null &&
                    this.Message.Equals(other.Message)
                ) &&
                (
                    this.ErrorType == other.ErrorType ||
                    this.ErrorType != null &&
                    this.ErrorType.Equals(other.ErrorType)
                ) &&
                (
                    this.PspReference == other.PspReference ||
                    this.PspReference != null &&
                    this.PspReference.Equals(other.PspReference)
                );
        }

19 Source : Enumeration.cs
with MIT License
from AleksandreJavakhishvili

public override bool Equals(object obj)
        {
            if (!(obj is Enumeration otherValue))
                return false;

            var typeMatches = GetType() == obj.GetType();
            var valueMatches = Id.Equals(otherValue.Id);

            return typeMatches && valueMatches;
        }

19 Source : StringFormatter.cs
with MIT License
from alexis-

public override bool Equals(object obj)
      {
        if (!(obj is ColumnInfo))
          return false;

        ColumnInfo ci = (ColumnInfo)obj;

        return Width.Equals(ci.Width) && Content.Equals(ci.Content) && Alignment.Equals(ci.Alignment) && WordWrappingMethod.Equals(ci.WordWrappingMethod);
      }

19 Source : AttributeMatcher.cs
with BSD 3-Clause "New" or "Revised" License
from Altinn

private static bool MatchInteger(string policyValue, string decisionRequestValue)
        {
            if (!int.TryParse(policyValue, out int policyInteger))
            {
                return false;
            }

            if (!int.TryParse(decisionRequestValue, out int contextInteger))
            {
                return false;
            }

            return policyInteger.Equals(contextInteger);
        }

19 Source : XacmlApply.cs
with BSD 3-Clause "New" or "Revised" License
from Altinn

private XacmlAttributeMatchResult EvaluateBagSize(ICollection<XacmlContextAttributes> contextAttributes, XacmlAttributeValue policyConditionAttributeValue, XacmlApply xacmlApply, XacmlAttributeDesignator attributeDesignator)
        {
            string applyfunction = xacmlApply.FunctionId.OriginalString;

            switch (applyfunction)
            {
                case XacmlConstants.AttributeBagFunction.TimeBagSize:
                case XacmlConstants.AttributeBagFunction.DateBagSize:
                case XacmlConstants.AttributeBagFunction.DateTimeBagSize:
                    int bagSize = this.GetBagSize(contextAttributes, attributeDesignator);
                    if (int.Parse(policyConditionAttributeValue.Value).Equals(bagSize))
                    {
                        return XacmlAttributeMatchResult.Match;
                    }

                    return XacmlAttributeMatchResult.BagSizeConditionFailed;
                default:
                    break;
            }

            return XacmlAttributeMatchResult.BagSizeConditionFailed;
        }

19 Source : InfoKeyword.cs
with BSD 3-Clause "New" or "Revised" License
from Altinn

public bool Equals(InfoKeyword other)
        {
            if (other is null)
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            return GetCollectionHashCode(this).Equals(GetCollectionHashCode(other));
        }

19 Source : TextsKeyword.cs
with BSD 3-Clause "New" or "Revised" License
from Altinn

public bool Equals(TextsKeyword other)
        {
            if (other is null)
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            return GetCollectionHashCode(this).Equals(GetCollectionHashCode(other));
        }

19 Source : Connection.cs
with MIT License
from amolines

public override string ToString()
        {
            var connectionString = new StringBuilder();
            var properties = Properties();
            var index = 1;
            foreach (var property in properties)
            {
                var key = property.GetCustomAttribute<ConnectionAttribute>().Property;
                var value = property.GetValue(this);

                connectionString.Append(index.Equals(properties.Count()) ? $"{key}={value}" : $"{key}={value};");
                index++;
            }
            return connectionString.ToString();
        }

19 Source : ListExtensions.cs
with MIT License
from amolines

public static bool IsEmpty<T>(this IList<T> list)
        {
            return list == null || list.Count.Equals(0);
        }

19 Source : VersionService.cs
with MIT License
from amolines

private async Task CreateVersion(Guid aggregateId, int number, long timeStamp)
        {
            var value = await CurrentVersion(aggregateId);
            if (value.Equals(-1))
            {
                var version = new Version(aggregateId, number, timeStamp);
                await _versionRepository.Create(version);
            }
            else
            {
                throw new VersionNotFoundException(aggregateId);
            }
        }

19 Source : VersionService.cs
with MIT License
from amolines

private async Task ChangeVersion(Guid aggregateId, int number, long timeStamp)
        {
            var value = await CurrentVersion(aggregateId);
            if (value.Equals(-1))
            {
                throw new VersionNotFoundException(aggregateId);
            }

            if (number > value)
            {
                await _versionRepository.Update(new Version(aggregateId, number, timeStamp));
            }
            else
            {
                throw new VersionInvalidException(aggregateId , value , number);
            }


        }

19 Source : DateTimeConvert.cs
with MIT License
from amolines

private DateTime Convert(string value)
        {
            if (!value.Length.Equals(8)) throw new InvalidCastConvertException(value, typeof(DateTime));
            if (value.Select(char.IsDigit).Count() < 8) throw new InvalidCastConvertException(value, typeof(DateTime));

            DateTime result;
            var year = int.Parse(value.Substring(0, 4));
            var month = int.Parse(value.Substring(4, 2));
            var day = int.Parse(value.Substring(6, 2));
            try
            {
                result = new DateTime(year, month, day);
            }
            catch
            {
                throw new InvalidCastConvertException(value, typeof(DateTime));
            }

            return result;
        }

19 Source : FilterCollectionFactoryExpression.cs
with MIT License
from amolines

protected override bool Validate()
        {
            var fields = Cache.GetFields<TMetaData>().Keys;
            var filters = Keys.Where(k => !k.Contains("_")).ToList();
            return filters.Distinct().Intersect(fields).Count().Equals(filters.Distinct().Count());
        }

19 Source : OperatorCollectionFactoryExpression.cs
with MIT License
from amolines

protected override bool Validate()
        {
            var fields = Cache.GetFields<TMetaData>().Keys;
            var filters = Keys
                .Where(k => !k.StartsWith("_") && k.Contains("_"))
                .Select(f => f.Split('_')[0]).Distinct()
                .ToArray();
            return filters.Distinct().Intersect(fields).Count().Equals(filters.Distinct().Count());
        }

19 Source : OrderByFactoryExpression.cs
with MIT License
from amolines

protected override bool Validate()
        {
            var isValid = false;

            var order = GetValue(OrderByReservedWords.KeyOrder);
            var sort = GetValue(OrderByReservedWords.KeySort);

            if (!order.Length.Equals(1) || !sort.Length.Equals(1)) return false;
            var sortValue = sort[0].Split(',');
            if (sortValue.Intersect(Cache.GetFields<TMetaData>().Keys).Count().Equals(sortValue.Count()))
            {
                isValid = true;
            }


            return isValid;
        }

19 Source : FactoryExpression.cs
with MIT License
from amolines

protected bool TryParseValue<T>(string key, TryParseHandler<T> handler, out T result)
            where T : struct
        {
            result = default;
            if (string.IsNullOrEmpty(key)) return false;
            if (!TryGetValue(key, out var values)) return false;
            return values.Length.Equals(1) && handler(values[0], out result);
        }

19 Source : FactoryExpression.cs
with MIT License
from amolines

protected T ParseValue<T>(string key, ParseHandler<T> handler)
            where T : struct
        {
            var values = GetValue(key);
            if (values.Length.Equals(1))
            {
                return handler(values[0]);
            }
            throw new InvalidCastException();
        }

19 Source : FactoryExpression.cs
with MIT License
from amolines

protected bool TryParseValues<T>(string key, TryParseHandler<T> handler, out T[] result)
            where T : struct
        {

            result = null;
            if (string.IsNullOrEmpty(key)) return false;
            if (!TryGetValue(key, out var values)) return false;

            var results = new List<T>();
            foreach (var v in values)
            {
                if (handler(v, out var value))
                    results.Add(value);
            }
            if (!values.Length.Equals(results.Count)) return false;

            result = results.ToArray();
            return true;

        }

19 Source : IntId.cs
with MIT License
from andrewlock

public bool Equals(IntId other) => this.Value.Equals(other.Value);

19 Source : LongId.cs
with MIT License
from andrewlock

public bool Equals(LongId other) => this.Value.Equals(other.Value);

19 Source : Enumeration.cs
with MIT License
from anjoy8

public override bool Equals(object obj)
        {
            var otherValue = obj as Enumeration;

            if (otherValue == null)
                return false;

            var typeMatches = GetType().Equals(obj.GetType());
            var valueMatches = Id.Equals(otherValue.Id);

            return typeMatches && valueMatches;
        }

19 Source : LetterGlyphTool.cs
with Apache License 2.0
from anmcgrath

public bool Equals(ColorGlyphKey other)
        {
            return FontColor.Equals(other.FontColor) && BackgroundColor.Equals(other.BackgroundColor) && Char == other.Char;
        }

19 Source : JsonData.cs
with MIT License
from AnotherEnd15

public bool Equals (JsonData x)
        {
            if (x == null)
                return false;

            if (x.type != this.type)
            {
                // further check to see if this is a long to int comparison
                if ((x.type != JsonType.Int && x.type != JsonType.Long)
                    || (this.type != JsonType.Int && this.type != JsonType.Long))
                {
                    return false;
                }
            }

            switch (this.type) {
            case JsonType.None:
                return true;

            case JsonType.Object:
                return this.inst_object.Equals (x.inst_object);

            case JsonType.Array:
                return this.inst_array.Equals (x.inst_array);

            case JsonType.String:
                return this.inst_string.Equals (x.inst_string);

            case JsonType.Int:
            {
                if (x.IsLong)
                {
                    if (x.inst_long < Int32.MinValue || x.inst_long > Int32.MaxValue)
                        return false;
                    return this.inst_int.Equals((int)x.inst_long);
                }
                return this.inst_int.Equals(x.inst_int);
            }

            case JsonType.Long:
            {
                if (x.IsInt)
                {
                    if (this.inst_long < Int32.MinValue || this.inst_long > Int32.MaxValue)
                        return false;
                    return x.inst_int.Equals((int)this.inst_long);
                }
                return this.inst_long.Equals(x.inst_long);
            }

            case JsonType.Double:
                return this.inst_double.Equals (x.inst_double);

            case JsonType.Boolean:
                return this.inst_boolean.Equals (x.inst_boolean);
            }

            return false;
        }

19 Source : VoxelSet.cs
with GNU General Public License v3.0
from artembakhanov

public bool RemovePoint(ulong id)
    {
        if (!IdIndexPairs.TryGetValue(id, out int index))
            return false;

        var key = GetKey(Points[index].Position);
        var vox = GetVoxelForEditing(key);
        //if (vox.Count == 1)
        //{
        //    Voxels.Remove(GetKey(Points[index].Position));
        //    VoxelVersions.Remove(GetKey(Points[index].Position));
        //}
        //else
        vox.Remove(index);

        int lastIndex = Points.Count - 1;
        if (lastIndex > 0 && lastIndex != index)
        {
            List<int> voxel = GetVoxelForEditing(Points[lastIndex].Position);

            voxel[voxel.FindIndex(i => i.Equals(lastIndex))] = index;
            IdIndexPairs[Points[lastIndex].Id] = index;
            Points[index] = Points[lastIndex];
        }

        IdIndexPairs.Remove(id);
        Points.RemoveAt(lastIndex);
        if (vox.Count == 0)
        {
            Voxels.Remove(key);
            //Voxels.Remove(GetKey(Points[index].Position));
            VoxelVersions.Remove(key);
        }
        return true;
    }

19 Source : VoxelSet1.cs
with GNU General Public License v3.0
from artembakhanov

public bool RemovePoint(ulong id)
        {
            if (!IdIndexPairs.TryGetValue(id, out int index))
                return false;

            GetVoxelForEditing(Points[index].Position).Remove(index);

            int lastIndex = Points.Count - 1;
            if (lastIndex > 0 && lastIndex != index)
            {
                List<int> voxel = GetVoxelForEditing(Points[lastIndex].Position);

                voxel[voxel.FindIndex(i => i.Equals(lastIndex))] = index;
                IdIndexPairs[Points[lastIndex].Id] = index;
                Points[index] = Points[lastIndex];
                Particles[index] = Particles[lastIndex];
            }

            IdIndexPairs.Remove(id);
            Points.RemoveAt(lastIndex);
            Particles.RemoveAt(lastIndex);

            return true;
        }

19 Source : BaseEntity.cs
with MIT License
from aspnetrun

public override bool Equals(object obj)
        {
            var compareTo = obj as BaseEnreplacedy;

            if (ReferenceEquals(this, compareTo)) return true;
            if (ReferenceEquals(null, compareTo)) return false;

            return Id.Equals(compareTo.Id);
        }

19 Source : ExpressionMapping.cs
with MIT License
from AutoMapper

[Fact]
        public void When_Using_Non_TypeMapped_Clreplaced_Method()
        {
            var year = DateTime.Now.Year;
            _predicateExpression = p => p.DateTime.Year.Equals(year);
            _valid = new Parent { DateTime = DateTime.Now };
        }

19 Source : IndexingPrimitives.cs
with MIT License
from azist

public bool Equals(IntBookmark other) => this.Value.Equals(other.Value) && this.Bookmark.Equals(other.Bookmark);

19 Source : AntTimelineComponent.cs
with MIT License
from bang88

protected string getLastCls(int index)
        {
            string lastCls = $"{prefixCls}-item-last";
            int _count = count; //  Pending != null ? count + 1 : count;
            return !reverse && Pending != null ? index.Equals(_count - 2) ? lastCls : "" : index.Equals(_count - 1) ? lastCls : "";

        }

19 Source : PhotonPlayer.cs
with MIT License
from bddckr

public bool Equals (PhotonPlayer other)
	{
		if ( other == null)
		{
			return false;
		}

		return this.GetHashCode().Equals(other.GetHashCode());
	}

19 Source : PhotonPlayer.cs
with MIT License
from bddckr

public bool Equals (int other)
	{
		return this.GetHashCode().Equals(other);
	}

19 Source : Microseconds32.cs
with MIT License
from bibigone

public bool Equals(Microseconds32 other)
            => ValueUsec.Equals(other.ValueUsec);

19 Source : Microseconds32.cs
with MIT License
from bibigone

public bool Equals(int otherUsec)
            => ValueUsec.Equals(otherUsec);

19 Source : BodyId.cs
with MIT License
from bibigone

public bool Equals(int other)
            => Value.Equals(other);

19 Source : FirmwareVersion.cs
with MIT License
from bibigone

public bool Equals(FirmwareVersion other)
            => Major.Equals(other.Major) && Minor.Equals(other.Minor) && Revision.Equals(other.Revision);

19 Source : Timeout.cs
with MIT License
from bibigone

public bool Equals(Timeout other)
            => ValueMs.Equals(other.ValueMs);

19 Source : Timeout.cs
with MIT License
from bibigone

public bool Equals(int otherMs)
            => ValueMs.Equals(otherMs);

19 Source : BodyId.cs
with MIT License
from bibigone

public bool Equals(BodyId other)
            => Value.Equals(other.Value);

19 Source : BancoCecred.CNAB400.cs
with MIT License
from BoletoNet

public string GerarDetalheRemessaCNAB400(Boleto boleto, ref int registro)
        {
            try
            {
                TRegistroEDI tregistroEdi = new TRegistroEDI();
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 1, 1, 0, "7", ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 2, 2, 0, Beneficiario.TipoCPFCNPJ("0"), ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 4, 14, 0, Beneficiario.CPFCNPJ, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 18, 4, 0, Beneficiario.ContaBancaria.Agencia, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 22, 1, 0, Beneficiario.ContaBancaria.DigitoAgencia, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 23, 8, 0, Beneficiario.ContaBancaria.Conta.PadRight(8, '0').Substring(0, 8), '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 31, 1, 0, Beneficiario.ContaBancaria.DigitoConta, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 32, 7, 0, "", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 39, 25, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 64, 17, 0, boleto.NossoNumero, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 81, 2, 0, "00", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 83, 2, 0, "00", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 85, 3, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 88, 1, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 89, 3, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 92, 3, 0, boleto.VariacaoCarteira, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 95, 1, 0, "0", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 96, 6, 0, "0", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 102, 5, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 107, 2, 0, boleto.Carteira, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 109, 2, 0, (int)boleto.Banco.Beneficiario.ContaBancaria.TipoImpressaoBoleto, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 111, 10, 0, boleto.NumeroDoreplacedento, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediDataDDMMAA___________, 121, 6, 0, boleto.DataVencimento, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, sbyte.MaxValue, 13, 2, boleto.Valorreplacedulo, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 140, 3, 0, "085", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 143, 4, 0, "0000", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 147, 1, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 148, 2, 0, (int)boleto.EspecieDoreplacedento, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 150, 1, 0, boleto.Aceite, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediDataDDMMAA___________, 151, 6, 0, boleto.DataProcessamento, ' '));
                string str1 = "";
                string str2 = "";
                int num;
                switch (boleto.CodigoProtesto)
                {
                    case TipoCodigoProtesto.NaoProtestar:
                        str1 = "00";
                        str2 = "0";
                        break;
                    case TipoCodigoProtesto.ProtestarDiasCorridos:
                        str1 = "06";
                        num = boleto.DiasProtesto;
                        str2 = num.ToString();
                        break;
                }
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 157, 2, 0, str1, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 159, 2, 0, "00", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 161, 13, 2, boleto.ValorJurosDia, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 174, 6, 0, "000000", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 180, 13, 2, boleto.ValorDesconto, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 193, 13, 0, "000000", '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 206, 13, 2, boleto.ValorAbatimento, '0'));
                string str3 = "02";
                string str4 = "02";
                num = Beneficiario.CPFCNPJ.Length;
                if (num.Equals(11))
                    str3 = "01";
                num = boleto.Pagador.CPFCNPJ.Length;
                if (num.Equals(11))
                    str4 = "01";
                else if (IsNullOrEmpty(boleto.Pagador.CPFCNPJ))
                    str4 = "00";
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 219, 2, 0, str4, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 221, 14, 0, boleto.Pagador.CPFCNPJ, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 235, 37, 0, boleto.Pagador.Nome.ToUpper(), ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 272, 3, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 275, 40, 0, boleto.Pagador.Endereco.LogradouroEndereco.ToUpper(), ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 315, 12, 0, boleto.Pagador.Endereco.Bairro.ToUpper(), ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 327, 8, 0, boleto.Pagador.Endereco.CEP, '0'));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 335, 15, 0, boleto.Pagador.Endereco.Cidade.ToUpper(), ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 350, 2, 0, boleto.Pagador.Endereco.UF.ToUpper(), ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 352, 40, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 392, 2, 0, str2, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediAlphaAliEsquerda_____, 394, 1, 0, Empty, ' '));
                tregistroEdi.CamposEDI.Add(new TCampoRegistroEDI(TTiposDadoEDI.ediNumericoSemSeparador_, 395, 6, 0, registro, '0'));
                tregistroEdi.CodificarLinha();
                return Utils.SubsreplaceduiCaracteresEspeciais(tregistroEdi.LinhaRegistro);
            }
            catch (Exception ex)
            {
                throw new Exception("Erro ao gerar DETALHE do arquivo CNAB400.", ex);
            }
        }

19 Source : Quality.cs
with GNU General Public License v3.0
from bonarr

public bool Equals(Quality other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Id.Equals(other.Id);
        }

19 Source : Revision.cs
with GNU General Public License v3.0
from bonarr

public bool Equals(Revision other)
        {
            if (ReferenceEquals(null, other)) return false;

            return other.Version.Equals(Version) && other.Real.Equals(Real);
        }

19 Source : WinApiRectangle.cs
with GNU Affero General Public License v3.0
from bonimy

public bool Equals(WinApiRectangle other)
        {
            return
                Left.Equals(other.Left) &&
                Top.Equals(other.Top) &&
                Right.Equals(other.Right) &&
                Bottom.Equals(other.Bottom);
        }

19 Source : Color15BppBgr.cs
with GNU Affero General Public License v3.0
from bonimy

public bool Equals(Color15BppBgr obj)
        {
            return ProperValue.Equals(obj.ProperValue);
        }

19 Source : Color32BppArgb.cs
with GNU Affero General Public License v3.0
from bonimy

public bool Equals(Color32BppArgb obj)
        {
            return Value.Equals(obj.Value);
        }

See More Examples