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


C# UserAction类代码示例

本文整理汇总了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;
 }
开发者ID:rjankovic,项目名称:webminVS2010,代码行数:7,代码来源:Control.cs

示例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();
        }
开发者ID:OlivierRiberi,项目名称:3NET-SimpleRadio,代码行数:29,代码来源:AudioPlayer.cs

示例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();
        }
开发者ID:juhariis,项目名称:Windows-Phone-Starter-Kit-for-Podcasts,代码行数:32,代码来源:AudioPlayer.cs

示例4: CalendarCell

		/// ------------------------------------------------------------------------------------
		public CalendarCell(Func<DateTime> getDefaultValue, UserAction whenToUseDefault)
		{
			_getDefaultValue = getDefaultValue ?? (() => DateTime.Now.Date);
			_whenToUseDefault = whenToUseDefault;
			// Use the short date format.
			Style.Format = "d";
		}
开发者ID:jwickberg,项目名称:libpalaso,代码行数:8,代码来源:CalendarCell.cs

示例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);
        }
开发者ID:dallasseminary,项目名称:Didache,代码行数:59,代码来源:CommunityController.cs

示例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();
 }
开发者ID:whrxiao,项目名称:Windows-Phone-7-In-Action,代码行数:22,代码来源:AudioPlayer.cs

示例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;
     }
 }
开发者ID:Grekk,项目名称:MovieAPI,代码行数:9,代码来源:UserActionsDAO.cs

示例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);
        }
开发者ID:Grekk,项目名称:MovieAPI,代码行数:12,代码来源:UserService.cs

示例9: doAction

        //Methods
        public void doAction(UserAction userAction)
        {
            userAction.doAction();
            actionList.AddFirst(userAction);

            //cancel old actions
            if (countUndo > 0)
            {
                countUndo = 0;
                actionUndoList.Clear();
            }
        }
开发者ID:Nicoletti-Seb,项目名称:Oculus-Rift-Outil-de-gestion,代码行数:13,代码来源:ManagerAction.cs

示例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();
        }
开发者ID:ultrasonicsoft,项目名称:G1,代码行数:13,代码来源:PriceSettingsContent.xaml.cs

示例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]);
 }
开发者ID:rjankovic,项目名称:deskmin,代码行数:13,代码来源:Control.cs

示例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();

            }
        }
开发者ID:alexryassky,项目名称:actionlogger,代码行数:49,代码来源:cFunc.cs

示例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();
        }
开发者ID:woodgate,项目名称:MegastrazWP7,代码行数:30,代码来源:AudioPlayer.cs

示例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;
     }
 }
开发者ID:Snarkvadim,项目名称:vremenny,代码行数:18,代码来源:PlayerControlHolder.cs

示例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
 }
开发者ID:sessionm,项目名称:sessionm-enterprise-unity,代码行数:19,代码来源:SessionMListenerExample.cs


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