Exemple #1
0
        private void ListenForData(ref ImmutableList <Client> clients)
        {
            if (clients.Equals(null))
            {
                return;
            }



            while (true)
            {
                try
                {
                    foreach (Client client in clients)
                    {
                        var ns = client.Tcp.GetStream();

                        if (ns.CanRead && ns.DataAvailable && client.Available)
                        {
                            // Read Data in current thread OR make new thread read and handle Data?

                            client.Available = false;
                            ThreadPool.QueueUserWorkItem(o => HandleClientRequests(client));
                        }
                    }
                }
                catch (Exception ex)
                {
                    AppendText($"Exception caught: {ex.Message}");
                }
            }
        }
 /// <summary>
 /// Returns an instance with the specified sensitivity array added to the array in this instance.
 /// <para>
 /// The specified instance must have the same name, metadata and parameter split as this instance.
 ///
 /// </para>
 /// </summary>
 /// <param name="otherSensitivty">  the other parameter sensitivity </param>
 /// <returns> an instance based on this one, with the other instance added </returns>
 /// <exception cref="IllegalArgumentException"> if the market data name, metadata or parameter split differs </exception>
 public UnitParameterSensitivity plus(UnitParameterSensitivity otherSensitivty)
 {
     if (!marketDataName.Equals(otherSensitivty.marketDataName) || !parameterMetadata.Equals(otherSensitivty.parameterMetadata) || (parameterSplit != null && !parameterSplit.Equals(otherSensitivty.parameterSplit)))
     {
         throw new System.ArgumentException("Two sensitivity instances can only be added if name, metadata and split are equal");
     }
     return(plus(otherSensitivty.Sensitivity));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Checks if this CSV file equals another.
 /// <para>
 /// The comparison checks the content.
 ///
 /// </para>
 /// </summary>
 /// <param name="obj">  the other file, null returns false </param>
 /// <returns> true if equal </returns>
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj is CsvFile)
     {
         CsvFile other = (CsvFile)obj;
         return(headers_Renamed.Equals(other.headers_Renamed) && rows_Renamed.Equals(other.rows_Renamed));
     }
     return(false);
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Checks if this CSV file equals another.
 /// <para>
 /// The comparison checks the content.
 ///
 /// </para>
 /// </summary>
 /// <param name="obj">  the other file, null returns false </param>
 /// <returns> true if equal </returns>
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj is CsvRow)
     {
         CsvRow other = (CsvRow)obj;
         return(headers_Renamed.Equals(other.headers_Renamed) && fields_Renamed.Equals(other.fields_Renamed));
     }
     return(false);
 }
Exemple #5
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || GetType() != o.GetType())
            {
                return(false);
            }

            DatasetWithFilledAutofillFields that = (DatasetWithFilledAutofillFields)o;

            if (autofillDataset != null ? !autofillDataset.Equals(that.autofillDataset) :
                that.autofillDataset != null)
            {
                return(false);
            }
            return(filledAutofillFields != null?
                   filledAutofillFields.Equals(that.filledAutofillFields) :
                       that.filledAutofillFields == null);
        }
Exemple #6
0
 protected bool Equals(AbstractColumnData <T> other)
 {
     return(_values.Equals(other._values));
 }
Exemple #7
0
 protected bool Equals(ModifiedSequence other)
 {
     return(string.Equals(_unmodifiedSequence, other._unmodifiedSequence) &&
            _explicitMods.Equals(other._explicitMods) && _defaultMassType == other._defaultMassType);
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Checks if this element equals another.
 /// <para>
 /// This compares the entire state of the element, including all children.
 ///
 /// </para>
 /// </summary>
 /// <param name="obj">  the other element, null returns false </param>
 /// <returns> true if equal </returns>
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj is XmlElement)
     {
         XmlElement other = (XmlElement)obj;
         return(name.Equals(other.name) && Objects.Equals(content, other.content) && attributes.Equals(other.attributes) && children.Equals(other.children));
     }
     return(false);
 }