本文整理汇总了C#中IContact类的典型用法代码示例。如果您正苦于以下问题:C# IContact类的具体用法?C# IContact怎么用?C# IContact使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IContact类属于命名空间,在下文中一共展示了IContact类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ContactViewModel
protected ContactViewModel(ChatClient client, IContact contact)
{
this.client = client;
this.contact = contact;
Contact.Changed += OnContactChanged;
OnContactChanged(Contact, null);
}
示例2: FileTransfer
public FileTransfer(XmppClientConnection xmppCon, IQ iq, IContact from)
: base(from)
{
_siIq = iq;
_si = iq.SelectSingleElement(typeof (SI)) as SI;
if (_si != null)
{
// get SID for file transfer
_sid = _si.Id;
_file = _si.File;
Contact = from;
if (_file != null)
{
_fileLength = _file.Size;
FileDescription = _file.Description;
FileName = _file.Name;
}
_xmppConnection = xmppCon;
}
}
示例3: Message
protected internal Message(IContact contact, string text, DateTime time, bool online)
{
Contact = contact;
Text = text;
Online = online;
Time = time;
}
示例4: TestBase
public TestBase()
{
var builder = new ContainerBuilder();
builder.RegisterType<DatabaseFactory>().As<IDatabaseFactory>().InstancePerLifetimeScope();
builder.RegisterType<UnityOfWork>().As<IUnitOfWork>();
builder.RegisterType<ContactRepostory>().AsImplementedInterfaces();
builder.RegisterType<ContactServices>().AsImplementedInterfaces();
builder.RegisterType<ProductRepository>().AsImplementedInterfaces();
builder.RegisterType<LodgingRepository>().AsImplementedInterfaces();
builder.RegisterType<ResortRepository>().AsImplementedInterfaces();
builder.RegisterType<ProductService>().AsImplementedInterfaces();
builder.RegisterType<LodgingService>().AsImplementedInterfaces();
builder.RegisterType<ResortService>().AsImplementedInterfaces();
#region 权限
builder.RegisterType<PermissionModuleRepository>().AsImplementedInterfaces();
builder.RegisterType<PermissionRoleRepository>().AsImplementedInterfaces();
builder.RegisterType<PermissionReRoleModuleRepostory>().AsImplementedInterfaces();
builder.RegisterType<PermissionSvc>().AsImplementedInterfaces();
#endregion
container= builder.Build();
this.unitOfWork = container.Resolve<IUnitOfWork>();
this.contact=container.Resolve<IContact>();
this.productsvc=container.Resolve<IProduct>();
this.resortSvc = container.Resolve<IResort>();
this.lodgingsvc = container.Resolve<ILodging>();
this.permissionSvc = container.Resolve<IPermission>();
// StartUp();
}
示例5: CanDelete
public OperationResult CanDelete([PexAssumeUnderTest] ContactManager target, IContact contact)
{
OperationResult result = target.CanDelete(contact);
return result;
// TODO: add assertions to method ContactManagerTest.CanDelete(ContactManager, IContact)
}
示例6: GroupsOpenUI
public void GroupsOpenUI(IContact contact)
{
GroupsWindow groupsWindow = new GroupsWindow(contact);
groupsWindow.Activate();
groupsWindow.ShowDialog();
}
示例7: CreateShortenedContactName
private string CreateShortenedContactName(IContact contact)
{
List<string> names = new List<string>();
foreach (string namePart in new string[] { contact.FirstName, contact.MiddleName, contact.LastName})
{
if (!string.IsNullOrEmpty(namePart))
{
names.Add(namePart);
}
}
if (names.Count == 0)
{
return contact.DisplayName;
}
string name;
if (names.Count == 1)
{
name = names[0];
}
else // if (names.Count > 1)
{
char lastInitial = names[names.Count - 1][0];
name = string.Format("{0} {1}.", names[0], lastInitial);
}
name = TruncateNameIfTooLong(name);
return name;
}
示例8: GroupsWindow
public GroupsWindow(IContact contact)
: base(_keyBase, string.Empty)
{
DataContext = contact;
InitializeComponent();
}
示例9: Handle
public IPreviewResult Handle(IContact contact)
{
Point transformedCoordinates;
IntPtr hWnd = desktop.GetWindowAt(new Point((int)contact.X, (int)contact.Y), out transformedCoordinates);
if (new SystemWindow(hWnd).WindowState == FormWindowState.Normal)
{
switch (contact.State)
{
case ContactState.New:
OnNewContact(hWnd, contact);
break;
case ContactState.Removed:
OnContactRemoved(hWnd, contact);
break;
case ContactState.Moved:
OnContactMoved(hWnd, contact);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
TransformedContact newContact = new TransformedContact(contact);
newContact.X = transformedCoordinates.X;
newContact.Y = transformedCoordinates.Y;
return new Result(hWnd, newContact);
}
示例10: GetFundRedemptionsStep
public static void GetFundRedemptionsStep(IContact contact, out System.Collections.Generic.IList<Sage.Entity.Interfaces.IContactFundRedemptions> result)
{
//Get a list of all fund redemptions for this contact
Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.IContactFundRedemptions> f = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.IContactFundRedemptions>();
Sage.Platform.Repository.ICriteria crit = f.CreateCriteria();
crit.Add(f.EF.Eq("ContactId", contact.Id.ToString()));
result = crit.List<Sage.Entity.Interfaces.IContactFundRedemptions>();
//Calculate the total values
double totalRedemptions = (Double)(from h in result
select h.TotalRedemptions).Distinct().Sum();
int totalAccounts = (Int32)(from h in result
select h.TotalNumberOfAccounts).Distinct().Sum();
double totalYTDRedemptions = (Double)(from h in result
select h.TotalYTDRedemptions).Distinct().Sum();
//Add the totals to the the result set
Sage.Entity.Interfaces.IContactFundRedemptions totalItem = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.IContactFundRedemptions>();
totalItem.RepCode = "-";
totalItem.FundName = "All";
totalItem.FundCode = "-";
totalItem.Redemptions = totalRedemptions;
totalItem.NumberOfAccounts = totalAccounts;
totalItem.YTDRedemptions = totalYTDRedemptions;
result.Add(totalItem);
}
示例11: OpenUserChat
public void OpenUserChat(IContact friend)
{
if (MainChatViewModel == null) MainChatViewModel = new MainChatViewModel();
if (!MainChatViewModel.IsActive)
{
_windowManager.ShowWindow(MainChatViewModel);
MainChatView = MainChatViewModel.GetView() as Window;
}
else
{
if (MainChatView != null)
{
if (MainChatView.WindowState == WindowState.Minimized) MainChatView.WindowState = WindowState.Normal;
MainChatView.Activate();
}
}
var tab = (from f in OpenTabs where f.Key == friend.UserId select f).FirstOrDefault();
// tab does exist ... Key == UserId
if (tab.Key != 0)
{
int tabIndex = OpenTabs.FirstOrDefault(t => t.Value == tab.Key).Value;
MainChatViewModel.Items.ElementAt(tabIndex).Activate();
return;
}
MainChatViewModel.OpenTab(this, friend);
OpenTabs.Add(friend.UserId, MainChatViewModel.Items.Count - 1);
}
示例12: CompareAlphabetically
public static int CompareAlphabetically(IContact contactA, IContact contactB)
{
int unknownCompare = CompareForUnknownContact(contactA, contactB);
if (unknownCompare != 0)
{
return unknownCompare;
}
List<string> contactAParts = GetNamePartsFromContact(contactA);
List<string> contactBParts = GetNamePartsFromContact(contactB);
int compareResult;
while ((contactAParts.Count > 0) && (contactBParts.Count > 0))
{
string aPart = contactAParts[0];
string bPart = contactBParts[0];
compareResult = string.Compare(aPart, bPart);
if (compareResult != 0)
{
return compareResult;
}
contactAParts.RemoveAt(0);
contactBParts.RemoveAt(0);
}
if (contactAParts.Count != contactBParts.Count)
{
return contactAParts.Count - contactBParts.Count;
}
return string.Compare(contactA.PhoneNumbers[0].Number, contactB.PhoneNumbers[0].Number);
}
示例13: VerifyRightSideGreater
private static void VerifyRightSideGreater(IContact contactA, IContact contactB)
{
int comparisonValue = ContactComparer_Accessor.CompareAlphabetically(contactA, contactB);
int unitValue = ReduceToUnitValue(comparisonValue);
Assert.AreEqual(1, unitValue);
}
示例14: Update
public void Update(IContact entity)
{
var contact = contacts.SingleOrDefault(g => g.Id == entity.Id);
contact.FirstName = entity.FirstName;
contact.LastName = entity.LastName;
}
示例15: Conversation
internal Conversation(ChatClient client, IContact who, ConversationEvents events)
{
this.client = client;
this.events = events;
Name = who.Name;
Contact = who;
events.UserAdded += OnUserAdded;
events.UserChanged += OnUserChanged;
events.UserRemoved += OnUserRemoved;
events.UserTyping += OnUserTyping;
events.ChatReceived += OnChatReceived;
if (Contact is IUser)
{
participants.Add(new Participant(Contact as IUser));
}
else
{
foreach (var member in (Contact as IGroup).Members)
{
participants.Add(new Participant(member));
}
}
}