当前位置: 首页>>代码示例>>C#>>正文


C# Service.CreateRequest方法代码示例

本文整理汇总了C#中Service.CreateRequest方法的典型用法代码示例。如果您正苦于以下问题:C# Service.CreateRequest方法的具体用法?C# Service.CreateRequest怎么用?C# Service.CreateRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Service的用法示例。


在下文中一共展示了Service.CreateRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToRequest

        internal Request ToRequest(Service refDataService)
        {
            var request = refDataService.CreateRequest(OperationNames.IntradayBarRequest);

            request.Set(ElementNames.Security, Ticker);
            request.Set(ElementNames.StartDateTime, new Datetime(StartDateTime.Year, StartDateTime.Month, StartDateTime.Day, StartDateTime.Hour, StartDateTime.Minute, StartDateTime.Second, StartDateTime.Millisecond));
            request.Set(ElementNames.EndDateTime, new Datetime(EndDateTime.Year, EndDateTime.Month, EndDateTime.Day, EndDateTime.Hour, EndDateTime.Minute, EndDateTime.Second, EndDateTime.Millisecond));
            request.Set(ElementNames.EventType, EventType.ToString());
            if (Interval.HasValue)
                request.Set(ElementNames.Interval, Interval.Value);
            if (GapFillInitialBar.HasValue)
                request.Set(ElementNames.GapFillInitialBar, GapFillInitialBar.Value);
            if (ReturnEids.HasValue)
                request.Set(ElementNames.ReturnEids, ReturnEids.Value);
            if (ReturnRelativeDate.HasValue)
                request.Set(ElementNames.ReturnRelativeDate, ReturnRelativeDate.Value);
            if (AdjustmentNormal.HasValue)
                request.Set(ElementNames.AdjustmentNormal, AdjustmentNormal.Value);
            if (AdjustmentAbnormal.HasValue)
                request.Set(ElementNames.AdjustmentAbnormal, AdjustmentAbnormal.Value);
            if (AdjustmentSplit.HasValue)
                request.Set(ElementNames.AdjustmentSplit, AdjustmentSplit.Value);
            if (AdjustmentFollowDPDF.HasValue)
                request.Set(ElementNames.AdjustmentFollowDPDF, AdjustmentFollowDPDF.Value);

            return request;
        }
开发者ID:rob-blackbourn,项目名称:JetBlack.Bloomberg,代码行数:27,代码来源:IntradayBarRequest.cs

示例2: ToRequest

        internal Request ToRequest(Service refDataService)
        {
            var request = refDataService.CreateRequest(OperationNames.HistoricalDataRequest);

            foreach (var ticker in Tickers)
                request.Append(ElementNames.Securities, ticker);

            foreach (var field in Fields)
                request.Append(ElementNames.Fields, field);

            request.Set(ElementNames.StartDate, StartDate.ToString("yyyyMMdd"));
            request.Set(ElementNames.EndDate, EndDate.ToString("yyyyMMdd"));
            request.Set(ElementNames.PeriodicitySelection, PeriodicitySelection.ToString());
            request.Set(ElementNames.PeriodicityAdjustment, PeriodicityAdjustment.ToString());
            if (!string.IsNullOrEmpty(Currency))
                request.Set(ElementNames.Currency, Currency);
            if (OverrideOption.HasValue)
                request.Set(ElementNames.OverrideOption, OverrideOption.Value.ToString());
            if (PricingOption.HasValue)
                request.Set(ElementNames.PricingOption, PricingOption.Value.ToString());
            if (NonTradingDayFillOption.HasValue)
                request.Set(ElementNames.NonTradingDayFillOption, NonTradingDayFillOption.Value.ToString());
            if (NonTradingDayFillMethod.HasValue)
                request.Set(ElementNames.NonTradingDayFillMethod, NonTradingDayFillMethod.Value.ToString());
            if (MaxDataPoints.HasValue)
                request.Set(ElementNames.MaxDataPoints, MaxDataPoints.Value);
            if (ReturnEids.HasValue)
                request.Set(ElementNames.ReturnEids, ReturnEids.Value);
            if (ReturnRelativeDate.HasValue)
                request.Set(ElementNames.ReturnRelativeDate, ReturnRelativeDate.Value);
            if (AdjustmentNormal.HasValue)
                request.Set(ElementNames.AdjustmentNormal, AdjustmentNormal.Value);
            if (AdjustmentAbnormal.HasValue)
                request.Set(ElementNames.AdjustmentAbnormal, AdjustmentAbnormal.Value);
            if (AdjustmentSplit.HasValue)
                request.Set(ElementNames.AdjustmentSplit, AdjustmentSplit.Value);
            if (AdjustmentFollowDpdf.HasValue)
                request.Set(ElementNames.AdjustmentFollowDPDF, AdjustmentFollowDpdf.Value);
            if (CalendarCodeOverride.HasValue)
                request.Set(ElementNames.CalendarCodeOverride, CalendarCodeOverride.Value);

            if (Overrides != null)
            {
                foreach (var pair in Overrides)
                {
                    var requestOverride = request[ElementNames.Overrides].AppendElement();
                    requestOverride.SetElement(ElementNames.FieldId, pair.Key);
                    requestOverride.SetElement(ElementNames.Value, pair.Value);
                }
            }

            return request;
        }
开发者ID:rob-blackbourn,项目名称:JetBlack.Bloomberg,代码行数:53,代码来源:HistoricalDataRequest.cs

示例3: ToRequest

        internal Request ToRequest(Service refDataService)
        {
            var request = refDataService.CreateRequest(OperationNames.IntradayTickRequest);
            request.Set(ElementNames.Security, Ticker);

            foreach (var eventType in EventTypes)
                request.Append(ElementNames.EventTypes, eventType.ToString());

            request.Set(ElementNames.StartDateTime, new Datetime(StartDateTime.Year, StartDateTime.Month, StartDateTime.Day, StartDateTime.Hour, StartDateTime.Minute, StartDateTime.Second, StartDateTime.Millisecond));
            request.Set(ElementNames.EndDateTime, new Datetime(EndDateTime.Year, EndDateTime.Month, EndDateTime.Day, EndDateTime.Hour, EndDateTime.Minute, EndDateTime.Second, EndDateTime.Millisecond));
            if (IncludeBrokerCodes.HasValue)
                request.Set(ElementNames.IncludeBrokerCodes, IncludeBrokerCodes.Value);
            if (IncludeConditionCodes.HasValue)
                request.Set(ElementNames.IncludeConditionCodes, IncludeConditionCodes.Value);
            if (IncludeExchangeCodes.HasValue)
                request.Set(ElementNames.IncludeExchangeCodes, IncludeExchangeCodes.Value);
            if (IncludeNonPlottableEvents.HasValue)
                request.Set(ElementNames.IncludeNonPlottableEvents, IncludeNonPlottableEvents.Value);
            if (IncludeRpsCodes.HasValue)
                request.Set(ElementNames.IncludeRpsCodes, IncludeRpsCodes.Value);
            if (ReturnEids.HasValue)
                request.Set(ElementNames.ReturnEids, ReturnEids.Value);
            return request;
        }
开发者ID:rob-blackbourn,项目名称:JetBlack.Bloomberg,代码行数:24,代码来源:IntradayTickRequest.cs

示例4: Button1_Click

 protected void Button1_Click(object sender, EventArgs e)
 {
     string filename = TextBox1.Text;
     Service mysr = new Service();
     Label9.Text = mysr.CreateRequest(filename);
 }
开发者ID:nguy2261,项目名称:codingChallenge,代码行数:6,代码来源:ServiceUI.aspx.cs

示例5: OpenSession

 /// <summary>
 /// Etablie la connection avec Bloomberg
 /// </summary>
 private void OpenSession()
 {
     sessionOptions = new SessionOptions();
     sessionOptions.ServerHost = "localhost";
     sessionOptions.ServerPort = 8194;
     session = new Session(sessionOptions);
     l_title = new List<Title>();
     if (!session.Start())
     {
         System.Console.WriteLine("Could not start session.");
         Console.WriteLine(session.ToString());
         Remplissage_Non_connection();
         return;
     }
     if (!session.OpenService("//blp/refdata"))
     {
         System.Console.WriteLine("Could not open service " +
         "//blp/refdata");
         return;
     }
     refDataSvc = session.GetService("//blp/refdata");
     if (refDataSvc == null)
     {
         Console.WriteLine("Cannot get service");
         return;
     }
     else
     {
         request = refDataSvc.CreateRequest("ReferenceDataRequest");
     }
 }
开发者ID:TigerSCR,项目名称:TigerAppWPF,代码行数:34,代码来源:Connector.cs


注:本文中的Service.CreateRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。