本文整理汇总了C#中UserAction类的典型用法代码示例。如果您正苦于以下问题:C# UserAction类的具体用法?C# UserAction怎么用?C# UserAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserAction类属于命名空间,在下文中一共展示了UserAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Control
public Control(int panelId, DataTable data, List<string> PKColNames, UserAction action)
{
this.panelId = panelId;
this.data = data;
this.PKColNames = PKColNames;
this.action = action;
}
示例2: OnUserAction
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param)
{
ShellTile mainTile = ShellTile.ActiveTiles.FirstOrDefault();
switch (action)
{
case UserAction.Play:
if (PlayState.Paused == player.PlayerState)
{
player.Play();
mainTile.Update(new StandardTileData
{
BackContent = "Play"
});
}
break;
case UserAction.Pause:
player.Pause();
mainTile.Update(new StandardTileData
{
BackContent = "Pause"
});
break;
}
NotifyComplete();
}
示例3: OnUserAction
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param)
{
switch (action)
{
case UserAction.Play:
if (PlayState.Playing != player.PlayerState)
{
player.Play();
}
break;
case UserAction.Stop:
player.Stop();
break;
case UserAction.Pause:
if (PlayState.Playing == player.PlayerState)
{
player.Pause();
}
break;
case UserAction.Rewind:
player.Position = player.Position.Subtract(new TimeSpan(0,0,10));
break;
case UserAction.FastForward:
player.Position = player.Position.Add(new TimeSpan(0,0,10));
break;
}
NotifyComplete();
}
示例4: CalendarCell
/// ------------------------------------------------------------------------------------
public CalendarCell(Func<DateTime> getDefaultValue, UserAction whenToUseDefault)
{
_getDefaultValue = getDefaultValue ?? (() => DateTime.Now.Date);
_whenToUseDefault = whenToUseDefault;
// Use the short date format.
Style.Format = "d";
}
示例5: Display
public ActionResult Display(string name)
{
ProfileViewModel profileViewModel = new ProfileViewModel();
User displayUser = null;
int userID = 0;
User thisUser = Users.GetLoggedInUser();
if (Int32.TryParse(name, out userID)) {
displayUser = Users.GetUser(userID);
} else {
displayUser = Users.GetUser(name);
}
if (displayUser == null) {
return RedirectToAction("Index");
}
profileViewModel.User = displayUser;
// relationships
if (displayUser.UserID != thisUser.UserID) {
profileViewModel.CommonUserRelationships = UserRelationships.GetCommonRelationshipUsers(displayUser.UserID, thisUser.UserID);
profileViewModel.CommonCarsCourses = UserRelationships.GetCommonCourses(displayUser.UserID, thisUser.UserID);
profileViewModel.ViewerRelationshipToUser = UserRelationships.GetRelationshipStatus(thisUser.UserID, displayUser.UserID);
} else {
profileViewModel.CommonUserRelationships = null;
profileViewModel.CommonCarsCourses = null;
}
/*
profileViewModel.Children = db.FamilyMember
.Where(fm => fm.UserID == displayUser.UserID && fm.Family == "C")
.OrderBy(fm => fm.BirthDate)
.ToList();
profileViewModel.Spouses = db.CarsRelationships
.Where(fm => (fm.PrimaryID == displayUser.UserID && fm.Relationship == "HW") ||
(fm.SecondaryID == displayUser.UserID && fm.Relationship == "WH"))
.ToList();
*/
UserAction ua = new UserAction() {
SourceUserID = thisUser.UserID,
TargetUserID = displayUser.UserID,
UserActionType = UserActionType.ViewProfile,
ActionDate = DateTime.Now,
GroupID = 0,
MessageID = 0,
PostCommentID = 0,
PostID = 0,
Text = ""
};
db.UserActions.Add(ua);
db.SaveChanges();
return View(profileViewModel);
}
示例6: OnUserAction
/// <summary>
/// Called when the user requests an action using system-provided UI and the application has requesed
/// notifications of the action
/// </summary>
/// <param name="player">The BackgroundAudioPlayer</param>
/// <param name="track">The track playing at the time of the user action</param>
/// <param name="action">The action the user has requested</param>
/// <param name="param">The data associated with the requested action.
/// In the current version this parameter is only for use with the Seek action,
/// to indicate the requested position of an audio track</param>
/// <remarks>
/// User actions do not automatically make any changes in system state; the agent is responsible
/// for carrying out the user actions if they are supported
/// </remarks>
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action, object param)
{
if (action == UserAction.Play)
player.Play();
else if (action == UserAction.Pause)
player.Pause();
NotifyComplete();
}
示例7: AddActionAtFirstIndex
public IList<UserAction> AddActionAtFirstIndex(UserAction action)
{
using (IRedisTypedClient<UserAction> redis = _redisClient.GetTypedClient<UserAction>())
{
IRedisList<UserAction> userActions = redis.Lists["user:actions"];
userActions.Enqueue(action);
return userActions;
}
}
示例8: AddMovie
public void AddMovie(Guid userId, string userName, Movie movie)
{
TinyMovie tinyMovie = (TinyMovie)movie;
user_movie userMovie = Mapper.Map<TinyMovie, user_movie>(tinyMovie);
userMovie.user_movie_user_id = userId;
_userMovieRepo.Insert(userMovie);
UserAction actionToAdd = new UserAction(userName, movie);
actionToAdd.Action = Action.ADD_MOVIE;
AddUserAction(actionToAdd);
}
示例9: doAction
//Methods
public void doAction(UserAction userAction)
{
userAction.doAction();
actionList.AddFirst(userAction);
//cancel old actions
if (countUndo > 0)
{
countUndo = 0;
actionUndoList.Clear();
}
}
示例10: btnAddNewGlassType_Click
private void btnAddNewGlassType_Click(object sender, RoutedEventArgs e)
{
_glassTypeAction = UserAction.AddNew;
btnSaveNewGlassType.IsEnabled = true;
txtGlassTypeName.IsReadOnly = false;
btnAddNewGlassType.IsEnabled = false;
btnEditGlassType.IsEnabled = false;
btnSaveNewGlassType.IsEnabled = true;
btnDeleteGlassType.IsEnabled = false;
btnCancelGlassType.IsEnabled = true;
txtGlassTypeName.Focus();
}
示例11: TreeControl
public TreeControl(DataTable data, string PKColName, // tree controls must have a single-column primary key
string parentColName, string displayColName,
UserAction action)
: base(data, PKColName, action)
{
this.parentColName = parentColName;
this.displayColName = displayColName;
ds = new DataSet();
this.data.TableName = "data";
ds.Tables.Add(this.data);
ds.Relations.Add("hierarchy",
ds.Tables[0].Columns[PKColNames[0]], ds.Tables[0].Columns[parentColName]);
}
示例12: LoadFromXML
public static void LoadFromXML(string path, ref List<UserAction> ActionList)
{
FileStream fs = null;
try
{
fs = new FileStream(path, FileMode.Open, FileAccess.Read);
XmlReader xrReport = XmlReader.Create(fs);
XmlDocument xdoc = new XmlDocument();
xdoc.Load(xrReport);
// xdoc.SelectSingleNode("/Record/
ActionHost.ptWindowPoint = new System.Drawing.Point(
Convert.ToInt32(xdoc.DocumentElement.SelectSingleNode("LeftTop/Top").InnerText),
Convert.ToInt32(xdoc.DocumentElement.SelectSingleNode("LeftTop/Left").InnerText)
);
ActionHost.szTargetBounds = new System.Drawing.Size(
Convert.ToInt32(xdoc.DocumentElement.SelectSingleNode("RightBottom/Right").InnerText) - ActionHost.ptWindowPoint.X,
Convert.ToInt32(xdoc.DocumentElement.SelectSingleNode("RightBottom/Bottom").InnerText) - ActionHost.ptWindowPoint.Y
);
ActionHost.strTargetExeName = xdoc.DocumentElement.SelectSingleNode("ProgramExe").InnerText;
ActionHost.TargetWindow = new IntPtr(Convert.ToInt32(xdoc.DocumentElement.SelectSingleNode("MainWindowHandle").InnerText));
XmlNodeList xnlEvents = xdoc.SelectNodes("Record/Events/Event");
foreach (XmlNode xnEvent in xnlEvents)
{
System.Windows.Forms.Message mes = new System.Windows.Forms.Message();
mes.Msg = Int32.Parse(xnEvent.SelectSingleNode("Message").InnerXml);
int mouseX = Int32.Parse(xnEvent.SelectSingleNode("Coords/X").InnerXml);
int mouseY = Int32.Parse(xnEvent.SelectSingleNode("Coords/Y").InnerXml);
System.Drawing.Point mouseCoords = new System.Drawing.Point(mouseX, mouseY);
UserAction uaItem = new UserAction(mes, (uint)ActionHost.TargetWindow.ToInt32());
uaItem.MouseCoords = mouseCoords;
ActionHost.AddItem(uaItem);
string val = xnEvent.InnerXml;
}
xrReport.Close();
}
finally
{
fs.Close();
}
}
示例13: OnUserAction
/// <summary>
/// Called when the user requests an action using system-provided UI and the application has requesed
/// notifications of the action
/// </summary>
/// <param name="player">The BackgroundAudioPlayer</param>
/// <param name="track">The track playing at the time of the user action</param>
/// <param name="action">The action the user has requested</param>
/// <param name="param">The data associated with the requested action.
/// In the current version this parameter is only for use with the Seek action,
/// to indicate the requested position of an audio track</param>
/// <remarks>
/// User actions do not automatically make any changes in system state; the agent is responsible
/// for carrying out the user actions if they are supported
/// </remarks>
protected override void OnUserAction(BackgroundAudioPlayer player, AudioTrack track, UserAction action,
object param)
{
switch (action)
{
case UserAction.Play:
playTrack(player);
break;
case UserAction.Stop:
player.Stop();
break;
}
NotifyComplete();
}
示例14: SwipeControl
public void SwipeControl(UserAction action)
{
if (action == UserAction.SWIPE_RIGHT && IsBackRun){
IsBackRun = false;
}
else if (action == UserAction.SWIPE_RIGHT && !IsBackRun) {
IsForwardRun = true;
}
else if (action == UserAction.SWIPE_LEFT && IsForwardRun) {
IsForwardRun = false;
}
else if (action == UserAction.SWIPE_LEFT && !IsForwardRun) {
IsBackRun = true;
}
else if (action == UserAction.SWIPE_UP) {
IsJump = true;
}
}
示例15: NotifyUserAction
private void NotifyUserAction(UserAction arg1, IDictionary<string, object> arg2)
{
Debug.Log("Event: NotifyUserAction Fired");
//The following are potential UserActions:
// AchievementViewAction = 100,
// AchievementEngagedAction = 101,
// AchievementDismissedAction = 102,
// SponsorContentViewedAction = 103,
// SponsorContentEngagedAction = 104,
// SponsorContentDismissedAction = 105,
// PortalViewedAction = 106,
// SignInAction = 107,
// SignOutAction = 108,
// RegisteredAction = 109,
// PortalDismissedAction = 110,
// RedeemedRewardAction = 111,
// CheckinCompletedAction = 112,
// VirtualItemRewardAction = 113
}