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


C# Messages.AccountName类代码示例

本文整理汇总了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;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:DocumentIndexProvider.cs

示例2: ProfileGateway

		public ProfileGateway(IProfileReadonly profile, AccountName accountName, ITpBus bus)
		{
			_profile = profile;
			_accountName = accountName;
			_bus = bus;
			_storage = _profile.Get<ITargetProcessMessage>();
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ProfileGateway.cs

示例3: GetAll

		public IEnumerable<Profile> GetAll(AccountName accountName)
		{
			using (var context = CreateDataContext())
			{
				return SelectAccount(context.Accounts, accountName).Single().Profiles;
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ProfilePersister.cs

示例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;
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:7,代码来源:MashupScriptStorage.cs

示例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;
		}
开发者ID:sbcfwebdev,项目名称:Target-Process-Plugins,代码行数:25,代码来源:MashupScriptStorage.cs

示例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))");
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:34,代码来源:ProfileCollectionTests.cs

示例7: MashupScriptStorage

		public MashupScriptStorage(IPluginContext context, IMashupLocalFolder folder, ILogManager logManager, IMashupLoader mashupLoader)
		{
			_folder = folder;
			_mashupLoader = mashupLoader;
			_log = logManager.GetLogger(GetType());
			_accountName = context.AccountName;
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:7,代码来源:MashupScriptStorage.cs

示例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];
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:7,代码来源:ProfileInMemoryPersister.cs

示例9: ContextQueryPlanBuilder

        public ContextQueryPlanBuilder(IDocumentIndexProvider documentIndexProvider, IDocumentIdFactory documentIdFactory, AccountName accountName, IProfileReadonly profile, IEntityTypeProvider entityTypeProvider)
		{
			_documentIndexProvider = documentIndexProvider;
			_documentIdFactory = documentIdFactory;
            _accountName = accountName;
			_profile = profile;
			_entityTypeProvider = entityTypeProvider;
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:ContextQueryPlanBuilder.cs

示例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);
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:8,代码来源:DocumentIndexProviderServices.cs

示例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)
					};
		}
开发者ID:TargetProcess,项目名称:Target-Process-Plugins,代码行数:9,代码来源:ProfileRepository.cs

示例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();
			}
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:9,代码来源:ProfilePersister.cs

示例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);
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:9,代码来源:QueryPlanBuilder.cs

示例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));
		}
开发者ID:sbcfwebdev,项目名称:Target-Process-Plugins,代码行数:9,代码来源:AccountHandlerTests.cs

示例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]));
		}
开发者ID:lakshithagit,项目名称:Target-Process-Plugins,代码行数:10,代码来源:AccountCollectionMock.cs


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