本文整理汇总了C#中ItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ItemEventArgs类的具体用法?C# ItemEventArgs怎么用?C# ItemEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemEventArgs类属于命名空间,在下文中一共展示了ItemEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ItemsList_ItemInvoked
/// <summary>
/// Logs in a user when one is selected
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
async void ItemsList_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var model = (UserDtoViewModel)e.Argument;
var user = model.User;
if (user.HasPassword)
{
await NavigationManager.Navigate(new ManualLoginPage(user.Name, ChkAutoLogin.IsChecked, SessionManager, PresentationManager));
return;
}
try
{
await SessionManager.Login(user.Name, string.Empty, (bool)ChkAutoLogin.IsChecked);
}
catch (Exception ex)
{
PresentationManager.ShowMessage(new MessageBoxInfo
{
Caption = "Login Failure",
Text = ex.Message,
Icon = MessageBoxIcon.Error
});
}
}
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:30,代码来源:LoginPage.xaml.cs
示例2: ItemsList_ItemInvoked
/// <summary>
/// Logs in a user when one is selected
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
async void ItemsList_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var model = (UserDtoViewModel)e.Argument;
var user = model.User;
if (user.HasPassword)
{
await NavigationManager.Navigate(new ManualLoginPage(user.Name, SessionManager, PresentationManager));
return;
}
try
{
await SessionManager.Login(user.Name, string.Empty);
}
catch (HttpException ex)
{
if (ex.StatusCode.HasValue && (ex.StatusCode.Value == HttpStatusCode.Unauthorized || ex.StatusCode.Value == HttpStatusCode.Forbidden))
{
PresentationManager.ShowMessage(new MessageBoxInfo
{
Caption = "Login Failure",
Text = "Invalid username or password. Please try again.",
Icon = MessageBoxIcon.Error
});
}
else
{
PresentationManager.ShowDefaultErrorMessage();
}
}
}
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:37,代码来源:LoginPage.xaml.cs
示例3: OnChannelError
public virtual void OnChannelError(ItemEventArgs<Exception> args)
{
if (ChannelError != null)
{
ChannelError.SafeEventInvoke(this, args);
}
}
开发者ID:onesimoh,项目名称:Andamio,代码行数:7,代码来源:BroadcastingChannel.cs
示例4: HandleKeyPressed
private void HandleKeyPressed (object sender, ItemEventArgs<Keys> e)
{
if(e.Item == Keys.Back)
{
var length = Text.Length - 1;
if(length >= 0)
Text = Text.Substring(0, length);
}
else
{
string keyValue;
if(_keyStringMap.TryGetValue(e.Item, out keyValue))
{
Text += keyValue;
}
else
{
if(e.Item >= Keys.A && e.Item <= Keys.Z)
{
var stringValue = e.Item.ToString();
if(_isShiftDown)
stringValue = stringValue.ToUpper();
else
stringValue = stringValue.ToLower();
Text += stringValue;
}
}
}
}
开发者ID:netonjm,项目名称:Rube.Net,代码行数:32,代码来源:TextBox.cs
示例5: TrinityOnItemSold
internal static void TrinityOnItemSold(object sender, ItemEventArgs e)
{
ResetTownRun();
try
{
ACDItem i = e.Item;
if (i == null || !i.IsValid || i.IsDisposed)
return;
var cachedItem = CachedACDItem.GetCachedItem(i);
switch (i.ItemBaseType)
{
case ItemBaseType.Gem:
case ItemBaseType.Misc:
break;
default:
TownRun.LogJunkItems(cachedItem, cachedItem.TrinityItemBaseType, cachedItem.TrinityItemType, ItemValuation.ValueThisItem(cachedItem, cachedItem.TrinityItemType));
break;
}
}
catch (Exception ex)
{
if (ex is CoroutineStoppedException)
throw;
}
}
开发者ID:mythsya,项目名称:db-plugins,代码行数:28,代码来源:ItemEvents.cs
示例6: HandleSettingsChanged
private void HandleSettingsChanged(object sender, ItemEventArgs<Core.Model.Settings> e)
{
foreach (IPresenter presenter in _presenters)
{
presenter.UpdateSettings(e.Item);
}
}
开发者ID:VasiliBaranov,项目名称:navigation-assistant,代码行数:7,代码来源:PresenterManager.cs
示例7: HandleCurrentFloorChanged
public void HandleCurrentFloorChanged(Object o, ItemEventArgs<int> e)
{
int topMargin = (25 * (10 - e.Item - 1));
txtStatus.Text = topMargin.ToString();
Top = topMargin;
//Refresh();
}
开发者ID:trevorhigbee,项目名称:trevorhigbee_standard_elevator,代码行数:7,代码来源:ElevatorIcon.cs
示例8: _themeManager_ThemeLoaded
void _themeManager_ThemeLoaded(object sender, ItemEventArgs<ITheme> e)
{
if (App.Instance.ApplicationWindow != null)
{
App.Instance.ApplicationWindow.PageContent.DataContext = e.Argument.CreatePageContentDataContext();
}
}
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:7,代码来源:TheaterApplicationWindow.cs
示例9: PersisterOnChanged
private void PersisterOnChanged(object sender, ItemEventArgs itemEventArgs)
{
if (itemEventArgs.AffectedItem is PartDefinitionPage)
{
_rebuild = true; // void cache
}
}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:7,代码来源:ContentPartTemplateProvider.cs
示例10: HandleReservationRemoved
public void HandleReservationRemoved(object sender, ItemEventArgs<IReservation> e)
{
if (e.Item.Direction == Direction)
{
_buttonList[e.Item.FloorIndex].BackColor = Color.Black;
}
}
开发者ID:trevorhigbee,项目名称:trevorhigbee_standard_elevator,代码行数:7,代码来源:ButtonPanel.cs
示例11: OnItemCreating
protected virtual void OnItemCreating(ItemEventArgs e)
{
EventHandler<ItemEventArgs> handler = base.Events[EventItemCreating] as EventHandler<ItemEventArgs>;
if (handler != null)
handler.Invoke(this, e);
if (e.AffectedItem != null)
{
IDefinitionManager definitions = Engine.Definitions;
ISecurityManager security = Engine.SecurityManager;
ContentActivator activator = Engine.Resolve<ContentActivator>();
ItemDefinition parentDefinition = definitions.GetDefinition(parentItem);
if (parentDefinition.IsChildAllowed(definitions, parentItem, parentDefinition))
{
e.AffectedItem = Engine.Resolve<ContentActivator>().CreateInstance(parentItem.GetContentType(), parentItem);
return;
}
foreach (ItemDefinition definition in definitions.GetAllowedChildren(parentItem, null).WhereAuthorized(security, HttpContext.Current.User, parentItem))
{
e.AffectedItem = activator.CreateInstance(definition.ItemType, parentItem);
return;
}
throw new N2.Definitions.NoItemAllowedException(parentItem);
}
}
开发者ID:nicklv,项目名称:n2cms,代码行数:26,代码来源:ChildrenDataSourceView.cs
示例12: ItemEventArgs_ItemTest
public void ItemEventArgs_ItemTest()
{
using (var verify = new Verify())
{
var x = new ItemEventArgs<string>("xxx");
verify.AreEqual("xxx", x.Item, "Item property was not set correctly");
}
}
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:ItemEventArgsTests.cs
示例13: lstItems_ItemInvoked
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var img = (BitmapImage)e.Argument;
var index = Images.IndexOf(img);
//App.Instance.OpenImageViewer(new Uri(ImageUrls[index]), Item.Name);
}
开发者ID:EchoDemon,项目名称:MediaBrowser.Theater,代码行数:13,代码来源:ItemGallery.xaml.cs
示例14: MenuList_ItemInvoked
async void MenuList_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var settingsPage = (ISettingsPage)e.Argument;
var page = (Page)_appHost.CreateInstance(settingsPage.PageType);
await _nav.Navigate(page);
}
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:8,代码来源:SettingsPage.xaml.cs
示例15: NotifyDeleting
/// <summary>Notify subscribers that an item is to be deleted.</summary>
/// <param name="itemToBeDeleted">The item that is to be deleted.</param>
/// <returns>True if the item was modified.</returns>
public void NotifyDeleting(ContentItem itemToBeDeleted)
{
if (ItemDeleting == null)
return;
var args = new ItemEventArgs(itemToBeDeleted);
ItemDeleting(this, args);
}
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:11,代码来源:ItemNotifier.cs
示例16: ItemCreatedEventHandler
void ItemCreatedEventHandler(object sender, ItemEventArgs e)
{
var item = e.AffectedItem;
var parent = e.AffectedItem.Parent;
if (parent == null)
return;
security.CopyPermissions(parent, item);
}
开发者ID:brianmatic,项目名称:n2cms,代码行数:9,代码来源:SecurityEnforcer.cs
示例17: lstItems_ItemInvoked
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var viewModel = (SpecialFeatureViewModel)e.Argument;
UIKernel.Instance.PlaybackManager.Play(new PlayOptions
{
Items = new List<BaseItemDto> { viewModel.Item }
});
}
开发者ID:EchoDemon,项目名称:MediaBrowser.Theater,代码行数:14,代码来源:ItemTrailers.xaml.cs
示例18: HandleRequestWindowShow
private void HandleRequestWindowShow(object sender, ItemEventArgs<Type> e)
{
foreach (IPresenter presenter in _presenters)
{
if (presenter.GetType() == e.Item)
{
presenter.Show();
}
}
}
开发者ID:VasiliBaranov,项目名称:navigation-assistant,代码行数:10,代码来源:PresenterManager.cs
示例19: definitions_ItemCreated
void definitions_ItemCreated(object sender, ItemEventArgs e)
{
if (GetLanguageKey() != null)
{
if (e.AffectedItem is ILanguage)
return;
UpdateSortOrder(e.AffectedItem);
}
}
开发者ID:AnonymousRetard,项目名称:n2cms,代码行数:10,代码来源:LanguageInterceptor.cs
示例20: lstItems_ItemInvoked
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var chapterViewModel = (ChapterInfoDtoViewModel) e.Argument;
UIKernel.Instance.PlaybackManager.Play(new PlayOptions
{
Items = new List<BaseItemDto> { Item },
StartPositionTicks = chapterViewModel.Chapter.StartPositionTicks
});
}
开发者ID:EchoDemon,项目名称:MediaBrowser.Theater,代码行数:15,代码来源:ItemChapters.xaml.cs
注:本文中的ItemEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论