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
19
View Source File : MainWindow.xaml.cs
License : GNU General Public License v3.0
Project Creator : 1RedOne
License : GNU General Public License v3.0
Project Creator : 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
View Source File : AddServerForm.cs
License : GNU General Public License v3.0
Project Creator : 2dust
License : GNU General Public License v3.0
Project Creator : 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
View Source File : JsonData.cs
License : MIT License
Project Creator : 404Lcc
License : MIT License
Project Creator : 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
View Source File : Form1.cs
License : Apache License 2.0
Project Creator : abaga129
License : Apache License 2.0
Project Creator : 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
View Source File : CustomQuickInfoProvider.cs
License : MIT License
Project Creator : Actipro
License : MIT License
Project Creator : 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
View Source File : BigDecimal.cs
License : MIT License
Project Creator : AdamWhiteHat
License : MIT License
Project Creator : 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
View Source File : ApiError.cs
License : MIT License
Project Creator : Adyen
License : MIT License
Project Creator : 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
View Source File : Enumeration.cs
License : MIT License
Project Creator : AleksandreJavakhishvili
License : MIT License
Project Creator : 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
View Source File : StringFormatter.cs
License : MIT License
Project Creator : alexis-
License : MIT License
Project Creator : 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
View Source File : AttributeMatcher.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : Altinn
License : BSD 3-Clause "New" or "Revised" License
Project Creator : 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
View Source File : XacmlApply.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : Altinn
License : BSD 3-Clause "New" or "Revised" License
Project Creator : 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
View Source File : InfoKeyword.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : Altinn
License : BSD 3-Clause "New" or "Revised" License
Project Creator : 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
View Source File : TextsKeyword.cs
License : BSD 3-Clause "New" or "Revised" License
Project Creator : Altinn
License : BSD 3-Clause "New" or "Revised" License
Project Creator : 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
View Source File : Connection.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : ListExtensions.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : amolines
public static bool IsEmpty<T>(this IList<T> list)
{
return list == null || list.Count.Equals(0);
}
19
View Source File : VersionService.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : VersionService.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : DateTimeConvert.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : FilterCollectionFactoryExpression.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : OperatorCollectionFactoryExpression.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : OrderByFactoryExpression.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : FactoryExpression.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : FactoryExpression.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : FactoryExpression.cs
License : MIT License
Project Creator : amolines
License : MIT License
Project Creator : 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
View Source File : IntId.cs
License : MIT License
Project Creator : andrewlock
License : MIT License
Project Creator : andrewlock
public bool Equals(IntId other) => this.Value.Equals(other.Value);
19
View Source File : LongId.cs
License : MIT License
Project Creator : andrewlock
License : MIT License
Project Creator : andrewlock
public bool Equals(LongId other) => this.Value.Equals(other.Value);
19
View Source File : Enumeration.cs
License : MIT License
Project Creator : anjoy8
License : MIT License
Project Creator : 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
View Source File : LetterGlyphTool.cs
License : Apache License 2.0
Project Creator : anmcgrath
License : Apache License 2.0
Project Creator : anmcgrath
public bool Equals(ColorGlyphKey other)
{
return FontColor.Equals(other.FontColor) && BackgroundColor.Equals(other.BackgroundColor) && Char == other.Char;
}
19
View Source File : JsonData.cs
License : MIT License
Project Creator : AnotherEnd15
License : MIT License
Project Creator : 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
View Source File : VoxelSet.cs
License : GNU General Public License v3.0
Project Creator : artembakhanov
License : GNU General Public License v3.0
Project Creator : 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
View Source File : VoxelSet1.cs
License : GNU General Public License v3.0
Project Creator : artembakhanov
License : GNU General Public License v3.0
Project Creator : 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
View Source File : BaseEntity.cs
License : MIT License
Project Creator : aspnetrun
License : MIT License
Project Creator : 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
View Source File : ExpressionMapping.cs
License : MIT License
Project Creator : AutoMapper
License : MIT License
Project Creator : 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
View Source File : IndexingPrimitives.cs
License : MIT License
Project Creator : azist
License : MIT License
Project Creator : azist
public bool Equals(IntBookmark other) => this.Value.Equals(other.Value) && this.Bookmark.Equals(other.Bookmark);
19
View Source File : AntTimelineComponent.cs
License : MIT License
Project Creator : bang88
License : MIT License
Project Creator : 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
View Source File : PhotonPlayer.cs
License : MIT License
Project Creator : bddckr
License : MIT License
Project Creator : bddckr
public bool Equals (PhotonPlayer other)
{
if ( other == null)
{
return false;
}
return this.GetHashCode().Equals(other.GetHashCode());
}
19
View Source File : PhotonPlayer.cs
License : MIT License
Project Creator : bddckr
License : MIT License
Project Creator : bddckr
public bool Equals (int other)
{
return this.GetHashCode().Equals(other);
}
19
View Source File : Microseconds32.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(Microseconds32 other)
=> ValueUsec.Equals(other.ValueUsec);
19
View Source File : Microseconds32.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(int otherUsec)
=> ValueUsec.Equals(otherUsec);
19
View Source File : BodyId.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(int other)
=> Value.Equals(other);
19
View Source File : FirmwareVersion.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(FirmwareVersion other)
=> Major.Equals(other.Major) && Minor.Equals(other.Minor) && Revision.Equals(other.Revision);
19
View Source File : Timeout.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(Timeout other)
=> ValueMs.Equals(other.ValueMs);
19
View Source File : Timeout.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(int otherMs)
=> ValueMs.Equals(otherMs);
19
View Source File : BodyId.cs
License : MIT License
Project Creator : bibigone
License : MIT License
Project Creator : bibigone
public bool Equals(BodyId other)
=> Value.Equals(other.Value);
19
View Source File : BancoCecred.CNAB400.cs
License : MIT License
Project Creator : BoletoNet
License : MIT License
Project Creator : 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
View Source File : Quality.cs
License : GNU General Public License v3.0
Project Creator : bonarr
License : GNU General Public License v3.0
Project Creator : bonarr
public bool Equals(Quality other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Id.Equals(other.Id);
}
19
View Source File : Revision.cs
License : GNU General Public License v3.0
Project Creator : bonarr
License : GNU General Public License v3.0
Project Creator : bonarr
public bool Equals(Revision other)
{
if (ReferenceEquals(null, other)) return false;
return other.Version.Equals(Version) && other.Real.Equals(Real);
}
19
View Source File : WinApiRectangle.cs
License : GNU Affero General Public License v3.0
Project Creator : bonimy
License : GNU Affero General Public License v3.0
Project Creator : bonimy
public bool Equals(WinApiRectangle other)
{
return
Left.Equals(other.Left) &&
Top.Equals(other.Top) &&
Right.Equals(other.Right) &&
Bottom.Equals(other.Bottom);
}
19
View Source File : Color15BppBgr.cs
License : GNU Affero General Public License v3.0
Project Creator : bonimy
License : GNU Affero General Public License v3.0
Project Creator : bonimy
public bool Equals(Color15BppBgr obj)
{
return ProperValue.Equals(obj.ProperValue);
}
19
View Source File : Color32BppArgb.cs
License : GNU Affero General Public License v3.0
Project Creator : bonimy
License : GNU Affero General Public License v3.0
Project Creator : bonimy
public bool Equals(Color32BppArgb obj)
{
return Value.Equals(obj.Value);
}
See More Examples