This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<string> tableItems; | |
List<string> sections; | |
Dictionary<int,List<string>> sectionData = new Dictionary<int, List<string>> (); | |
string cellIdentifier = "Identifier"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SimpleTabBarController () | |
{ | |
Title = "Sample Tab Bar"; | |
EdgesForExtendedLayout = UIRectEdge.None; | |
TabBar.Frame = new CGRect (0, 70, TabBar.Frame.Width, TabBar.Frame.Height); | |
tab1 = new UIViewController (); | |
tab1.Title = "Green"; | |
tab1.View.BackgroundColor = UIColor.Green; | |
tab2 = new UIViewController (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
namespace SampleAudit | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AuditLogActionFilter(ActionType = "AccessIndex")] | |
public ActionResult Index() | |
{ | |
return View(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
// Retrieve the information what we need to log | |
string routeInfo = GetRouteData(filterContext.RouteData); | |
string user = filterContext.HttpContext.User.Identity.Name; | |
Debug.WriteLine(String.Format("ActionExecuting - {0} ActionType: {1}; User:{2}" | |
, routeInfo, ActionType, user), "Audit Log"); | |
base.OnActionExecuting(filterContext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void OnActionExecuted(ActionExecutedContext filterContext) | |
{ | |
// Retrieve the information what we need to log | |
string routeInfo = GetRouteData(filterContext.RouteData); | |
bool isActionSucceeded = filterContext.Exception == null; | |
string user = filterContext.HttpContext.User.Identity.Name; | |
Debug.WriteLine(String.Format("ActionExecuted - {0} ActionType: {1}; Executed successfully:{2}; User:{3}" | |
, routeInfo, ActionType, isActionSucceeded, user), "Audit Log"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetRouteData(RouteData routeData) | |
{ | |
var controller = routeData.Values["controller"]; | |
var action = routeData.Values["action"]; | |
return String.Format("Controller:{0}; Action:{1};", controller, action); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual void OnActionExecuted(ActionExecutedContext filterContext) | |
public virtual void OnActionExecuting(ActionExecutingContext filterContext) | |
public virtual void OnResultExecuted(ResultExecutedContext filterContext) | |
public virtual void OnResultExecuting(ResultExecutingContext filterContext) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
base.OnActionExecuting(filterContext); | |
} | |
public override void OnActionExecuted(ActionExecutedContext filterContext) | |
{ | |
base.OnActionExecuted(filterContext); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static ConcurrentDictionary<string, ToDoItem> todoItems = new ConcurrentDictionary<string, ToDoItem>(); | |
// GET: /Sample/ | |
public ActionResult Index() | |
{ | |
var data = todoItems.Values; | |
return View(data.AsEnumerable<ToDoItem>()); | |
} | |
public ActionResult AddItem() |
OlderNewer