• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BaseController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BaseController的典型用法代码示例。如果您正苦于以下问题:C# BaseController类的具体用法?C# BaseController怎么用?C# BaseController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BaseController类属于命名空间,在下文中一共展示了BaseController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SendNotifications

 public static void SendNotifications(BaseController controller, Message message, SiteConfiguration config, ITopicsSubscriptionsService service)
 {
     if (!config.Notifications.Subscription.IsDefined)
     {
         return;
     }
     var threadUrl = controller.Domain;
     threadUrl += controller.Url.RouteUrl(new
     {
         controller = "Topics",
         action = "ShortUrl",
         id = message.Topic.Id
     });
     threadUrl += "#msg" + message.Id;
     //Build a generic url that can be replaced with the real values
     var unsubscribeUrl = controller.Domain + controller.Url.RouteUrl(new
     {
         controller = "TopicsSubscriptions",
         action = "Unsubscribe",
         uid = Int32.MaxValue,
         tid = message.Topic.Id,
         guid = Int64.MaxValue.ToString()
     });
     unsubscribeUrl = unsubscribeUrl.Replace(Int32.MaxValue.ToString(), "{0}");
     unsubscribeUrl = unsubscribeUrl.Replace(Int64.MaxValue.ToString(), "{1}");
     service.SendNotifications(message, controller.User.Id, threadUrl, unsubscribeUrl);
 }
开发者ID:jorgebay,项目名称:nearforums,代码行数:27,代码来源:SubscriptionHelper.cs


示例2: DeleteTag

        public static ActionResult DeleteTag(BaseController controller, int id, int? personId = null, int? showId = null)
        {
            if (id == Photo.NoPic)
            {
                controller.RollbackTransactionFast();
                return new HttpBadRequestResult("Cannot tag this photo.");
            }

            if (personId.HasValue)
            {
                // only delete the tag if the photo is not the Person's default photo
                controller.DatabaseSession.Execute(
                    "DELETE FROM PersonPhoto WHERE PhotoId = @PhotoId AND PersonId = @PersonId AND NOT EXISTS (SELECT * FROM Person WHERE PhotoId = @PhotoId AND PersonId = @PersonId)"
                    , new { PhotoId = id, PersonId = personId.Value });
            }

            if (showId.HasValue)
            {
                // only delete the tag if the photo is not the Show's default photo
                controller.DatabaseSession.Execute(
                    "DELETE FROM ShowPhoto WHERE PhotoId = @PhotoId AND ShowId = @ShowId AND NOT EXISTS (SELECT * FROM Show WHERE PhotoId = @PhotoId AND ShowId = @ShowId)"
                    , new { PhotoId = id, ShowId = showId.Value });
            }

            return null;
        }
开发者ID:jdaigle,项目名称:FriendsOfDT,代码行数:26,代码来源:PhotosController.cs


示例3: Initialize

 /// <summary>
 /// Initializes the view 
 /// </summary>
 /// <param name="_gameflowController">The gameflow controller.</param>
 public override void Initialize(BaseController _gameflowController)
 {
     m_gameflowController = (GameflowController)_gameflowController;
     m_gameflowController.OnDicesThrowed += OnDicesThrowed;
     m_gameflowController.GetModel().OnTurnChanged += OnTurnChanged;
     base.Initialize(_gameflowController);
 }
开发者ID:SebastianVargas,项目名称:PruebaTecnica,代码行数:11,代码来源:ThrowDicesView.cs


示例4: Initialize

 /// <summary>
 /// Initializes the view and suscribe for pause and unpause event
 /// </summary>
 /// <param name="_gameflowController">The gameflow controller.</param>
 public override void Initialize(BaseController _gameflowController)
 {
     m_gameflowController = (GameflowController)_gameflowController;
     base.Initialize(_gameflowController);
     m_gameflowController.GetModel().OnGamePaused += OnGamePaused;
     m_gameflowController.GetModel().OnGameUnpaused += OnGameUnpaused;
 }
开发者ID:SebastianVargas,项目名称:PruebaTecnica,代码行数:11,代码来源:PauseGameView.cs


示例5: Initialize

 /// <summary>
 /// Initializes the view and suscribe for turn changed event
 /// </summary>
 /// <param name="_gameflowController">The gameflow controller.</param>
 public override void Initialize(BaseController _gameflowController)
 {
     m_gameflowController = (GameflowController)_gameflowController;
     base.Initialize(_gameflowController);
     m_gameflowController.GetModel().OnTurnChanged += OnTurnChanged;
     m_animator = GetComponentInChildren<Animator>();
 }
开发者ID:SebastianVargas,项目名称:PruebaTecnica,代码行数:11,代码来源:TurnView.cs


示例6: Initialize

 /// <summary>
 /// Initializes the view and suscribe for second tick event
 /// </summary>
 /// <param name="_gameflowController">The _gameflow controller.</param>
 public override void Initialize(BaseController _gameflowController)
 {
     m_gameTimeText = GetComponent<Text>();
     m_gameflowController = (GameflowController)_gameflowController;
     base.Initialize(_gameflowController);
     m_gameflowController.GetModel().OnTimeTick += OnTimeTick;
 }
开发者ID:SebastianVargas,项目名称:PruebaTecnica,代码行数:11,代码来源:GameTimeView.cs


示例7: Workspace

        public Workspace(BaseController controller, Uri resources, Action dispose)
        {
            Resources = resources;

            _controller = controller;
            _dispose = dispose;
        }
开发者ID:jrgcubano,项目名称:Simple.Wpf.Composition,代码行数:7,代码来源:Workspace.cs


示例8: Delete

        public static ActionResult Delete(BaseController controller, int id)
        {
            if (id == Photo.NoPic)
            {
                controller.RollbackTransactionFast();
                return new HttpBadRequestResult("Cannot delete this photo.");
            }

            var photo = controller.DatabaseSession.Get<Photo>(id);
            if (photo == null)
            {
                return new HttpNotFoundResult("Photo not found");
            }

            // This is a hard delete.
            controller.DatabaseSession.Execute(@"
            UPDATE Person SET PhotoId = 1 WHERE PhotoId = @PhotoId;
            UPDATE Show SET PhotoId = 1 WHERE PhotoId = @PhotoId;
            DELETE FROM PersonPhoto WHERE PhotoId = @PhotoId;
            DELETE FROM ShowPhoto WHERE PhotoId = @PhotoId;
            DELETE FROM Photo WHERE PhotoId = @PhotoId;
            ", new { PhotoId = id });

            // TODO: delete blob

            return null;
        }
开发者ID:jdaigle,项目名称:FriendsOfDT,代码行数:27,代码来源:PhotosController.cs


示例9: RedirectIfAuthorized

        protected RedirectToRouteResult RedirectIfAuthorized(BaseController controller, String actionName, String controllerName)
        {
            RedirectToRouteResult result = new RedirectToRouteResult(new RouteValueDictionary());
            controller.When(sub => sub.RedirectIfAuthorized(actionName, controllerName)).DoNotCallBase();
            controller.RedirectIfAuthorized(actionName, controllerName).Returns(result);

            return result;
        }
开发者ID:NonFactors,项目名称:MVC5.Template,代码行数:8,代码来源:ControllerTests.cs


示例10: RedirectToNotFound

        protected RedirectToRouteResult RedirectToNotFound(BaseController controller)
        {
            RedirectToRouteResult result = new RedirectToRouteResult(new RouteValueDictionary());
            controller.When(sub => sub.RedirectToNotFound()).DoNotCallBase();
            controller.RedirectToNotFound().Returns(result);

            return result;
        }
开发者ID:NonFactors,项目名称:MVC5.Template,代码行数:8,代码来源:ControllerTests.cs


示例11: NotEmptyView

        protected RedirectToRouteResult NotEmptyView(BaseController controller, Object model)
        {
            RedirectToRouteResult result = new RedirectToRouteResult(new RouteValueDictionary());
            controller.When(sub => sub.NotEmptyView(model)).DoNotCallBase();
            controller.NotEmptyView(model).Returns(result);

            return result;
        }
开发者ID:NonFactors,项目名称:MVC5.Template,代码行数:8,代码来源:ControllerTests.cs


示例12: Initialize

 public override void Initialize(BaseController _tokenController)
 {
     m_tokenController = (TokenController)_tokenController;
     m_tokenController.GetModel().OnTokenMoved += OnTokenMoved;
     m_tokenController.GetModel().OnTokenTeleported += OnTokenTeleported;
     m_boardController = GameObject.FindObjectOfType<BoardController>();
     base.Initialize(_tokenController);
 }
开发者ID:SebastianVargas,项目名称:PruebaTecnica,代码行数:8,代码来源:TokenView.cs


示例13: RedirectToNotFound

        protected RedirectToActionResult RedirectToNotFound(BaseController controller)
        {
            RedirectToActionResult result = new RedirectToActionResult(null, null, null);
            controller.When(sub => sub.RedirectToNotFound()).DoNotCallBase();
            controller.RedirectToNotFound().Returns(result);

            return result;
        }
开发者ID:NonFactors,项目名称:MVC6.Template,代码行数:8,代码来源:ControllerTests.cs


示例14: NotEmptyView

        protected RedirectToActionResult NotEmptyView(BaseController controller, Object model)
        {
            RedirectToActionResult result = new RedirectToActionResult(null, null, null);
            controller.When(sub => sub.NotEmptyView(model)).DoNotCallBase();
            controller.NotEmptyView(model).Returns(result);

            return result;
        }
开发者ID:NonFactors,项目名称:MVC6.Template,代码行数:8,代码来源:ControllerTests.cs


示例15: OnStateEnter

 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state.
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     _animator = animator;
     gameObject = _animator.gameObject;
     transform = gameObject.transform;
     rigidbody = gameObject.GetComponent<Rigidbody> ();
     _controller = gameObject.GetComponent<BaseController> ();
 }
开发者ID:somers353,项目名称:gamedev-group1A,代码行数:9,代码来源:LocomotionBehaviour.cs


示例16: Initialize

 public override void Initialize(BaseController _tileController)
 {
     m_tileController = (TileController)_tileController;
     base.Initialize(_tileController);
     SetupWorldPosition(ReferencesHolder.Instance.GameConfigurationHolder.GetGameConfiguration().BoardConfiguration);
     SetupColor();
     SetupNumberText();
 }
开发者ID:SebastianVargas,项目名称:PruebaTecnica,代码行数:8,代码来源:TileView.cs


示例17: RedirectToAction

        protected RedirectToActionResult RedirectToAction(BaseController baseController, String action, String controller)
        {
            RedirectToActionResult result = new RedirectToActionResult(null, null, null);
            baseController.When(sub => sub.RedirectToAction(action, controller)).DoNotCallBase();
            baseController.RedirectToAction(action, controller).Returns(result);

            return result;
        }
开发者ID:NonFactors,项目名称:MVC6.Template,代码行数:8,代码来源:ControllerTests.cs


示例18: InitializeBusinessRulesCommand

 public InitializeBusinessRulesCommand(BaseController<Expense> expenseController,
     BaseController<Income> incomeController, BaseController<Account> accountController,
     ExpenseStatusService paymentStatusService)
 {
     _expenseController = expenseController;
     _incomeController = incomeController;
     _accountController = accountController;
     _paymentSvc = paymentStatusService;
 }
开发者ID:mariomeyrelles,项目名称:VSTO-Cash-Flow,代码行数:9,代码来源:InitializeBusinessRulesCommand.cs


示例19: Awake

 void Awake()
 {
     obj = new List<GameObject> () {null, null, null, null, null, null};
     Blue = GameObject.FindGameObjectWithTag ("BlueBase").GetComponent<BaseController> ();
     Red = GameObject.FindGameObjectWithTag ("RedBase").GetComponent<BaseController> ();
     for (int i = 0; i < 6; i++) {
         obj [i] = transform.GetChild (i).gameObject;
         obj [i].SetActive (false);
     }
 }
开发者ID:Avekeez,项目名称:Space-Wars-Unity,代码行数:10,代码来源:DisplayActiveLanes.cs


示例20: SetTarget

    public void SetTarget(BaseController target)
    {
        if(target == null)
        {
            targetTransform = null;
            return;
        }

        SetTarget(target.transform);
    }
开发者ID:dsanekata,项目名称:BattleMock_2D,代码行数:10,代码来源:FollowCamera.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BaseCreature类代码示例发布时间:2022-05-24
下一篇:
C# BaseContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap