Example #1
0
        /// <summary>
        /// Builds this instance and retruns the underlying instrument associated with the controller
        /// </summary>
        /// <returns></returns>
        public Fra Build()
        {
            var fra = new Fra
            {
                fixingDateOffset      = FixingOffSet,
                fixedRate             = FixedRate,
                fixedRateSpecified    = true,
                adjustedEffectiveDate = new RequiredIdentifierDate {
                    Value = EffectiveDate
                },
                floatingRateIndex                = FloatingRateIndex,
                fraDiscounting                   = FraDiscounting,
                fraDiscountingSpecified          = true,
                adjustedTerminationDate          = TerminationDate,
                adjustedTerminationDateSpecified = true,
                dayCountFraction                 = DayCountFraction,
                notional   = Notional,
                indexTenor = IndexTenor,
                calculationPeriodNumberOfDays = NumberOfDays.ToString(CultureInfo.InvariantCulture),
                buyerPartyReference           =
                    PartyReferenceHelper.Parse("Party1"),
                sellerPartyReference =
                    PartyReferenceHelper.Parse("Party2"),
                paymentDate = AdjustablePaymentDate
            };
            var product = new ProductType {
                Value = ProductTypeSimpleEnum.FRA.ToString()
            };

            fra.Items            = new object[] { product };
            fra.ItemsElementName = new[] { ItemsChoiceType2.productType };
            return(fra);
        }
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Name: ");
            sb.AppendLine(Name);
            sb.Append("Number of days: ");
            sb.AppendLine(NumberOfDays.ToString());
            sb.AppendLine("Groups:");
            foreach (GroupSpec group in Groups)
            {
                sb.AppendLine(group.ToString());
            }
            return(sb.ToString());
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (NumberOfDays != null)
         {
             hashCode = hashCode * 59 + NumberOfDays.GetHashCode();
         }
         if (AgeOfFile != null)
         {
             hashCode = hashCode * 59 + AgeOfFile.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #4
0
 public override void LoadSettings()
 {
     try
     {
         if (!(Page.IsPostBack))
         {
             NumberOfDaysRadioButtons.SelectedValue    = NumberOfDays.ToString();
             NumberOfResultsRadioButtons.SelectedValue = NumberOfResults.ToString();
             PageSizeRadioButtons.SelectedValue        = PageSize.ToString();
             IncludeSearchTypeCheckBox.Checked         = IncludeSearchType;
             IncludeInfoCheckBox.Checked        = IncludeInfo;
             IncludeDescriptionCheckBox.Checked = IncludeDescription;
             IncludeBodyCheckBox.Checked        = IncludeBody;
             IncludeAuthorCheckBox.Checked      = IncludeAuthor;
             IncludeSnippetCheckBox.Checked     = IncludeSnippet;
         }
     }
     catch (Exception exc) //Module failed to load
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (NumberOfDays != 0)
            {
                hash ^= NumberOfDays.GetHashCode();
            }
            if (defaultReward_ != null)
            {
                hash ^= DefaultReward.GetHashCode();
            }
            hash ^= DailyRewards.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        /// <summary>
        /// Returns true if ComAdobeCqSocialCommonsMaintainanceImplDeleteTempUGCImageUploadProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComAdobeCqSocialCommonsMaintainanceImplDeleteTempUGCImageUploadProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComAdobeCqSocialCommonsMaintainanceImplDeleteTempUGCImageUploadProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     NumberOfDays == other.NumberOfDays ||
                     NumberOfDays != null &&
                     NumberOfDays.Equals(other.NumberOfDays)
                     ) &&
                 (
                     AgeOfFile == other.AgeOfFile ||
                     AgeOfFile != null &&
                     AgeOfFile.Equals(other.AgeOfFile)
                 ));
        }
Example #7
0
 private void NumberOfDaysArrow_Clicked(object sender, EventArgs e)
 {
     NumberOfDays.Focus();
 }
Example #8
0
        /// <summary>Writes documentation for this function by adding to the list of documentation tags.</summary>
        /// <param name="tags">The list of tags to add to.</param>
        /// <param name="headingLevel">The level (e.g. H2) of the headings.</param>
        /// <param name="indent">The level of indentation 1, 2, 3 etc.</param>
        public void Document(List <AutoDocumentation.ITag> tags, int headingLevel, int indent)
        {
            if (IncludeInDocumentation)
            {
                // add a heading.
                Name = this.Name;
                tags.Add(new AutoDocumentation.Heading(Name, headingLevel));
                if (Apsim.Children(this, typeof(IFunction)).Count == 1)
                {
                    tags.Add(new AutoDocumentation.Paragraph(Name + " is calculated from a moving average of " + (ChildFunction as IModel).Name + " over a series of " + NumberOfDays.ToString() + " days.", indent));
                }

                // write children.
                foreach (IModel child in Apsim.Children(this, typeof(IModel)))
                {
                    AutoDocumentation.DocumentModel(child, tags, headingLevel + 1, indent + 1);
                }
            }
        }
Example #9
0
        /// <summary>Writes documentation for this function by adding to the list of documentation tags.</summary>
        /// <param name="tags">The list of tags to add to.</param>
        /// <param name="headingLevel">The level (e.g. H2) of the headings.</param>
        /// <param name="indent">The level of indentation 1, 2, 3 etc.</param>
        public override void Document(List <AutoDocumentation.ITag> tags, int headingLevel, int indent)
        {
            // add a heading.
            Name = this.Name;
            tags.Add(new AutoDocumentation.Heading(Name, headingLevel));
            tags.Add(new AutoDocumentation.Paragraph(Name + " is calculated from a moving sum of " + (ChildFunction as IModel).Name + " over a series of " + NumberOfDays.ToString() + " days.", indent));

            // write children.
            foreach (IModel child in Apsim.Children(this, typeof(IModel)))
            {
                child.Document(tags, headingLevel + 1, indent + 1);
            }
        }