• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IApi类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IApi的典型用法代码示例。如果您正苦于以下问题:C# IApi类的具体用法?C# IApi怎么用?C# IApi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IApi类属于命名空间,在下文中一共展示了IApi类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Ping

 public Ping(AlgorithmManager algorithmManager, IApi api, IResultHandler resultHandler)
 {
     _api = api;
     _resultHandler = resultHandler;
     _algorithmManager = algorithmManager;
     _exitEvent = new ManualResetEventSlim(false);
 }
开发者ID:rchien,项目名称:Lean,代码行数:7,代码来源:StateCheck.cs


示例2: InternetToDataBase

 public InternetToDataBase(UserToCreate user, IApi VkClient)
 {
     vkClient = VkClient;
     this.token = user.token;
     this.URL = "https://vk.com/id" + user.vk_id;
     this.user = user;
 }
开发者ID:klusha,项目名称:VK,代码行数:7,代码来源:InternetToDataBase.cs


示例3: Init

        public void Init(IApi api, string dllpath)
        {
            _api = api;
            _dllpath = dllpath;
            try
            {
                _ini = new IniParser(_configPath);
            }
            catch (Exception ex)
            {
                throw new WebLoggerException(String.Format("Error loading config: {0}", ex.Message));
            }

            _enabled = _ini.GetBoolSetting("WebLogger", "Enabled");
            if (!_enabled)
                throw new WebLoggerException(String.Format("{0} has been disabled", Name));

            var url = _ini.GetSetting("WebLogger", "URL");
            if (!Uri.TryCreate(url, UriKind.Absolute, out _uri))
            {
                throw new WebLoggerException(String.Format("Error parsing url: {0}", url));
            }

            _worker = new Thread(ProcessQueue);
            _worker.Start();
            _api.OnBeMessageReceivedEvent += MessageEventHandler;
        }
开发者ID:josemaripl,项目名称:MBCon,代码行数:27,代码来源:WebLogger.cs


示例4: CreateUnlitShader

 public static Handle CreateUnlitShader(IApi api)
 {
     var shaderFormat = api.gfx_GetRuntimeShaderFormat ();
     var shaderDecl = GetUnlitShaderDeclaration ();
     var shaderSource = GetUnlitShaderSource (shaderFormat);
     return api.gfx_CreateShader (shaderDecl, shaderFormat, shaderSource);
 }
开发者ID:dreamsxin,项目名称:engine-1,代码行数:7,代码来源:Data.cs


示例5: CreateCheckerboardTexture

        public static Handle CreateCheckerboardTexture(IApi api)
        {
            Int32 texSize = 256;
            Int32 gridSize = 4;
            Int32 squareSize = texSize / gridSize;

            var colours = new Rgba32 [gridSize*gridSize];

            for (Int32 x = 0; x < gridSize; ++x)
            {
                for (Int32 y = 0; y < gridSize; ++y)
                {
                    colours [x + (y * gridSize)] = RandomColours.GetNext ();
                }
            }

            var texData = new byte[texSize*texSize*4];

            Int32 index = 0;
            for (Int32 x = 0; x < texSize; ++x)
            {
                for (Int32 y = 0; y < texSize; ++y)
                {
                    texData [index++] = colours[(x/squareSize) + (y/squareSize*gridSize)].A;
                    texData [index++] = colours[(x/squareSize) + (y/squareSize*gridSize)].R;
                    texData [index++] = colours[(x/squareSize) + (y/squareSize*gridSize)].G;
                    texData [index++] = colours[(x/squareSize) + (y/squareSize*gridSize)].B;
                }
            }

            return api.gfx_CreateTexture (TextureFormat.Rgba32, texSize, texSize, texData);
        }
开发者ID:dreamsxin,项目名称:engine-1,代码行数:32,代码来源:Data.cs


示例6: Initialize

 public void Initialize(AlgorithmNodePacket job,
     IMessagingHandler messagingHandler,
     IApi api,
     IDataFeed dataFeed,
     ISetupHandler setupHandler,
     ITransactionHandler transactionHandler)
 {
     _job = job;
 }
开发者ID:tremblayEric,项目名称:LeanHistory,代码行数:9,代码来源:TestResultHandler.cs


示例7: PanelSpecification

 internal PanelSpecification(IApi platform)
 {
     panelPhysicalSize = platform.sys_GetPrimaryPanelPhysicalSize ();
     panelPhysicalAspectRatio =
         panelPhysicalSize.HasValue
             ? (Single) panelPhysicalSize.Value.X / (Single) panelPhysicalSize.Value.Y
             : (Single?) null;
     panelType = platform.sys_GetPrimaryPanelType ();
 }
开发者ID:dreamsxin,项目名称:engine-1,代码行数:9,代码来源:PanelSpecification.cs


示例8: Ping

 public Ping(AlgorithmManager algorithmManager, IApi api, IResultHandler resultHandler, IMessagingHandler messagingHandler, AlgorithmNodePacket job)
 {
     _api = api;
     _job = job;
     _resultHandler = resultHandler;
     _messagingHandler = messagingHandler;
     _algorithmManager = algorithmManager;
     _exitEvent = new ManualResetEventSlim(false);
 }
开发者ID:tremblayEric,项目名称:LeanHistory,代码行数:9,代码来源:StateCheck.cs


示例9: DefaultBrokerageMessageHandler

 /// <summary>
 /// Initializes a new instance of the <see cref="DefaultBrokerageMessageHandler"/> class
 /// </summary>
 /// <param name="algorithm">The running algorithm</param>
 /// <param name="job">The job that produced the algorithm</param>
 /// <param name="api">The api for the algorithm</param>
 /// <param name="initialDelay"></param>
 /// <param name="openThreshold">Defines how long before market open to re-check for brokerage reconnect message</param>
 public DefaultBrokerageMessageHandler(IAlgorithm algorithm, AlgorithmNodePacket job, IApi api, TimeSpan? initialDelay = null, TimeSpan? openThreshold = null)
 {
     _api = api;
     _job = job;
     _algorithm = algorithm;
     _connected = true;
     _openThreshold = openThreshold ?? DefaultOpenThreshold;
     _initialDelay = initialDelay ?? DefaultInitialDelay;
 }
开发者ID:AlexCatarino,项目名称:Lean,代码行数:17,代码来源:DefaultBrokerageMessageHandler.cs


示例10: Platform

        public Platform(IApi api)
        {
            this.api = api;

            this.audio = new Audio (api);
            this.graphics = new Graphics (api);
            this.resources = new Resources (api);
            this.status = new Status (api);
            this.input = new Input (api);
            this.host = new Host (api);
        }
开发者ID:dreamsxin,项目名称:engine-1,代码行数:11,代码来源:Platform.cs


示例11: BaseApiRequest

		//[Inject]
		//public TraceSource Trace { get; set; }

		public BaseApiRequest(IApi Api, IDataExtractor DataExtractor)
		{
			api = Api;
			dataExtractor = DataExtractor;

			requestParams = new Dictionary<string, Dictionary<string, string>>();
			objectTypeForMethods = new Dictionary<string, Type>();
			batchSizes = new Dictionary<string, int>();
			itemsMaxCounts = new Dictionary<string, int>();
			requestTypes = new Dictionary<string, ApiRequestType>();
		}
开发者ID:NewMediaCenterMoscow,项目名称:UniSocial2,代码行数:14,代码来源:BaseApiRequest.cs


示例12: Input

        internal Input(IApi platform)
        {
            this.platform = platform;

            this.Xbox360Gamepad = humanInputDevices.AddEx (new Xbox360Gamepad (PlayerIndex.One));
            this.PsmGamepad = humanInputDevices.AddEx (new PsmGamepad ());
            this.MultiTouchController = humanInputDevices.AddEx (new MultiTouchController ());
            this.Mouse = humanInputDevices.AddEx (new Mouse ());
            this.Keyboard = humanInputDevices.AddEx (new Keyboard ());
            this.GenericGamepad = new GenericGamepad ();
        }
开发者ID:gitter-badger,项目名称:blimey,代码行数:11,代码来源:Input.cs


示例13: VkApiRequest

        public VkApiRequest(IApi Api, IDataExtractor DataExtractor)
            : base(Api, DataExtractor)
        {
            objectTypeForMethods.Add("groups.getById", typeof(VkGroup));
            objectTypeForMethods.Add("groups.getMembers", typeof(long));
            objectTypeForMethods.Add("groups.get", typeof(long));
            objectTypeForMethods.Add("users.getSubscriptions", typeof(VkUserSubscriptions));
            objectTypeForMethods.Add("users.get", typeof(VkUser));
            objectTypeForMethods.Add("wall.get", typeof(VkPost));
            objectTypeForMethods.Add("wall.getReposts", typeof(VkPost));
            objectTypeForMethods.Add("friends.get", typeof(long));
            objectTypeForMethods.Add("wall.getComments", typeof(VkComment));

            requestTypes.Add("groups.getById", ApiRequestType.ListObjectsInfo);
            requestTypes.Add("groups.getMembers", ApiRequestType.ListForObject);
            requestTypes.Add("groups.get", ApiRequestType.ListForObject);
            requestTypes.Add("users.getSubscriptions", ApiRequestType.ObjectInfo);
            requestTypes.Add("users.get", ApiRequestType.ListObjectsInfo);
            requestTypes.Add("wall.get", ApiRequestType.ListForObject);
            requestTypes.Add("wall.getReposts", ApiRequestType.ListForObject);
            requestTypes.Add("friends.get", ApiRequestType.ListForObject);
            requestTypes.Add("wall.getComments", ApiRequestType.ListForObject);

            requestParams.Add("groups.getById", new Dictionary<string, string>() {
                { "fields", "members_count" }
            });
            //requestParams.Add("groups.get",
            //	new ApiRequestParam(new Dictionary<string, string>() {
            //		{ "filter", "moder" }
            //	})
            //);
            requestParams.Add("users.get", new Dictionary<string, string>() {
                { "fields", "education,contacts,nickname, screen_name, sex, bdate, city, country, timezone, photo_50, photo_100, photo_200, photo_max, has_mobile, online" }
            });
            requestParams.Add("wall.get", new Dictionary<string, string>() {
                { "filter", "all" }
            });
            requestParams.Add("wall.getComments", new Dictionary<string, string>() {
                { "need_likes", "1" }
            });

            itemsMaxCounts.Add("groups.getMembers", 1000);
            itemsMaxCounts.Add("groups.get", 1000);
            itemsMaxCounts.Add("wall.get", 100);
            itemsMaxCounts.Add("wall.getReposts", 1000);
            itemsMaxCounts.Add("users.getSubscriptions", 200);
            itemsMaxCounts.Add("friends.get", Int32.MaxValue);
            itemsMaxCounts.Add("wall.getComments", Int32.MaxValue);

            batchSizes.Add("users.get", 300);
            batchSizes.Add("groups.getById", 300);
        }
开发者ID:NewMediaCenterMoscow,项目名称:UniSocial2,代码行数:52,代码来源:VkApiRequest.cs


示例14: Init

        public void Init(IApi api, string dllpath)
        {
            _api = api;
            _dllpath = dllpath;
            try
            {
                _ini = new IniParser(_configPath);
            }
            catch (Exception ex)
            {
                throw new WebRconException(String.Format("Error loading config: {0}", ex.Message));
            }

            _enabled = _ini.GetBoolSetting(Name, "Enabled");
            if (!_enabled)
                throw new WebRconException(String.Format("{0} has been disabled", Name));

            var port = _ini.GetSetting(Name, "Port");
            try
            {
                _port = Convert.ToInt32(port);
            }
            catch (Exception ex)
            {
                throw new WebRconException(String.Format("Invalid port: {0}", ex.Message));
            }

            _password = _ini.GetSetting(Name, "Password");
            if (_password == "")
            {
                _password = Utils.GetRandomString();
            }

#if DEBUG
            _serverurl = String.Format("http://localhost:{0}/", _port);
#else
            _serverurl = String.Format("http://*:{0}/", _port);
#endif
            _webServer = new WebServer(HttpRequest, _serverurl);
            _webServer.Run();
            AppConsole.Log(String.Format("Started HTTP server at {0}. Password: {1}", _serverurl, _password), ConsoleColor.Cyan);

            _port++;
            _socketServer = new WebSocketServer(_port);
            _socketServer.AddWebSocketService("/rcon", () => new SocketBehavior(_api, _password));
            _socketServer.Start();

            LoadHtdocsFiles();

        }
开发者ID:josemaripl,项目名称:MBCon,代码行数:50,代码来源:WebRcon.cs


示例15: Init

 internal void Init(IApi _api)
 {
     foreach (var t in _pluginCollection.ToArray())
     {
         try
         {
             t.Instance.Init(_api, t.DllPath);
         }
         catch (Exception ex)
         {
             AppConsole.Log(String.Format("Plugin {0} loading failed: {1}", t.Instance.Name, ex.Message), ConsoleColor.Yellow);
             _pluginCollection.Remove(t);
         }
     }
 }
开发者ID:josemaripl,项目名称:MBCon,代码行数:15,代码来源:PluginManager.cs


示例16: RestierQueryBuilder

        public RestierQueryBuilder(IApi api, ODataPath path)
        {
            Ensure.NotNull(api, "api");
            Ensure.NotNull(path, "path");
            this.api = api;
            this.path = path;

            this.handlers[ODataSegmentKinds.EntitySet] = this.HandleEntitySetPathSegment;
            this.handlers[ODataSegmentKinds.UnboundFunction] = this.HandleUnboundFunctionPathSegment;
            this.handlers[ODataSegmentKinds.Count] = this.HandleCountPathSegment;
            this.handlers[ODataSegmentKinds.Value] = this.HandleValuePathSegment;
            this.handlers[ODataSegmentKinds.Key] = this.HandleKeyValuePathSegment;
            this.handlers[ODataSegmentKinds.Navigation] = this.HandleNavigationPathSegment;
            this.handlers[ODataSegmentKinds.Property] = this.HandlePropertyAccessPathSegment;
        }
开发者ID:anandnooli79,项目名称:RESTier,代码行数:15,代码来源:RestierQueryBuilder.cs


示例17: LeanEngineSystemHandlers

 /// <summary>
 /// Initializes a new instance of the <see cref="LeanEngineSystemHandlers"/> class with the specified handles
 /// </summary>
 /// <param name="jobQueue">The job queue used to acquire algorithm jobs</param>
 /// <param name="api">The api instance used for communicating limits and status</param>
 /// <param name="notify">The messaging handler user for passing messages from the algorithm to listeners</param>
 public LeanEngineSystemHandlers(IJobQueueHandler jobQueue, IApi api, IMessagingHandler notify)
 {
     if (jobQueue == null)
     {
         throw new ArgumentNullException("jobQueue");
     }
     if (api == null)
     {
         throw new ArgumentNullException("api");
     }
     if (notify == null)
     {
         throw new ArgumentNullException("notify");
     }
     _api = api;
     _jobQueue = jobQueue;
     _notify = notify;
 }
开发者ID:skyfyl,项目名称:Lean,代码行数:24,代码来源:LeanEngineSystemHandlers.cs


示例18: Init

        public void Init(IApi api, string dllpath)
        {
            _api = api;
            _dllpath = dllpath;
            try
            {
                _ini = new IniParser(_configPath);
            }
            catch (Exception ex)
            {
                throw new $safeprojectname$Exception(String.Format("Error loading config: {0}", ex.Message));
            }

            _enabled = _ini.GetBoolSetting(Name, "Enabled");
            if (!_enabled)
                throw new $safeprojectname$Exception(String.Format("{0} has been disabled", Name));
            
        }
开发者ID:josemaripl,项目名称:MBCon,代码行数:18,代码来源:TestPlugin.cs


示例19: Setup

        /// <summary>
        /// Intializes the real time handler for the specified algorithm and job
        /// </summary>
        public void Setup(IAlgorithm algorithm, AlgorithmNodePacket job, IResultHandler resultHandler, IApi api)
        {
            //Initialize:
            _api = api;
            _algorithm = algorithm;
            _resultHandler = resultHandler;
            _cancellationTokenSource = new CancellationTokenSource();

            var todayInAlgorithmTimeZone = DateTime.UtcNow.ConvertFromUtc(_algorithm.TimeZone).Date;

            // refresh the market hours for today explicitly, and then set up an event to refresh them each day at midnight
            RefreshMarketHoursToday(todayInAlgorithmTimeZone);

            // every day at midnight from tomorrow until the end of time
            var times =
                from date in Time.EachDay(todayInAlgorithmTimeZone.AddDays(1), Time.EndOfTime)
                select date.ConvertToUtc(_algorithm.TimeZone);

            Add(new ScheduledEvent("RefreshMarketHours", times, (name, triggerTime) =>
            {
                // refresh market hours from api every day
                RefreshMarketHoursToday(triggerTime.ConvertFromUtc(_algorithm.TimeZone).Date);
            }));

            // add end of day events for each tradeable day
            Add(ScheduledEventFactory.EveryAlgorithmEndOfDay(_algorithm, _resultHandler, todayInAlgorithmTimeZone, Time.EndOfTime, ScheduledEvent.AlgorithmEndOfDayDelta, DateTime.UtcNow));

            // add end of trading day events for each security
            foreach (var security in _algorithm.Securities.Values.Where(x => !x.SubscriptionDataConfig.IsInternalFeed))
            {
                // assumes security.Exchange has been updated with today's hours via RefreshMarketHoursToday
                Add(ScheduledEventFactory.EverySecurityEndOfDay(_algorithm, _resultHandler, security, todayInAlgorithmTimeZone, Time.EndOfTime, ScheduledEvent.SecurityEndOfDayDelta, DateTime.UtcNow));
            }

            foreach (var scheduledEvent in _scheduledEvents)
            {
                // zoom past old events
                scheduledEvent.Value.SkipEventsUntil(algorithm.UtcTime);
                // set logging accordingly
                scheduledEvent.Value.IsLoggingEnabled = Log.DebuggingEnabled;
            }
        }
开发者ID:skyfyl,项目名称:Lean,代码行数:45,代码来源:LiveTradingRealTimeHandler.cs


示例20: Init

        public void Init(IApi api, string dllpath)
        {
            _api = api;
            _dllpath = dllpath;
            try
            {
                _ini = new IniParser(_configPath);
            }
            catch (Exception ex)
            {
                throw new SimpleMessagesException(String.Format("Error loading config: {0}", ex.Message));
            }

            _enabled = _ini.GetBoolSetting("SimpleMessages", "Enabled");
            if (!_enabled)
                throw new SimpleMessagesException(String.Format("{0} has been disabled", Name));

            Int32 _interval;
            try
            {
                _interval = Convert.ToInt32(_ini.GetSetting("SimpleMessages", "Interval", "60"));
            }
            catch
            {
                _interval = 60;
            }

            _prefix = _ini.GetSetting("SimpleMessages", "Prefix");

            _repeat = _ini.GetBoolSetting("SimpleMessages", "Repeat");
            var _random = _ini.GetBoolSetting("SimpleMessages", "Random");
            _messages = _ini.EnumSection("Messages");
            if (_random)
            {
                var rnd = new Random();
                _messages = _messages.OrderBy(x => rnd.Next()).ToArray();
            }
            _timer = new Timer {Interval = (_interval*1000)};
            _timer.Elapsed += _timer_Elapsed;
            _timer.Enabled = true;
        }
开发者ID:josemaripl,项目名称:MBCon,代码行数:41,代码来源:SimpleMessages.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IApiClient类代码示例发布时间:2022-05-24
下一篇:
C# IAnnouncer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap