本文整理汇总了C#中Tp.Integration.Messages.AccountName类的典型用法代码示例。如果您正苦于以下问题:C# AccountName类的具体用法?C# AccountName怎么用?C# AccountName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccountName类属于Tp.Integration.Messages命名空间,在下文中一共展示了AccountName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoGetDocumentFinder
private Maybe<IDocumentIndex> DoGetDocumentFinder(AccountName accountName, DocumentIndexTypeToken documentIndexTypeToken)
{
Lazy<IDocumentIndex> fetched;
return _documentIndexes[documentIndexTypeToken].TryGetValue(accountName.Value, out fetched)
? Maybe.Return(fetched.Value)
: Maybe.Nothing;
}
示例2: ProfileGateway
public ProfileGateway(IProfileReadonly profile, AccountName accountName, ITpBus bus)
{
_profile = profile;
_accountName = accountName;
_bus = bus;
_storage = _profile.Get<ITargetProcessMessage>();
}
示例3: GetAll
public IEnumerable<Profile> GetAll(AccountName accountName)
{
using (var context = CreateDataContext())
{
return SelectAccount(context.Accounts, accountName).Single().Profiles;
}
}
示例4: GetMashup
public Mashup GetMashup(AccountName account, string mashupName)
{
_log.Info(string.Format("Getting mashup with name '{0}'", mashupName));
Mashup mashup = _mashupLoader.Load(GetMashupFolderPath(account, mashupName), mashupName);
_log.Info(string.Format("Mashup with name '{0}' retrieved", mashupName));
return mashup;
}
示例5: GetMashup
public MashupDto GetMashup(AccountName account, string mashupName)
{
_log.Info(string.Format("Getting mashup with name '{0}'", mashupName));
string mashupFolderPath = GetMashupFolderPath(account, mashupName);
if (!Directory.Exists(mashupFolderPath))
{
return null;
}
var script = Directory.GetFiles(mashupFolderPath, "*.js");
var config = Directory.GetFiles(mashupFolderPath, MashupDto.PlaceholdersCfgFileName);
if (!script.Any())
{
return null;
}
var scriptFileInfo = new FileInfo(script.First());
var mashup = CreateMashupDto(config, scriptFileInfo);
_log.Info(string.Format("Mashup with name '{0}' retrieved", mashupName));
return mashup;
}
示例6: WriteOnceReadTwice
public void WriteOnceReadTwice()
{
int beforeProfileAdd = 0;
int afterProfileAdded = 0;
var account1Name = new AccountName("account1");
AccountCollection.GetOrCreate(account1Name);
ExecuteConcurrently(() =>
{
Interlocked.Increment(ref beforeProfileAdd);
IAccount account = AccountCollection.GetOrCreate(account1Name);
account.Profiles.Add(new ProfileCreationArgs(new ProfileName("~"), new object()));
Interlocked.Increment(ref afterProfileAdded);
}, () =>
{
var accountFirstVersion = AccountCollection.GetOrCreate(account1Name);
var accountSecondVersion = AccountCollection.GetOrCreate(account1Name);
bool sameVersion = false;
if (Interlocked.Increment(ref beforeProfileAdd) == 1)
{
sameVersion = (accountFirstVersion == accountSecondVersion);
sameVersion.Should(Be.True, "sameVersion.Should(Be.True)");
}
if (Interlocked.Increment(ref afterProfileAdded) == 2)
{
IAccount latestAccountVersion = AccountCollection.GetOrCreate(account1Name);
latestAccountVersion.Profiles.Count().Should(Be.EqualTo(1), "latestAccountVersion.Profiles.Count().Should(Be.EqualTo(1))");
if (sameVersion)
{
(latestAccountVersion == accountFirstVersion).Should(Be.False, "(latestAccountVersion == accountFirstVersion).Should(Be.False)");
}
}
});
AccountCollection.GetOrCreate(account1Name).Profiles.Count().Should(Be.EqualTo(1), "AccountCollection.GetOrCreate(account1Name).Profiles.Count().Should(Be.EqualTo(1))");
}
示例7: MashupScriptStorage
public MashupScriptStorage(IPluginContext context, IMashupLocalFolder folder, ILogManager logManager, IMashupLoader mashupLoader)
{
_folder = folder;
_mashupLoader = mashupLoader;
_log = logManager.GetLogger(GetType());
_accountName = context.AccountName;
}
示例8: Update
public Profile Update(ProfileName profileName, bool initialized, AccountName accountName)
{
var index = _profiles[accountName].FindIndex(x => x.Name == profileName.Value);
_profiles[accountName][index].Initialized = initialized;
_profiles[accountName][index].Name = profileName.Value;
return _profiles[accountName][index];
}
示例9: ContextQueryPlanBuilder
public ContextQueryPlanBuilder(IDocumentIndexProvider documentIndexProvider, IDocumentIdFactory documentIdFactory, AccountName accountName, IProfileReadonly profile, IEntityTypeProvider entityTypeProvider)
{
_documentIndexProvider = documentIndexProvider;
_documentIdFactory = documentIdFactory;
_accountName = accountName;
_profile = profile;
_entityTypeProvider = entityTypeProvider;
}
示例10: ShutdownDocumentIndexesIfRunning
public static void ShutdownDocumentIndexesIfRunning(this IDocumentIndexProvider documentIndexProvider, AccountName accountName, DocumentIndexShutdownSetup setup)
{
IEnumerable<IDocumentIndex> documentIndexes = documentIndexProvider.DocumentTypes.Select(t => documentIndexProvider.GetDocumentIndex(accountName, t)).Choose();
foreach (IDocumentIndex documentIndex in documentIndexes)
{
documentIndex.Shutdown(setup);
}
}
示例11: Create
public ProfileDomainObject Create(Profile profile, AccountName accountName)
{
return new ProfileDomainObject(profile.Name, accountName, profile.Initialized, _pluginMetadata.ProfileType)
{
EventAggregator = _eventAggregator,
ProfileRepository = this,
StorageRepository = new ProfileStorageRepository(new ProfileId(profile.Id), _profileStoragePersister, _pluginMetadata)
};
}
示例12: Delete
public void Delete(ProfileName profileName, AccountName accountName)
{
using (var context = CreateDataContext())
{
var profile = SelectProfile(context.Accounts, profileName, accountName);
context.Profiles.DeleteOnSubmit(profile);
context.SubmitChanges();
}
}
示例13: QueryPlanBuilder
public QueryPlanBuilder(IPluginContext pluginContext, IProfileReadonly profile, IDocumentIndexProvider documentIndexProvider, IEntityTypeProvider entityTypeProvider, IDocumentIdFactory documentIdFactory)
{
_accountName = pluginContext.AccountName;
_profile = profile;
_documentIndexProvider = documentIndexProvider;
_entityTypeProvider = entityTypeProvider;
_documentIdFactory = documentIdFactory;
_contextQueryPlanBuilder = new ContextQueryPlanBuilder(_documentIndexProvider, _documentIdFactory, pluginContext.AccountName, _profile, _entityTypeProvider);
}
示例14: RemoveAccount
public void RemoveAccount()
{
var accountName = new AccountName("Account");
_accountCollection.GetOrCreate(accountName);
Assert.IsTrue(_accountCollection.Any(c => c.Name == accountName.Value));
_accountHandler.Handle(new AccountRemovedMessage(accountName.Value));
_accountHandler.Handle(_bus.PluginCommands.OfType<AccountRemovedLastStepMessage>().Single());
Assert.IsFalse(_accountCollection.Any(c => c.Name == accountName.Value));
}
示例15: GetOrCreate
public IAccount GetOrCreate(AccountName accountName)
{
IAccount account;
if(_accounts.TryGetValue(accountName, out account))
{
return account;
}
return _accounts[accountName] = new AccountDomainObject(accountName, new ProfileCollection(accountName, new ProfileDomainObject[0]));
}