本文整理汇总了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>();
}
示例2: Transaction
public Transaction(IAccount account, IPayment payout, string currency)
{
Account = account;
Payment = payout;
Currency = currency;
CreatedAt = DateTime.Now;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例8: Account
public Account(IAccount other)
{
Id = other.Id;
Email = other.Email;
Password = other.Password;
DomainName = other.DomainName;
}
示例9: EditNotes
private void EditNotes(IAccount account)
{
("Note: " + account.Notes).Message();
account.Notes = "Input new note: "
.ReadLine();
"Note saved.".Message();
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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));
}
示例15: PrivateRepositoryQuotaExceededUserError
public PrivateRepositoryQuotaExceededUserError(IAccount account, string errorMessage, string errorCauseOrResolution = null)
: base(errorMessage, errorCauseOrResolution)
{
UserErrorIcon = StockUserErrorIcon.Error;
UsedPrivateSlots = account.OwnedPrivateRepos;
AvaliblePrivateSlots = account.PrivateReposInPlan;
}