本文整理汇总了C#中Plug.At方法的典型用法代码示例。如果您正苦于以下问题:C# Plug.At方法的具体用法?C# Plug.At怎么用?C# Plug.At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plug
的用法示例。
在下文中一共展示了Plug.At方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AmazonS3Client
//--- Constructors ---
/// <summary>
/// Create new client instance
/// </summary>
/// <param name="config">Client configuration.</param>
/// <param name="timerFactory">Timer factory.</param>
public AmazonS3Client(AmazonS3ClientConfig config, TaskTimerFactory timerFactory)
{
_config = config;
_bucketPlug = Plug.New(_config.S3BaseUri)
.WithS3Authentication(_config.PrivateKey, _config.PublicKey)
.WithTimeout(_config.Timeout)
.At(_config.Bucket);
_rootPlug = _bucketPlug;
if(!string.IsNullOrEmpty(_config.RootPath)) {
_keyRootParts = _config.RootPath.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
if(_keyRootParts != null && _keyRootParts.Any()) {
_rootPlug = _rootPlug.At(_keyRootParts);
}
}
_expirationEntries = new ExpiringHashSet<string>(timerFactory);
_expirationEntries.EntryExpired += OnDelete;
}
示例2: Init
public void Init()
{
_hostInfo = DreamTestHelper.CreateRandomPortHost();
_hostInfo.Host.Self.At("load").With("name", "test.mindtouch.dream").Post(DreamMessage.Ok());
var config = new XDoc("config")
.Elem("path", "test")
.Elem("sid", "http://services.mindtouch.com/dream/test/2010/07/featuretestserver");
DreamMessage result = _hostInfo.LocalHost.At("host", "services").With("apikey", _hostInfo.ApiKey).PostAsync(config).Wait();
Assert.IsTrue(result.IsSuccessful, result.ToText());
_plug = Plug.New(_hostInfo.LocalHost.Uri.WithoutQuery()).At("test");
_blueprint = _plug.At("@blueprint").Get().ToDocument();
}
示例3: Init
public void Init()
{
var builder = new ContainerBuilder();
builder.RegisterType<Foo>().As<IFoo>().RequestScoped();
_hostInfo = DreamTestHelper.CreateRandomPortHost(new XDoc("config"), builder.Build(ContainerBuildOptions.None));
_hostInfo.Host.Self.At("load").With("name", "test.mindtouch.dream").Post(DreamMessage.Ok());
var config = new XDoc("config")
.Elem("path", "test")
.Elem("sid", "http://services.mindtouch.com/dream/test/2010/07/featuretestserver");
DreamMessage result = _hostInfo.LocalHost.At("host", "services").With("apikey", _hostInfo.ApiKey).Post(config, new Result<DreamMessage>()).Wait();
Assert.IsTrue(result.IsSuccessful, result.ToText());
_plug = Plug.New(_hostInfo.LocalHost.Uri.WithoutQuery()).At("test");
_blueprint = _plug.At("@blueprint").Get().ToDocument();
}