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


C# IAccount类代码示例

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


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

示例1: Transfer

 public Transfer(float amount, IAccount from, IAccount to)
 {
     From = from;
     To = to;
     Amount = amount;
     History = new List<IOperationHistory>();
 }
开发者ID:Tolga,项目名称:Bank,代码行数:7,代码来源:Transfer.cs

示例2: Transaction

 public Transaction(IAccount account, IPayment payout, string currency)
 {
     Account = account;
     Payment = payout;
     Currency = currency;
     CreatedAt = DateTime.Now;
 }
开发者ID:carloslozano,项目名称:CoiniumServ,代码行数:7,代码来源:Transaction.cs

示例3: FlistService

        public FlistService(IAccount model, IEventAggregator eventagg, IBrowseThings browser,
            IGetTickets ticketService, IFriendRequestService requestService)
        {
            this.browser = browser;
            this.ticketService = ticketService;
            this.requestService = requestService;

            try
            {
                this.model = model.ThrowIfNull("model");
                events = eventagg.ThrowIfNull("eventagg");

                events.GetEvent<LoginEvent>().Subscribe(GetTicket, ThreadOption.BackgroundThread);
                events.GetEvent<UserCommandEvent>().Subscribe(HandleCommand, ThreadOption.BackgroundThread);
                events.GetEvent<CharacterSelectedLoginEvent>().Subscribe(args => selectedCharacter = args);

                // fix problem with SSL not being trusted on some machines
                ServicePointManager.ServerCertificateValidationCallback =
                    (sender, certificate, chain, sslPolicyErrors) => true;
            }
            catch (Exception ex)
            {
                Exceptions.HandleException(ex);
            }
        }
开发者ID:WreckedAvent,项目名称:slimCat,代码行数:25,代码来源:FlistService.cs

示例4: AddAccount

 /// <summary>
 /// Attempts to try and add an account to the database.
 /// </summary>
 /// <param name="newAccount">Account to add</param>
 public void AddAccount(IAccount newAccount)
 {
     if (accounts.Select(x => x).Any(x => x.Username == newAccount.Username))
         throw new Exception();
     newAccount.TableID = tableID++;
     accounts.Add(newAccount);
 }
开发者ID:Rabka,项目名称:BDSA2014,代码行数:11,代码来源:OnlineContextStub.cs

示例5: GetDefaultAccount

		public IAccount GetDefaultAccount()
		{
			if (defaultAccount == null || accounts1.ContainsKey(defaultAccount.Id) == false)
			{
				defaultAccount = accounts1.First((a) => true);

				if (defaultAccount != null)
				{
					accounts1.ForEach(
						(other) =>
						{
							if (other.Id < defaultAccount.Id)
								defaultAccount = other;
						});
				}
				else
				{
					int id = AddAccount(new Account()
					{
						DomainName = @"officesip.local",
					});

					defaultAccount = accounts1.GetValue(id);
				}
			}

			return defaultAccount;
		}
开发者ID:hungdluit,项目名称:sipserver,代码行数:28,代码来源:Accountx.cs

示例6: TransferFunds

 public void TransferFunds(IAccount fromAccnt, IAccount toAccnt, double amount)
 {
     //customer can use the transfer service which implement the ITransferFunds Interface
     //Future:this is good place to check for Authorization of customer for $ transfer before method call
     CustomerTransferFunds initiateTransfer = new CustomerTransferFunds();
     initiateTransfer.Account_To_Account_Transfer(this, fromAccnt, toAccnt, amount);
 }
开发者ID:hacknop,项目名称:abc-bank-csharp,代码行数:7,代码来源:Customer.cs

示例7: GetOper

        // ָ��Ϊǰһ�����ֵ���룬׬x%���
        public override ICollection<StockOper> GetOper(DateTime day, IAccount account)
        {
            IStockData prevStockProp = stockHistory.GetPrevDayStock(day);
            if (prevStockProp == null)
            {
                Debug.WriteLine("StrategyPercent -- GetPrevDayStock ERROR: Cur Day: " + day.ToLongDateString());
                return null;
            }

            ICollection<StockOper> opers = new List<StockOper>();
            int stockCount = Transaction.GetCanBuyStockCount(account.BankRoll,
                    prevStockProp.MinPrice);
            if (stockCount > 0)
            {
                StockOper oper = new StockOper(prevStockProp.MinPrice, stockCount, OperType.Buy);
                opers.Add(oper);
            }

            if (stockHolder.HasStock())
            {
                double unitCost = stockHolder.UnitPrice;
                if (unitCost > 0)
                {
                    StockOper oper2 = new StockOper(unitCost * (1 + winPercent), stockHolder.StockCount(), OperType.Sell);
                    opers.Add(oper2);
                }
            }

            return opers;
        }
开发者ID:soross,项目名称:stockanalyzer,代码行数:31,代码来源:StrategyPercent.cs

示例8: Account

 public Account(IAccount other)
 {
     Id = other.Id;
     Email = other.Email;
     Password = other.Password;
     DomainName = other.DomainName;
 }
开发者ID:hungdluit,项目名称:sipserver,代码行数:7,代码来源:Account.cs

示例9: EditNotes

 private void EditNotes(IAccount account)
 {
     ("Note: " + account.Notes).Message();
     account.Notes = "Input new note: "
         .ReadLine();
     "Note saved.".Message();
 }
开发者ID:Cyarix,项目名称:PassFruit,代码行数:7,代码来源:AccountDetailSection.cs

示例10: GetAccountFundSalesStep

        public static void GetAccountFundSalesStep( IAccount account, out System.Collections.Generic.IList<Sage.Entity.Interfaces.IAccountFundSales> result)
        {
            //Get a list of all fund sales for this contact
            Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IAccountFundSales> f = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IAccountFundSales>();
            Sage.Platform.Repository.ICriteria crit = f.CreateCriteria();

            crit.Add(f.EF.Eq("AccountId", account.Id.ToString()));

            result = crit.List<Sage.Entity.Interfaces.IAccountFundSales>();

            //Get distinct values

            //Calculate the total values
            double totalSales = (Double)(from h in result
                                    select h.TotalSales).Distinct().Sum();

            double totalYTDGrossSales = (Double)(from h in result
                                                 select h.TotalYTDGrossSales).Distinct().Sum();

            double totalYTDNetSales = (Double)(from h in result
                                            select h.TotalYTDNetSales).Distinct().Sum();

            //Add the totals to the the result set
            Sage.Entity.Interfaces.IAccountFundSales totalItem = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IAccountFundSales>();
            totalItem.RepName = "All";
            totalItem.Sales = totalSales;
            totalItem.YTDGrossSales = totalYTDGrossSales;
            totalItem.YTDNetSales = totalYTDNetSales;

            result.Add (totalItem);
        }
开发者ID:ssommerfeldt,项目名称:TAC_AH,代码行数:31,代码来源:AccountExtension.cs

示例11: EditAccount

        public void EditAccount(IAccount account)
        {
            "Do you want to edit (T)ags, (F)ields, (N)otes or (D)elete the account?"
                .Option("t", () => EditTags(account))
                .Option("f", () => EditFields(account))
                .Option("n", () => EditNotes(account))
                .Option("d", () => _parentSection.DeleteAccount(account))
                .Choose();

            if (!account.IsDirty) {
                return;
            }

            var saved =
            "The account has been edited, press (S) to save it: "
                .Option("s", () => {
                    // ToDo: Save account
                    "Account saved.".Message();
                })
                .Confirm();

            if (saved) {
                return;
            }

            "Press (R) to revert the changes: "
                .Option("r", () => {
                    //ToDo: Revert account
                    "Account reverted.".Message();
                })
                .Choose();
        }
开发者ID:Cyarix,项目名称:PassFruit,代码行数:32,代码来源:AccountDetailSection.cs

示例12: ArgumentNullException

        bool IGroupSync.RemoveAccount(IAccount account)
        {
            if (account == null)
            {
                throw new ArgumentNullException(nameof(account));
            }

            IGroupMembership foundMembership = null;
            foreach (var item in this.AsInterface.GetAccountMemberships().Synchronously())
            {
                if ((item as IInternalGroupMembership).AccountHref.Equals(account.Href, StringComparison.InvariantCultureIgnoreCase))
                {
                    foundMembership = item;
                }

                if (foundMembership != null)
                {
                    break;
                }
            }

            if (foundMembership == null)
            {
                throw new InvalidOperationException("The specified account does not belong to this group.");
            }

            return foundMembership.Delete();
        }
开发者ID:ssankar1234,项目名称:stormpath-sdk-dotnet,代码行数:28,代码来源:DefaultGroup.MembershipSync.cs

示例13: ArgumentNullException

        async Task<bool> IGroup.RemoveAccountAsync(IAccount account, CancellationToken cancellationToken)
        {
            if (account == null)
            {
                throw new ArgumentNullException(nameof(account));
            }

            IGroupMembership foundMembership = null;
            await this.AsInterface.GetAccountMemberships().ForEachAsync(
                item =>
                {
                    if ((item as IInternalGroupMembership).AccountHref.Equals(account.Href, StringComparison.InvariantCultureIgnoreCase))
                    {
                        foundMembership = item;
                    }

                    return foundMembership != null;
                }, cancellationToken).ConfigureAwait(false);

            if (foundMembership == null)
            {
                throw new InvalidOperationException("The specified account does not belong to this group.");
            }

            return await foundMembership.DeleteAsync(cancellationToken).ConfigureAwait(false);
        }
开发者ID:jwynia,项目名称:stormpath-sdk-dotnet,代码行数:26,代码来源:DefaultGroup.Membership.cs

示例14: Throw

        public static IObservable<RecoveryOptionResult> Throw(IAccount account)
        {
            var errorMessage = string.Format(CultureInfo.InvariantCulture, 
                "You are using {0} out of {1} private repositories.", account.OwnedPrivateRepos, account.PrivateReposInPlan);

            return Throw(new PrivateRepositoryQuotaExceededUserError(account, errorMessage));
        }
开发者ID:chris134pravin,项目名称:VisualStudio,代码行数:7,代码来源:PrivateRepositoryQuotaExceededUserError.cs

示例15: PrivateRepositoryQuotaExceededUserError

 public PrivateRepositoryQuotaExceededUserError(IAccount account, string errorMessage, string errorCauseOrResolution = null)
     : base(errorMessage, errorCauseOrResolution)
 {
     UserErrorIcon = StockUserErrorIcon.Error;
     UsedPrivateSlots = account.OwnedPrivateRepos;
     AvaliblePrivateSlots = account.PrivateReposInPlan;
 }
开发者ID:chris134pravin,项目名称:VisualStudio,代码行数:7,代码来源:PrivateRepositoryQuotaExceededUserError.cs


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