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

C# Api类代码示例

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

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



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

示例1: Job

 public Job(Api api, LogsStore logsStore, DroneSettings droneSettings, OmniRecordManager omniRecordManager)
 {
     _omniRecordManager = omniRecordManager;
     _logsStore = logsStore;
     _droneSettings = droneSettings;
     _api = api;
 }
开发者ID:mamluka,项目名称:SpeedyMailer,代码行数:7,代码来源:SendDroneStateSnapshotTask.cs


示例2: GetDynamicOptions

        public void GetDynamicOptions(string category, Api.IRequest requestObject) {
            if (requestObject == null) {
                throw new ArgumentNullException("requestObject");
            }

            requestObject.Debug("Called DummyProvider GetDynamicOptions");
        }
开发者ID:40a,项目名称:PowerShell,代码行数:7,代码来源:DefaultPackageProvider.cs


示例3: Repository_Authority_AllAuthorities_Returns_All

 public async Task Repository_Authority_AllAuthorities_Returns_All()
 {
     var api = new Api<AuthoritiesViewModel>(new Mock<ILog>().Object);
     var result = await api.GetAsync("Authorities", string.Empty);
     Assert.IsNotNull(result);
     Assert.That(result.Authorities.Any());
 }
开发者ID:rg911,项目名称:Free-API-Consumer,代码行数:7,代码来源:AuthorityModelTest.cs


示例4: InitializeProvider

        public void InitializeProvider(Api.IRequest requestObject) {
            if (requestObject == null) {
                throw new ArgumentNullException("requestObject");
            }

            requestObject.Debug("Called DummyProvider InitializeProvider");
        }
开发者ID:40a,项目名称:PowerShell,代码行数:7,代码来源:DefaultPackageProvider.cs


示例5: ResolvePackageSources

        public void ResolvePackageSources(Api.IRequest requestObject) {
            if (requestObject == null) {
                throw new ArgumentNullException("requestObject");
            }

            requestObject.Debug("Called DummyProvider ResolvePackageSources");
        }
开发者ID:40a,项目名称:PowerShell,代码行数:7,代码来源:DefaultPackageProvider.cs


示例6: GetById

		/// <summary>
		/// Gets the edit model for the category with the given id.
		/// </summary>
		/// <param name="api">The current api</param>
		/// <param name="id">The unique id</param>
		/// <returns>The edit model</returns>
		public static EditModel GetById(Api api, Guid id) {
			var category = api.Categories.GetSingle(id);

			if (category != null)
				return Mapper.Map<Piranha.Models.Category, EditModel>(category);
			return null;
		}
开发者ID:cdie,项目名称:Piranha.vNext,代码行数:13,代码来源:EditModel.cs


示例7: ConvertBack

        public static FoundOps.Core.Models.CoreEntities.ContactInfo ConvertBack(Api.Models.ContactInfo contactInfoModel)
        {
            var contactInfo = new FoundOps.Core.Models.CoreEntities.ContactInfo
                {
                    Id = contactInfoModel.Id,
                    Type = contactInfoModel.Type,
                    Label = contactInfoModel.Label,
                    Data = contactInfoModel.Data,
                    ClientId = contactInfoModel.ClientId,
                    LocationId = contactInfoModel.LocationId,
                    CreatedDate = contactInfoModel.CreatedDate,
                    LastModified = contactInfoModel.LastModified,
                    LastModifyingUserId = contactInfoModel.LastModifyingUserId
                };

            //TODO Generalize this everywhere
            if (string.IsNullOrEmpty(contactInfo.Type))
                contactInfo.Type = "";
            if (string.IsNullOrEmpty(contactInfo.Label))
                contactInfo.Label = "";
            if (string.IsNullOrEmpty(contactInfo.Data))
                contactInfo.Data = "";

            return contactInfo;
        }
开发者ID:FoundOPS,项目名称:server,代码行数:25,代码来源:ContactInfo.cs


示例8: Job

 public Job(Api api,DroneSettings droneSettings, OmniRecordManager omniRecordManager,CreativePackagesStore creativePackagesStore)
 {
     _creativePackagesStore = creativePackagesStore;
     _omniRecordManager = omniRecordManager;
     _droneSettings = droneSettings;
     _api = api;
 }
开发者ID:mamluka,项目名称:SpeedyMailer,代码行数:7,代码来源:BroadcastDroneToServiceTask.cs


示例9: Functional

        public Functional()
        {
            var appEnv = CallContextServiceLocator.Locator.ServiceProvider.GetService(typeof(IApplicationEnvironment)) as IApplicationEnvironment;
            Debug.Assert(appEnv != null, "appEnv != null");
            var builder = new ConfigurationBuilder(appEnv.ApplicationBasePath);
            builder.AddJsonFile("config.json");
            builder.AddJsonFile("config.private.json", true);
            var configuration = builder.Build();

            var uri = new Uri(configuration["ServerCredentialUri"]);
            var username = configuration["ServerCredentialUsername"];
            var password = configuration["ServerCredentialPassword"];

            _serverCredential = new ServerCredential(uri, username, password);

            _freeMusicTorrentFile =
                new HttpClient().GetByteArrayAsync(
                    new Uri("http://bt.etree.org/download.php/582271/hottuna2015-09-11.flac16.torrent")).Result;
            _freeMusicTorrentHash = "9ecc7229ff971d27552dd399509e188847dbbbf1";

            // Make sure there is no torrents before executing the tests
            var api = new Api(_serverCredential);
            var torrents = api.GetTorrents().Result;
            if (torrents.Any())
            {
                var result = api.Perform(Action.Removedata, torrents.Select(t => t.InfoHash)).Result;
                Assert.True(result);
            }
        }
开发者ID:rbarbe,项目名称:HadoukenApi,代码行数:29,代码来源:Functional.cs


示例10: Repository_Establishments_Single_Return_One_Record

 public async Task Repository_Establishments_Single_Return_One_Record()
 {
     var api = new Api<EstablishmentsModel>(new Mock<ILog>().Object);
     var result = await api.GetAsync("Establishments/1", string.Empty);
     Assert.IsNotNull(result);
     Assert.That(!string.IsNullOrEmpty(result.RatingValue));
 }
开发者ID:rg911,项目名称:Free-API-Consumer,代码行数:7,代码来源:EstablishmentsModelTest.cs


示例11: Repository_Establishments_AllAuthorities_Returns_All

 public async Task Repository_Establishments_AllAuthorities_Returns_All()
 {
     var api = new Api<EstablishmentsViewModel>(new Mock<ILog>().Object);
     var result = await api.GetAsync("Establishments?LocalAuthorityId=197", string.Empty);
     Assert.IsNotNull(result);
     Assert.That(result.Establishments.Any());
 }
开发者ID:rg911,项目名称:Free-API-Consumer,代码行数:7,代码来源:EstablishmentsModelTest.cs


示例12: PutioFileSystem

 public PutioFileSystem(Api putio_api)
 {
     this.PutioApi = putio_api;
     this.OpenHandles = new Dictionary<Guid, PutioFileHandle>();
     this.Root = PutioFolder.GetRootFolder(this);
     this.DownloadManager = new DownloadManager(Constants.MAX_CONNECTIONS);
 }
开发者ID:firat,项目名称:PutioFS,代码行数:7,代码来源:PutioFileSystem.cs


示例13: Test

        public async Task Test()
        {
            var api = new Api();

            var startElysee = new GeoLocation
            {
                Longitude = 2.316749,
                Latitude = 48.870663
            };
            var endTourEiffel = new GeoLocation
            {
                Longitude = 2.294555,
                Latitude = 48.858465
            };
            var arrivalTime = DateTimeOffset.Now.AddDays(3);

            var networks = new List<Network> {Network.Bus};

            var s =
                await
                    api.GetItinerary(startElysee, endTourEiffel, null, arrivalTime, networks, JourneyPreference.MinWait,
                        false, false, false);

            Assert.False(string.IsNullOrWhiteSpace(s));
        }
开发者ID:rbarbe,项目名称:RatpApi,代码行数:25,代码来源:Functional.cs


示例14: WebSyncPreferencesWidget

		public WebSyncPreferencesWidget (Api.OAuth oauth, string server, EventHandler requiredPrefChanged) : base (false, 5)
		{
			this.oauth = oauth;
			
			Gtk.Table prefsTable = new Gtk.Table (1, 2, false);
			prefsTable.RowSpacing = 5;
			prefsTable.ColumnSpacing = 10;

			serverEntry = new Gtk.Entry ();
			serverEntry.Text = server;
			AddRow (prefsTable, serverEntry, Catalog.GetString ("Se_rver:"), 0);
			
			Add (prefsTable);

			authButton = new Gtk.Button ();
			// TODO: If Auth is valid, this text should change
			if (!Auth.IsAccessToken)
				authButton.Label = Catalog.GetString ("Connect to Server");
			else {
				authButton.Label = Catalog.GetString ("Connected");
				authButton.Sensitive = false;
			}
			authButton.Clicked += OnAuthButtonClicked;

			serverEntry.Changed += delegate {
				Auth = null;
			};
			serverEntry.Changed += requiredPrefChanged;

			Add (authButton);

			// TODO: Add a section that shows the user something to verify they put
			//       in the right URL...something that constructs their user URL, maybe?
			ShowAll ();
		}
开发者ID:MichaelAquilina,项目名称:tomboy,代码行数:35,代码来源:WebSyncPreferencesWidget.cs


示例15: FullSearch

        private static void FullSearch()
        {
            ParamBuilder oParamBuilder = new ParamBuilder();
            SearchResults = new List<Item>();

            oParamBuilder.addParam("sid", StaticSessionSettings.sessionID);
            oParamBuilder.addParam("q", "");

            var oComm = new Api();
            var result = oComm.getResponseFromOrb<List<Item>>(Api.mediasearch, oParamBuilder.GetParamList());

            List<Item> Temp = new List<Item>();

            Temp = result;

            SearchResults.Clear();

            foreach (var item in Temp)
            {
                if (!string.IsNullOrWhiteSpace(item.field))
                    SearchResults.Add(item);
            }

            iveFullySearched = true;
        }
开发者ID:j4m355,项目名称:orb.net,代码行数:25,代码来源:Media.cs


示例16: VManageSessions

 /// <summary>
 /// Constructor
 /// </summary>
 public VManageSessions(Api.Client.EventDefinition eventDefinition)
 {
     // TODO: Complete member initialization
     InitializeComponent();
     this.Loaded += VManageSessions_Loaded;
     (this.DataContext as ManageSessionsViewModel).EventDefinition = eventDefinition;
 }
开发者ID:garymedina,项目名称:MyEvents,代码行数:10,代码来源:VManageSessions.xaml.cs


示例17: Run

        static async Task Run()
        {
            var Bot = new Api("Your Api Key");

            var me = await Bot.GetMe();

            Console.WriteLine("Hello my name is {0}", me.Username);

            var offset = 0;

            while (true)
            {
                var updates = await Bot.GetUpdates(offset);

                foreach (var update in updates)
                {
                    if (update.Message.Text != null)
                        await Bot.SendTextMessage(update.Message.Chat.Id, update.Message.Text);

                    offset = update.Id + 1;
                }

                await Task.Delay(1000);
            }

        }
开发者ID:lftkv,项目名称:telegram.bot,代码行数:26,代码来源:Program.cs


示例18: GetApiMinVersion

        public async Task GetApiMinVersion()
        {
            var api = new Api(_serverCredential);
            var apiMinVersion = await api.GetApiMinVersion();

            Assert.True(10 <= apiMinVersion);
        }
开发者ID:rbarbe,项目名称:qBittorrentApi,代码行数:7,代码来源:Functional.cs


示例19: TelegramWorker

 public TelegramWorker(string botTokenKey)
 {
     _botTokenKey = botTokenKey;
     _telegramApi = new Api(_botTokenKey);
     _logger = FullLogger.Init();
     _dialogManager = DialogManager.Init();
 }
开发者ID:maxMakaronok,项目名称:Assistent,代码行数:7,代码来源:TelegramWorker.cs


示例20: AddTestDataToIndex

        public static void AddTestDataToIndex(Interface.IIndexService indexService, Api.Index index, string testData)
        {
            string[] lines = testData.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
            string[] headers = lines[0].Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string line in lines.Skip(1))
            {
                string[] items = line.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                var indexDocument = new Document();
                indexDocument.Id = items[0];
                indexDocument.Index = index.IndexName;
                indexDocument.Fields = new Api.KeyValuePairs();

                for (int i = 1; i < items.Length; i++)
                {
                    indexDocument.Fields.Add(headers[i], items[i]);
                }

                indexService.PerformCommand(
                    index.IndexName,
                    IndexCommand.NewCreate(indexDocument.Id, indexDocument.Fields));
            }

            indexService.PerformCommand(index.IndexName, IndexCommand.Commit);
            Thread.Sleep(100);
        }
开发者ID:Enielezi,项目名称:FlexSearch,代码行数:25,代码来源:MockHelpers.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Groups.Groups类代码示例发布时间:2022-05-24
下一篇:
C# ApartmentState类代码示例发布时间: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