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


C# IApi类代码示例

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


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


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