コード例 #1
0
ファイル: FraPricer.cs プロジェクト: zhangz/Highlander.Net
        /// <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);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
ファイル: Settings.ascx.cs プロジェクト: MaiklT/SiteNews
 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);
     }
 }
コード例 #4
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);
                }
            }
        }
コード例 #5
0
ファイル: MovingSum.cs プロジェクト: oseledets/ApsimX
        /// <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);
            }
        }