Combine layouts

This commit is contained in:
2012-12-24 21:18:41 -05:00
parent c1944f6262
commit 05d1ae4ec6
83 changed files with 845 additions and 1210 deletions
+2
View File
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassWithVirtualMembersNeverInherited_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String></wpf:ResourceDictionary>
@@ -1,6 +1,5 @@
using System;
using MileageTraker.Web.Models;
using MileageTraker.Web.ViewModels;
using MileageTraker.Web.ViewModels.CreateLog;
using NUnit.Framework;
@@ -33,40 +32,14 @@ namespace Web.Tests.ViewModels
};
var log = viewModel.GetLog();
}
[Test]
public void Ctor_Initializes_From_Log()
{
var cityName = "My Town";
var date = DateTime.Today;
var employeeName = "Name";
var endOdometer = 1234;
var ethraId = "4567";
var gasPurchased = 2.546d;
var mileageLogType = MileageLogType.Commuting;
var log =
new Log
{
CityName = cityName,
Date = date,
EmployeeName = employeeName,
EndOdometer = endOdometer,
VehicleId = ethraId,
GasPurchased = gasPurchased,
LogType = mileageLogType
};
var viewModel = new CreateLogViewModel(log);
Assert.That(viewModel.CityName, Is.EqualTo(cityName));
Assert.That(viewModel.Date, Is.EqualTo(date.ToString("d")));
Assert.That(viewModel.EmployeeName, Is.EqualTo(employeeName));
Assert.That(viewModel.EndOdometer, Is.EqualTo(endOdometer.ToString()));
Assert.That(viewModel.VehicleId, Is.EqualTo(ethraId));
Assert.That(viewModel.GasPurchased, Is.EqualTo(gasPurchased.ToString()));
Assert.That(viewModel.LogType.Enum, Is.EqualTo(mileageLogType));
Assert.That(log.CityName, Is.EqualTo(cityName));
Assert.That(log.Date, Is.EqualTo(date));
Assert.That(log.EmployeeName, Is.EqualTo(employeeName));
Assert.That(log.EndOdometer.ToString(), Is.EqualTo(endOdometer));
Assert.That(log.VehicleId, Is.EqualTo(ethraId));
Assert.That(log.GasPurchased.ToString(), Is.EqualTo(gasPurchased));
Assert.That(log.LogType.Enum, Is.EqualTo(mileageLogType.Enum));
}
}
}
@@ -0,0 +1,25 @@
using MileageTraker.Web.ViewModels.User;
using NUnit.Framework;
namespace Web.Tests.ViewModels
{
[TestFixture]
public class CreateUserViewModelTests
{
[Test]
public void CloneToUser_CopiesProperties()
{
var vm = new CreateUserViewModel();
var email = vm.Email = "bob@dobalina.com";
var firstName = vm.FirstName = "bob";
var lastName = vm.LastName = "dobalina";
var user = vm.CloneToUser();
Assert.That(user.Email, Is.EqualTo(email));
Assert.That(user.FirstName, Is.EqualTo(firstName));
Assert.That(user.LastName, Is.EqualTo(lastName));
}
}
}
+2
View File
@@ -89,6 +89,7 @@
<Compile Include="Utility\AlgorithmsTests.cs" />
<Compile Include="Utility\CustomExtensionsTests.cs" />
<Compile Include="ViewModels\CreateLogViewModelTests.cs" />
<Compile Include="ViewModels\CreateUserViewModelTests.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="DAL\Vehicles.xls">
@@ -102,6 +103,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -1,7 +1,7 @@
using System.Linq;
using System.Web.Mvc;
namespace MileageTraker.Web.Utility
namespace MileageTraker.Web.Attributes
{
public class ActionLogAttribute : ActionFilterAttribute
{
@@ -1,7 +1,7 @@
using System;
using System;
using System.ComponentModel.DataAnnotations;
namespace MileageTraker.Web.Utility
namespace MileageTraker.Web.Attributes
{
public class DenyFutureDateAttribute : ValidationAttribute
{
@@ -1,7 +1,7 @@
using System;
using System;
using System.ComponentModel.DataAnnotations;
namespace MileageTraker.Web.Utility
namespace MileageTraker.Web.Attributes
{
public class DenyPreviousMonthDateAttribute : ValidationAttribute
{
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace MileageTraker.Web.Attributes
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class FormatHintAttribute : Attribute
{
public string Text { get; private set; }
public FormatHintAttribute(string text)
{
Text = text;
}
}
}
@@ -2,8 +2,14 @@ using System;
using System.Reflection;
using System.Web.Mvc;
namespace MileageTraker.Web.Utility
namespace MileageTraker.Web.Attributes
{
/// <summary>
/// Add to actions to use multiple submit buttons (back or save, for example)
/// </summary>
/// <remarks>
/// http://blog.ashmind.com/2010/03/15/multiple-submit-buttons-with-asp-net-mvc-final-solution/
/// </remarks>
public class HttpParamActionAttribute : ActionNameSelectorAttribute
{
public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)
+21
View File
@@ -0,0 +1,21 @@
using System;
namespace MileageTraker.Web.Attributes
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class InputSizeAttribute : Attribute
{
public string Size { get; private set; }
public string ClassName { get { return "input-" + Size.ToLower(); } }
/// <summary>
/// Specify width of input element
/// </summary>
/// <param name="size">mini, small, medium, large, xlarge, xxlarge</param>
public InputSizeAttribute(string size)
{
Size = size;
}
}
}
+9
View File
@@ -0,0 +1,9 @@
using System;
namespace MileageTraker.Web.Attributes
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class NoEditLabelAttribute : Attribute
{
}
}
+15
View File
@@ -0,0 +1,15 @@
using System;
namespace MileageTraker.Web.Attributes
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class UnitsAttribute : Attribute
{
public string Text { get; private set; }
public UnitsAttribute(string text)
{
Text = text;
}
}
}
+15 -1
View File
@@ -10,6 +10,11 @@
width: 300px;
}
h2 {
font-size: 24px;
line-height: 30px;
}
.form-login {
max-width: 300px;
padding: 19px 29px 29px;
@@ -36,4 +41,13 @@
legend {
border-bottom: 0;
margin-bottom: 0;
}
}
@media (max-width: 480px) {
.header {
background: url(images/Header.login.mobile.png) no-repeat;
height: 32px;
width: 200px;
}
}
-119
View File
@@ -1,119 +0,0 @@
body {
padding-top: 60px;
}
.navbar.navbar-fixed-top {
min-width: 979px
}
.brand
{
background: url(images/Header.png) no-repeat left center;
height: 28px;
width: 266px;
}
.navbar .brand {
margin-left: 10px;
margin-right: -20px;
}
.nav li {
line-height: 29px;
}
.nav > li button.btn-link {
display: block;
}
.navbar .nav > li button.btn-link {
float: none;
padding: 12px 15px 0;
color: #777;
text-decoration: none;
}
.navbar-inverse .nav > li button.btn-link {
color: #999;
}
.navbar-inverse .nav > li button.btn-link:hover {
color: white;
}
.navbar .nav > li form {
margin: 0;
}
footer {
background-color: #101010;
color: #666;
text-align: center;
padding: 4px;
}
.qtip-content dt {
line-height: 10px;
width: 110px;
}
.qtip-content dd {
line-height: 10px;
margin-left: 120px;
}
fieldset legend {
margin: 0;
border: 0;
}
.validation-summary-errors ul {
list-style-type: none;
margin: 0;
}
.report-calculation
{
display: none;
}
#log-title {
background: url(images/glyphicons_026_road.png) no-repeat left center;
display: inline;
height: 24px;
width: 28px;
padding-left: 36px;
}
#vehicle-title {
background: url(images/glyphicons_005_car.png) no-repeat left center;
display: inline;
height: 24px;
width: 28px;
padding-left: 36px;
}
.icon-car {
background-image: url("images/glyphicons_005_car_half.png");
background-position: 0 0;
}
.dropdown-menu > li > a:hover > .icon-car {
background-image: url("images/glyphicons_005_car_half_white.png");
background-position: 0 0;
}
dl.inline, dl.inline dt, dl.inline dd {
float: left;
}
dl.inline {
margin-right: 30px;
}
@media print {
header,
footer,
.no-print
{ display:none }
}
+167 -29
View File
@@ -1,15 +1,13 @@
body {
}
#content {
padding: .5em 1em;
position: relative;
padding-top: 60px;
}
.brand
{
background: url(images/Header.png) no-repeat left center;
height: 28px;
width: 266px;
background: url(images/Header.png) no-repeat left center;
height: 28px;
width: 266px;
}
.navbar .brand {
@@ -21,16 +19,168 @@ body {
line-height: 29px;
}
@media (max-width: 767px) {
.input-mini {
width: 60px !important;
}
.input-small {
width: 90px !important;
.nav > li button.btn-link {
display: block;
}
.navbar .nav > li button.btn-link {
float: none;
padding: 12px 15px 0;
color: #777;
text-decoration: none;
}
.navbar-inverse .nav > li button.btn-link {
color: #999;
}
.navbar-inverse .nav > li button.btn-link:hover {
color: white;
}
.navbar .nav > li form {
margin: 0;
}
footer {
background-color: #101010;
color: #666;
text-align: center;
padding: 4px;
}
.qtip-content dt {
line-height: 10px;
width: 110px;
}
.qtip-content dd {
line-height: 10px;
margin-left: 120px;
}
fieldset legend {
margin: 0;
border: 0;
}
.validation-summary-errors ul {
list-style-type: none;
margin: 0;
}
.report-calculation
{
display: none;
}
#log-title {
background: url(images/glyphicons_026_road.png) no-repeat left center;
display: inline;
height: 24px;
width: 28px;
padding-left: 36px;
}
#vehicle-title {
background: url(images/glyphicons_005_car.png) no-repeat left center;
display: inline;
height: 24px;
width: 28px;
padding-left: 36px;
}
.icon-car {
background-image: url("images/glyphicons_005_car_half.png");
background-position: 0 0;
}
#users-online {
display: inline-block;
margin-top: 10px;
margin-left: 20px;
line-height: 30px;
}
.dropdown-menu > li > a:hover > .icon-car {
background-image: url("images/glyphicons_005_car_half_white.png");
background-position: 0 0;
}
dl.inline, dl.inline dt, dl.inline dd {
float: left;
}
dl.inline {
margin-right: 30px;
}
@media print {
header,
footer,
.no-print
{ display:none }
}
/* Responsive
------------------*/
@media (min-width: 768px) and (max-width: 979px) {
body {
padding-top: 0;
}
}
@media (max-width: 480px) {
@media (max-width: 767px) {
body {
padding: 0;
}
.container-fluid {
padding: 0 10px;
}
.input-mini {
width: 60px !important;
}
.input-small {
width: 90px !important;
}
.dl-horizontal dt {
float: left;
width: 110px;
text-align: right;
}
.dl-horizontal dd {
margin-left: 120px;
}
}
@media (max-width: 480px) {
body {
padding: 0;
}
.container-fluid {
padding: 0 10px;
}
.brand {
background: url(images/Header.mobile.png) no-repeat left center;
height: 28px;
width: 205px;
}
.navbar .brand {
margin-left: 5px;
padding: 10px 0;
}
fieldset legend {
margin-bottom: 0;
@@ -50,23 +200,11 @@ body {
margin-bottom: 10px;
}
.form-horizontal .control-group.endOdometer {
margin-bottom: 0;
}
.form-horizontal .control-group.endOdometer {
margin-bottom: 0;
}
.employeeName input {
width: 120px;
}
}
@media (max-width: 767px) {
.dl-horizontal dt {
float: left;
width: 110px;
text-align: right;
}
.dl-horizontal dd {
margin-left: 120px;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

+2 -3
View File
@@ -2,13 +2,12 @@
using System.Web.Mvc;
using System.Web.Security;
using MileageTraker.Web.Membership;
using MileageTraker.Web.ViewModels;
using MileageTraker.Web.ViewModels.Account;
namespace MileageTraker.Web.Controllers
{
[Authorize]
public class AccountController : Controller
public class AccountController : ControllerBase
{
[AllowAnonymous]
public ActionResult Login(string returnUrl)
@@ -40,7 +39,7 @@ namespace MileageTraker.Web.Controllers
WebSecurity.Logout();
// TODO: send notification to user
return RedirectToAction("Login");
return RedirectToAction("Index", "CreateLog");
}
[AllowAnonymous]
+1 -4
View File
@@ -1,15 +1,12 @@
using System.Web.Mvc;
using MileageTraker.Web.DAL;
namespace MileageTraker.Web.Controllers
{
public class CityController : ControllerBase
{
private readonly DataService _dataService = new DataService();
public JsonResult Autocomplete(string term)
{
var cities = _dataService.GetCitiesAutocomplete(term);
var cities = DataService.GetCitiesAutocomplete(term);
return Json(cities, JsonRequestBehavior.AllowGet);
}
}
+9
View File
@@ -1,9 +1,18 @@
using System.Web.Mvc;
using MileageTraker.Web.DAL;
namespace MileageTraker.Web.Controllers
{
public class ControllerBase : Controller
{
protected readonly DataService DataService = new DataService();
protected override void Dispose(bool disposing)
{
DataService.Dispose();
base.Dispose(disposing);
}
protected override void OnException(ExceptionContext filterContext)
{
if (filterContext != null && filterContext.Exception != null)
+3 -5
View File
@@ -1,9 +1,8 @@
using System;
using System.Web.Mvc;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.Models;
using MileageTraker.Web.Utility;
using MileageTraker.Web.ViewModels;
using MileageTraker.Web.ViewModels.CreateLog;
namespace MileageTraker.Web.Controllers
@@ -13,7 +12,6 @@ namespace MileageTraker.Web.Controllers
private const string CookieKeyEmployeename = "mr_employeeName";
private const string CookeNameVehicleid = "mr_vehicleId";
private const string CookieKeyLogtype = "mr_logType";
private readonly DataService _dataService = new DataService();
public ViewResult Index()
{
@@ -61,7 +59,7 @@ namespace MileageTraker.Web.Controllers
log.Source = HttpContext.Request.Url.AbsolutePath;
log.UserHostAddress = HttpContext.Request.UserHostAddress;
log.UserAgent = HttpContext.Request.UserAgent;
_dataService.AddLog(log);
DataService.AddLog(log);
return View("Success", model);
}
@@ -70,7 +68,7 @@ namespace MileageTraker.Web.Controllers
public PartialViewResult RecentLogs(string employeeName)
{
var logs = _dataService.GetRecentLogsByEmployee(employeeName);
var logs = DataService.GetRecentLogsByEmployee(employeeName);
ViewData["employeeName"] = employeeName;
return PartialView(logs);
}
+2 -5
View File
@@ -1,15 +1,12 @@
using System.Web.Mvc;
using MileageTraker.Web.DAL;
namespace MileageTraker.Web.Controllers
{
public class EmployeeController : Controller
public class EmployeeController : ControllerBase
{
private readonly DataService _dataService = new DataService();
public JsonResult Autocomplete(string term)
{
var employees = _dataService.GetEmployeeNamesAutocomplete(term);
var employees = DataService.GetEmployeeNamesAutocomplete(term);
return Json(employees, JsonRequestBehavior.AllowGet);
}
}
+19 -26
View File
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Web.Mvc;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Models;
using MileageTraker.Web.Utility;
@@ -13,24 +14,22 @@ namespace MileageTraker.Web.Controllers
[Authorize(Roles = "Administrator, Developer")]
public class LogController : ControllerBase
{
private readonly DataService _dataService = new DataService();
public ViewResult Index(LogQueryViewModel query)
{
var logs = _dataService.GetLogs();
var logs = DataService.GetLogs();
var validLogYears = _dataService.GetValidLogYears().ToList();
var validLogYears = DataService.GetValidLogYears().ToList();
if (!validLogYears.Any())
return View("Empty");
if (!query.Year.HasValue)
query.Year = validLogYears.FirstOrDefault();
var validLogMonths = _dataService.GetValidLogMonths(query.Year.Value).ToList();
var validLogMonths = DataService.GetValidLogMonths(query.Year.Value).ToList();
if (!query.Month.HasValue)
query.Month = validLogMonths.FirstOrDefault();
var filteredLogs =
from log in _dataService.GetLogIndexViewModels(DataService.FilterLogs(logs, query))
from log in DataService.GetLogIndexViewModels(DataService.FilterLogs(logs, query))
orderby log.Created descending
select log;
@@ -53,7 +52,7 @@ namespace MileageTraker.Web.Controllers
[ActionLog]
public ActionResult Export(LogQueryViewModel query)
{
var logs = _dataService.GetLogs();
var logs = DataService.GetLogs();
var name = string.Format(
"MileageLogs{0}-{1}{2}",
query.Year,
@@ -66,7 +65,7 @@ namespace MileageTraker.Web.Controllers
public ViewResult MonthlyVehicleMileage(LogQueryViewModel query)
{
var items = _dataService.GetMonthlyVehicleMileageItems(query);
var items = DataService.GetMonthlyVehicleMileageItems(query);
var report = new VehicleMileageViewModel (items, query);
@@ -75,7 +74,7 @@ namespace MileageTraker.Web.Controllers
public ActionResult MonthlyEmployeeMileage(LogQueryViewModel query)
{
var items = _dataService.GetMonthlyEmployeeMileageItems(query);
var items = DataService.GetMonthlyEmployeeMileageItems(query);
var report = new EmployeeMileageViewModel(items, query);
@@ -84,13 +83,13 @@ namespace MileageTraker.Web.Controllers
public ViewResult Details(int id)
{
var log = _dataService.GetLog(id);
var log = DataService.GetLog(id);
return View(log);
}
public ActionResult PreviousDetails(int id)
{
var log = _dataService.GetLog(id);
var log = DataService.GetLog(id);
int logId;
if (log.VehiclePreviousLog != null)
{
@@ -106,7 +105,7 @@ namespace MileageTraker.Web.Controllers
public ActionResult NextDetails(int id)
{
var nextLog = _dataService.GetNextLog(id);
var nextLog = DataService.GetNextLog(id);
int logId;
if (nextLog != null)
{
@@ -142,7 +141,7 @@ namespace MileageTraker.Web.Controllers
log.UserHostAddress = HttpContext.Request.UserHostAddress;
log.UserAgent = HttpContext.Request.UserAgent;
_dataService.AddLog(log);
DataService.AddLog(log);
return RedirectToAction("Index");
}
@@ -151,7 +150,7 @@ namespace MileageTraker.Web.Controllers
public ActionResult Edit(int id)
{
var log = _dataService.GetLog(id);
var log = DataService.GetLog(id);
return View(log);
}
@@ -162,7 +161,7 @@ namespace MileageTraker.Web.Controllers
RemoveModelStateErrors();
if (ModelState.IsValid)
{
_dataService.UpdateLog(log);
DataService.UpdateLog(log);
return RedirectToAction("Details", new{id = log.LogId});
}
return View(log);
@@ -179,7 +178,7 @@ namespace MileageTraker.Web.Controllers
public ActionResult Delete(int id)
{
var log = _dataService.GetLog(id);
var log = DataService.GetLog(id);
return View(log);
}
@@ -187,7 +186,7 @@ namespace MileageTraker.Web.Controllers
[ActionLog]
public ActionResult DeleteConfirmed(int id)
{
_dataService.DeleteLog(id);
DataService.DeleteLog(id);
if (Session["LogPage"] != null)
return Redirect((string) Session["LogPage"]);
@@ -196,20 +195,14 @@ namespace MileageTraker.Web.Controllers
public JsonResult GetValidLogMonths(int year)
{
var validLogMonths = _dataService.GetValidLogMonths(year);
var validLogMonths = DataService.GetValidLogMonths(year);
return Json(validLogMonths, JsonRequestBehavior.AllowGet);
}
public PartialViewResult DetailsPartial(int id)
{
var log = _dataService.GetLog(id);
var log = DataService.GetLog(id);
return PartialView(new LogPartialDetails(log));
}
protected override void Dispose(bool disposing)
{
_dataService.Dispose();
base.Dispose(disposing);
}
}
}
}
+71
View File
@@ -0,0 +1,71 @@
using System;
using System.Data;
using System.Linq;
using System.Web.Mvc;
using MileageTraker.Web.Models;
using MileageTraker.Web.Context;
using MileageTraker.Web.ViewModels.User;
namespace MileageTraker.Web.Controllers
{
[Authorize(Roles = "Administrator, Developer")]
public class UserController : ControllerBase
{
public ActionResult Index()
{
return View(DataService.GetUsers().ToList());
}
public ActionResult Details(Guid id)
{
var user = DataService.GetUser(id);
if (user == null)
{
return HttpNotFound();
}
return View(user);
}
public ActionResult Create()
{
return View();
}
[HttpPost]
public ActionResult Create(CreateUserViewModel createUserViewModel)
{
if (ModelState.IsValid)
{
var user = createUserViewModel.CloneToUser();
user.UserId = Guid.NewGuid();
//db.Users.Add(user);
//db.SaveChanges();
return RedirectToAction("Index");
}
return View(createUserViewModel);
}
public ActionResult Edit(Guid id)
{
var user = DataService.GetUser(id);
if (user == null)
{
return HttpNotFound();
}
return View(user);
}
[HttpPost]
public ActionResult Edit(User user)
{
if (ModelState.IsValid)
{
//db.Entry(user).State = EntityState.Modified;
//db.SaveChanges();
return RedirectToAction("Index");
}
return View(user);
}
}
}
+8 -17
View File
@@ -2,7 +2,6 @@
using System.Web.Mvc;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Models;
using MileageTraker.Web.ViewModels;
using MileageTraker.Web.ViewModels.Vehicle;
namespace MileageTraker.Web.Controllers
@@ -10,23 +9,21 @@ namespace MileageTraker.Web.Controllers
[Authorize(Roles = "Administrator, Developer")]
public class VehicleController : ControllerBase
{
private readonly DataService _ds = new DataService();
public ViewResult Index()
{
var vehicles = _ds.GetVehicles();
var vehicles = DataService.GetVehicles();
return View(vehicles);
}
public ViewResult Details(string id)
{
var vehicle = _ds.GetVehicle(id);
var vehicle = DataService.GetVehicle(id);
return View(vehicle);
}
public PartialViewResult DetailsPartial(string id)
{
var vehicle = _ds.GetVehicle(id);
var vehicle = DataService.GetVehicle(id);
return PartialView(new VehiclePartialDetails(vehicle));
}
@@ -40,7 +37,7 @@ namespace MileageTraker.Web.Controllers
{
if (ModelState.IsValid)
{
_ds.AddVehicle(vehicle);
DataService.AddVehicle(vehicle);
return RedirectToAction("Index");
}
@@ -49,7 +46,7 @@ namespace MileageTraker.Web.Controllers
public ActionResult Edit(string id)
{
var vehicle = _ds.GetVehicle(id);
var vehicle = DataService.GetVehicle(id);
return View(vehicle);
}
@@ -58,7 +55,7 @@ namespace MileageTraker.Web.Controllers
{
if (ModelState.IsValid)
{
_ds.UpdateVehicle(vehicle);
DataService.UpdateVehicle(vehicle);
return RedirectToAction("Details", new { id = vehicle.VehicleId });
}
return View(vehicle);
@@ -66,21 +63,15 @@ namespace MileageTraker.Web.Controllers
public JsonResult Exists(string vehicleId)
{
var vehicle = _ds.GetVehicle(vehicleId);
var vehicle = DataService.GetVehicle(vehicleId);
return Json(vehicle != null, JsonRequestBehavior.AllowGet);
}
public FileResult Export()
{
var vehicles = _ds.GetVehicles();
var vehicles = DataService.GetVehicles();
var export = VehicleImporter.Export(vehicles);
return File(export, "application/ms-excel", string.Format("ETHRAVehicles{0:yyyy-MM-dd}.xls", DateTime.Today));
}
protected override void Dispose(bool disposing)
{
_ds.Dispose();
base.Dispose(disposing);
}
}
}
+14 -2
View File
@@ -17,6 +17,11 @@ namespace MileageTraker.Web.DAL
{
private readonly MileageTrakerContext _db = new MileageTrakerContext();
public void Dispose()
{
_db.Dispose();
}
#region Log
public void AddLog(Log log)
@@ -435,9 +440,16 @@ namespace MileageTraker.Web.DAL
#endregion
public void Dispose()
public IQueryable<User> GetUsers()
{
_db.Dispose();
return _db.Users;
}
public User GetUser(Guid guid)
{
return _db.Users.Find(guid);
}
}
}
+3 -1
View File
@@ -2,15 +2,17 @@
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using AutoMapper;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Utility;
namespace MileageTraker.Web
{
public class MvcApplication : System.Web.HttpApplication
public class MvcApplication : HttpApplication
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
@@ -6,6 +6,7 @@ using System.Web;
using System.Web.Security;
using MileageTraker.Web.Context;
using MileageTraker.Web.Models;
using MileageTraker.Web.Utility;
namespace MileageTraker.Web.Membership
{
@@ -311,11 +312,7 @@ namespace MileageTraker.Web.Membership
public override int GetNumberOfUsersOnline()
{
var dateActive =
DateTime.UtcNow.Subtract(
TimeSpan.FromMinutes(
Convert.ToDouble(
System.Web.Security.Membership.UserIsOnlineTimeWindow)));
var dateActive = CustomExtensions.UserOnlineThreshold();
using (var context = new MileageTrakerContext())
{
return context.Users.Count(usr => usr.LastActivityDate > dateActive);
@@ -360,7 +357,7 @@ namespace MileageTraker.Web.Membership
var membershipUsers = new MembershipUserCollection();
using (var context = new MileageTrakerContext())
{
totalRecords = context.Users.Count(Usr => Usr.Email == emailToMatch);
totalRecords = context.Users.Count(user => user.Email == emailToMatch);
var users =
context.Users.Where(usr => usr.Email == emailToMatch)
.OrderBy(usrn => usrn.Username)
+4 -5
View File
@@ -101,10 +101,10 @@ namespace MileageTraker.Web.Membership
return System.Web.Security.Membership.DeleteUser(username);
}
public static int GetUserId(string userName)
public static Guid GetUserId(string userName)
{
var user = System.Web.Security.Membership.GetUser(userName);
return (int) user.ProviderUserKey;
return (Guid) user.ProviderUserKey;
}
public static string CreateAccount(string userName, string password)
@@ -114,7 +114,7 @@ namespace MileageTraker.Web.Membership
public static string CreateAccount(string userName, string password, bool requireConfirmationToken = false)
{
var codeFirstMembership = System.Web.Security.Membership.Provider as CodeFirstMembershipProvider;
var codeFirstMembership = (CodeFirstMembershipProvider)System.Web.Security.Membership.Provider;
return codeFirstMembership.CreateAccount(userName, password, requireConfirmationToken);
}
@@ -136,7 +136,7 @@ namespace MileageTraker.Web.Membership
private static string CreateUserAndAccount(string userName, string password, object propertyValues = null,
bool requireConfirmationToken = false)
{
var codeFirstMembership = System.Web.Security.Membership.Provider as CodeFirstMembershipProvider;
var codeFirstMembership = (CodeFirstMembershipProvider)System.Web.Security.Membership.Provider;
//IDictionary<string, object> values = null;
//if (propertyValues != null)
@@ -171,6 +171,5 @@ namespace MileageTraker.Web.Membership
return
System.Web.Security.Membership.GetAllUsers(pageIndex, pageSize, out totalRecords).Cast<MembershipUser>().ToList();
}
}
}
+1
View File
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Utility;
+25 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Web.Security;
namespace MileageTraker.Web.Models
@@ -8,11 +9,16 @@ namespace MileageTraker.Web.Models
public class User
{
[Key]
[HiddenInput(DisplayValue = false)]
public virtual Guid UserId { get; set; }
[Required]
[Display(Name = "Email")]
[DataType(DataType.EmailAddress)]
public virtual String Username { get; set; }
[HiddenInput(DisplayValue = false)]
[DataType(DataType.EmailAddress)]
public virtual String Email { get; set; }
[Required, DataType(DataType.Password)]
@@ -24,21 +30,39 @@ namespace MileageTraker.Web.Models
[DataType(DataType.MultilineText)]
public virtual String Comment { get; set; }
[HiddenInput(DisplayValue = false)]
public virtual Boolean IsApproved { get; set; }
[HiddenInput]
public virtual int PasswordFailuresSinceLastSuccess { get; set; }
public virtual DateTime? LastPasswordFailureDate { get; set; }
public virtual DateTime? LastActivityDate { get; set; }
public virtual DateTime? LastLockoutDate { get; set; }
public virtual DateTime? LastLoginDate { get; set; }
[HiddenInput(DisplayValue = false)]
public virtual String ConfirmationToken { get; set; }
[HiddenInput]
public virtual DateTime? CreateDate { get; set; }
[HiddenInput]
public virtual Boolean IsLockedOut { get; set; }
[HiddenInput]
public virtual DateTime? LastPasswordChangedDate { get; set; }
// TODO: change to Password Reset Token
[HiddenInput(DisplayValue = false)]
public virtual String PasswordVerificationToken { get; set; }
[HiddenInput(DisplayValue = false)]
public virtual DateTime? PasswordVerificationTokenExpirationDate { get; set; }
[HiddenInput]
public virtual ICollection<Role> Roles { get; set; }
public MembershipUser CloneToMembershipUser(string providerName)
{
return new MembershipUser(providerName, Username, UserId,
+1
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.Utility;
namespace MileageTraker.Web.Models
+1 -1
View File
@@ -15,7 +15,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<ObjectGroup Name="MileageTrakerContext" Order="1" Enabled="True">
<Destination Path="Data Source=mileage;Initial Catalog=MileageTraker;User ID=MileageTrakerUser;Password=qwerty;Connect Timeout=60" Name="Data Source=mileage;Initial Catalog=MileageTraker;User Id=MileageTrakerUser;Password=qwerty;Connect Timeout=60" />
<Object Type="DbCodeFirst">
<Source Path="DBMigration" DbContext="MileageTraker.Web.Models.MileageTrakerContext, MileageTraker" MigrationConfiguration="MileageTraker.Web.Migrations.Configuration, MileageTraker" Origin="Configuration" />
<Source Path="DBMigration" DbContext="MileageTraker.Web.Context.MileageTrakerContext, MileageTraker" MigrationConfiguration="MileageTraker.Web.Migrations.Configuration, MileageTraker" Origin="Configuration" />
</Object>
</ObjectGroup>
</Objects>
+1 -1
View File
@@ -48,7 +48,7 @@ $(function () {
});
});
$(".miles-unknown").addClass('ui-state-error').append('&nbsp;<span class="muted">&#9652;</span>')
$(".miles-unknown").addClass('label label-warning').append('&nbsp;<span class="muted">&#9652;</span>')
.each(function () {
$(this).qtip({
content: "No previous log for this vehicle",
+30 -19
View File
@@ -2,10 +2,10 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Web.Mvc;
using MileageTraker.Web.Models;
namespace MileageTraker.Web.Utility
{
@@ -13,7 +13,10 @@ namespace MileageTraker.Web.Utility
{
public static string Wordify(this string str)
{
return str.Aggregate(string.Empty, (current, c) => current + (char.IsUpper(c) ? " " + c : c.ToString()));
return str.Aggregate(
String.Empty,
(current, c) =>
current + (Char.IsUpper(c) ? " " + c : c.ToString()));
}
private static T GetAttribute<T>(this Enum enumeration) where T : Attribute
@@ -48,13 +51,14 @@ namespace MileageTraker.Web.Utility
public static IEnumerable<SelectListItem> GetSelectListItems(this Enum enumeration)
{
var type = enumeration.GetType();
return Enum.GetValues(type).OfType<Enum>().Select(e =>
new SelectListItem
{
Text = e.GetDisplayName(),
Value = e.ToString(),
Selected = e.Equals(enumeration)
});
return Enum.GetValues(type)
.OfType<Enum>().Select(e =>
new SelectListItem
{
Text = e.GetDisplayName(),
Value = e.ToString(),
Selected = e.Equals(enumeration)
});
}
public static IEnumerable<SelectListItem> ToSelectList(this Type enumType, string selectedItem, string noItemSelected)
@@ -148,12 +152,12 @@ namespace MileageTraker.Web.Utility
public static string LowercaseFirst(string s)
{
// Check for empty string.
if (string.IsNullOrEmpty(s))
if (String.IsNullOrEmpty(s))
{
return string.Empty;
return String.Empty;
}
// Return char and concat substring.
return char.ToLower(s[0]) + s.Substring(1);
return Char.ToLower(s[0]) + s.Substring(1);
}
public static IEnumerable<int> GetNumbers()
@@ -161,15 +165,22 @@ namespace MileageTraker.Web.Utility
var i = 0;
while (true) yield return i++;
}
public static MvcHtmlString Concat(this MvcHtmlString f, MvcHtmlString s)
{
return MvcHtmlString.Create(f.ToString() + s);
}
public static MvcHtmlString Concat(this MvcHtmlString f, string s)
/// <summary>
/// Users with activity date greater than this value are online
/// </summary>
public static DateTime UserOnlineThreshold()
{
return MvcHtmlString.Create(f + s);
return DateTime.UtcNow.Subtract(
TimeSpan.FromMinutes(
Convert.ToDouble(
System.Web.Security.Membership.UserIsOnlineTimeWindow)));
}
public static bool IsOnline(this User user)
{
return user.LastActivityDate != null
&& user.LastActivityDate > UserOnlineThreshold();
}
}
}
-47
View File
@@ -1,47 +0,0 @@
using System;
namespace MileageTraker.Web.Utility
{
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class FormatHintAttribute : Attribute
{
public string Text { get; private set; }
public FormatHintAttribute(string text)
{
Text = text;
}
}
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class UnitsAttribute : Attribute
{
public string Text { get; private set; }
public UnitsAttribute(string text)
{
Text = text;
}
}
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class InputSizeAttribute : Attribute
{
public string Size { get; private set; }
public string ClassName { get { return "input-" + Size.ToLower(); } }
/// <summary>
/// Specify width of input element
/// </summary>
/// <param name="size">mini, small, medium, large, xlarge, xxlarge</param>
public InputSizeAttribute(string size)
{
Size = size;
}
}
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class NoEditLabelAttribute : Attribute
{
}
}
+1
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.Utility;
namespace MileageTraker.Web.ViewModels.Account
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using AutoMapper;
using MileageTraker.Web.Attributes;
using MileageTraker.Web.DAL;
using MileageTraker.Web.Models;
using MileageTraker.Web.Utility;
@@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using AutoMapper;
namespace MileageTraker.Web.ViewModels.User
{
public class CreateUserViewModel
{
[Required]
[DataType(DataType.EmailAddress)]
[RegularExpression(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}", ErrorMessage = "Must be an email address")]
public string Email { get; set; }
[Required]
[StringLength(50, MinimumLength = 2)]
public string FirstName { get; set; }
[Required]
[StringLength(50, MinimumLength = 2)]
public string LastName { get; set; }
public MultiSelectList Roles { get; set; }
static CreateUserViewModel()
{
Mapper.CreateMap<CreateUserViewModel, Models.User>();
}
public Models.User CloneToUser()
{
var user = new Models.User();
Mapper.Map(this, user);
return user;
}
}
}
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
namespace MileageTraker.Web.ViewModels.User
{
public class UserDetailsViewModel
{
public string Username { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string[] Roles { get; set; }
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}")]
public DateTime LastActivityDate { get; set; }
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}")]
public DateTime CreateDate { get; set; }
public bool IsLockedOut { get; set; }
[DisplayFormat(DataFormatString = @"{0:MM/dd/yyyy}")]
public DateTime LastLockoutDate { get; set; }
}
}
-5
View File
@@ -4,11 +4,6 @@
ViewBag.Title = "Log in";
Layout = "~/Views/Shared/_Layout.login.cshtml";
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}
@section Styles
{
<link href="@Url.Content("~/Content/Account.Login.css")" rel="stylesheet" type="text/css" />
-5
View File
@@ -2,11 +2,6 @@
@{
ViewBag.Title = "Manage Account";
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}
<h2>@ViewBag.Title</h2>
-1
View File
@@ -2,7 +2,6 @@
@{
ViewBag.Title = "Confirm";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Styles
{
-11
View File
@@ -2,17 +2,6 @@
@{
ViewBag.Title = "Enter Mileage Log";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Styles
{
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@using (Html.BeginForm("Index", "CreateLog", FormMethod.Post, new { @class = "form-horizontal" }))
-1
View File
@@ -2,7 +2,6 @@
@{
ViewBag.Title = "Success";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
-10
View File
@@ -3,16 +3,6 @@
@{
ViewBag.Title = "Create Log";
}
@section Styles
{
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToLogs"); }
-10
View File
@@ -3,16 +3,6 @@
@{
ViewBag.Title = "Edit Log";
}
@section Styles
{
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToLogs"); }
+6 -13
View File
@@ -1,5 +1,4 @@
@using MileageTraker.Web.Utility
@using MileageTraker.Web.ViewModels
@model MileageTraker.Web.ViewModels.Log.LogResultsViewModel
@{
@@ -7,13 +6,8 @@
var grid = new WebGrid(Model.Logs, rowsPerPage: 45);
}
@section Styles {
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
<h2 id="log-title">@ViewBag.Title</h2>
@@ -61,13 +55,12 @@
grid.Column("Date", format: item => item.Date.ToString("d")),
grid.Column("CityName", "City Name"),
grid.Column("EmployeeName", "Employee Name"),
grid.Column(format: item =>
(new MvcHtmlString("<div class='btn-group'>"))
.Concat(Html.ActionLink("Edit", "Edit", new { id = item.LogId }, new { @class = "btn btn-mini" }))
.Concat(Html.ActionLink("Details", "Details", new { id = item.LogId }, new { @class = "btn btn-mini" }))
.Concat(Html.ActionLink("Delete", "Delete", new { id = item.LogId }, new { @class = "btn btn-mini" }))
.Concat("</div>")
)
grid.Column(format:
@<div class='btn-group'>
@Html.ActionLink("Edit", "Edit", new { id = item.LogId }, new { @class = "btn btn-mini" })
@Html.ActionLink("Details", "Details", new { id = item.LogId }, new { @class = "btn btn-mini" })
@Html.ActionLink("Delete", "Delete", new { id = item.LogId }, new { @class = "btn btn-mini" })
</div>)
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed"},
numericLinksCount: 20
+1 -1
View File
@@ -30,7 +30,7 @@
else
{
<td colspan="2">
<span class="ui-state-error">?</span>
<span class="label label-warning">?</span>
</td>
}
</tr>
@@ -2,13 +2,6 @@
@{
ViewBag.Title = "Employee Mileage Report";
}
@section Styles {
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToLogs"); }
@@ -2,13 +2,6 @@
@{
ViewBag.Title = "Vehicle Mileage Report";
}
@section Styles {
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToLogs"); }
@@ -0,0 +1,4 @@
@{
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
}
@Html.Encode(Model)
@@ -1,5 +1,10 @@
@model DateTime
@using System.Globalization
@model DateTime
@{
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
var val =
ViewData.ModelMetadata.DisplayFormatString != null
?string.Format(ViewData.ModelMetadata.DisplayFormatString, Model)
: Model.ToString(CultureInfo.InvariantCulture);
}
@Html.Encode(string.Format(ViewData.ModelMetadata.DisplayFormatString, Model))
@Html.Encode(val)
@@ -1,5 +1,10 @@
@model DateTime
@using System.Globalization
@model DateTime
@{
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
var val =
ViewData.ModelMetadata.DisplayFormatString != null
?string.Format(ViewData.ModelMetadata.DisplayFormatString, Model)
: Model.ToString(CultureInfo.InvariantCulture);
}
@Html.Encode(string.Format(ViewData.ModelMetadata.DisplayFormatString, Model))
@Html.Encode(val)
@@ -0,0 +1,4 @@
@{
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
}
<a href="mailto:@Model">@Html.Encode(Model)</a>
@@ -0,0 +1,12 @@
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
var inputSize = (string)ViewData.ModelMetadata.AdditionalValues["InputSize"];
}
@if (!string.IsNullOrEmpty(inputSize))
{
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, new { @class = inputSize})
}
else
{
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
}
@@ -0,0 +1,4 @@
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
@Html.TextArea("", ViewData.TemplateInfo.FormattedModelValue)
+13 -2
View File
@@ -2,7 +2,18 @@
@{
Layout = null;
}
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.ModelType.IsCollection()))
@foreach (var prop in ViewData.ModelMetadata.Properties)
{
@Html.Editor(prop.PropertyName)
if (prop.ShowForEdit)
{
if (!prop.ModelType.IsCollection())
{
@Html.Editor(prop.PropertyName)
}
else
{
}
}
}
-4
View File
@@ -2,10 +2,6 @@
@{
ViewBag.Title = "Error";
if (Model.ControllerName == "CreateLog")
{
Layout = "~/Views/Shared/_Layout.cshtml";
}
}
<h2>
-40
View File
@@ -1,40 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Mileage Traker - ETHRA - @ViewBag.Title</title>
<link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui-1.9.2.custom.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Site.admin.css")" rel="stylesheet" type="text/css" />
@RenderSection("Styles", false)
</head>
<body>
<header>
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<span class="brand" ></span>
<ul class="nav">
<li id="log-nav">@Html.ActionLink("Logs", "Index", "Log")</li>
<li id="vehicle-nav">@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
<li>@Html.ActionLink("Enter Mileage Log", "Index", "CreateLog")</li>
</ul>
<section id="account-management">
@Html.Partial("_Layout.authentication")
</section>
</div>
</div>
</header>
<div class="container-fluid">
@RenderBody()
</div>
<footer>
Mileage Traker &copy; 2012 James Kolpack
</footer>
<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
@RenderSection("Scripts", false)
</body>
</html>
@@ -1,15 +0,0 @@
@if (Request.IsAuthenticated) {
<ul class="nav pull-right">
<li>
@Html.ActionLink(User.Identity.Name, "Manage", "Account", null, new { @class = "username", title = "Manage" })
</li>
<li>
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "form-logout" })) {
@Html.AntiForgeryToken()
<button type="submit" class="btn-link logoff">
Log Off
</button>
}
</li>
</ul>
}
+32 -6
View File
@@ -6,28 +6,54 @@
<link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui-1.9.2.custom.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/bootstrap-responsive.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
@RenderSection("Styles", false)
</head>
<body>
<header>
<div class="navbar navbar-static-top navbar-inverse">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<span class="brand" ></span>
<div class="container-fluid">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="brand"></span>
<div class="nav-collapse collapse">
<ul class="nav">
@if (Roles.IsUserInRole(User.Identity.Name, "Administrator")
|| Roles.IsUserInRole(User.Identity.Name, "Developer"))
{
<li id="log-nav">@Html.ActionLink("Logs", "Index", "Log")</li>
<li id="vehicle-nav">@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
<li id="user-nav">@Html.ActionLink("Users", "Index", "User")</li>
}
<li>@Html.ActionLink("Enter Log", "Index", "CreateLog")</li>
</ul>
<section id="account-management">
@Html.Partial("_NavAccountInfo")
</section>
</div>
</div>
</div>
</div>
</header>
<div class="container-fluid">
@RenderBody()
</div>
<footer>
Mileage Traker &copy; 2012 James Kolpack
</footer>
<script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
@RenderSection("Scripts", false)
</body>
+2
View File
@@ -18,6 +18,8 @@
<script src="@Url.Content("~/Scripts/bootstrap.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.9.2.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
@RenderSection("Scripts", false)
</body>
+23
View File
@@ -0,0 +1,23 @@
<ul class="nav pull-right">
@if (Request.IsAuthenticated)
{
<li>
@Html.ActionLink(User.Identity.Name, "Manage", "Account", null, new {@class = "username", title = "Manage"})
</li>
<li>
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new {id = "form-logout"}))
{
@Html.AntiForgeryToken()
<button type="submit" class="btn-link">
Log Off
</button>
}
</li>
}
else
{
<li>
@Html.ActionLink("Login", "Login", "Account", null, new {title = "Login"})
</li>
}
</ul>
+5
View File
@@ -0,0 +1,5 @@
<ul class="no-print breadcrumb">
<li>
<a href="@Url.Action("Index", "User")">&larr; Back to Users</a>
</li>
</ul>
+22
View File
@@ -0,0 +1,22 @@
@model MileageTraker.Web.ViewModels.User.CreateUserViewModel
@{
ViewBag.Title = "Create User";
}
@{ Html.RenderPartial("BackToUsers"); }
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("Create", "User", FormMethod.Post, new { @class = "form-horizontal" })) {
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorForModel()
<div class="control-group">
<div class="controls">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</div>
</fieldset>
}
+31
View File
@@ -0,0 +1,31 @@
@model MileageTraker.Web.Models.User
@{
ViewBag.Title = "User Details";
}
@{ Html.RenderPartial("BackToUsers"); }
<h2>@ViewBag.Title</h2>
@Html.DisplayFor(m => m.Username)
@Html.DisplayFor(m => m.FirstName)
@Html.DisplayFor(m => m.LastName)
<dl class="dl-horizontal roles">
<dt>
@Html.DisplayNameFor(m => m.Roles)
</dt>
<dd>
@Html.Encode(string.Join(", ", Roles.Provider.GetRolesForUser(Model.Username)))
</dd>
</dl>
@Html.DisplayFor(m => m.IsLockedOut)
@if (Model.IsLockedOut) {
@Html.DisplayFor(m => m.LastLockoutDate)
}
<div class="btn-toolbar">
@Html.ActionLink("Edit", "Edit", new { id = Model.UserId }, new { @class = "btn" })
</div>
+26
View File
@@ -0,0 +1,26 @@
@model MileageTraker.Web.Models.User
@{
ViewBag.Title = "Edit User";
}
@{ Html.RenderPartial("BackToUsers"); }
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("Edit", "User", FormMethod.Post, new { @class = "form-horizontal" }))
{
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorForModel()
<div class="control-group">
<div class="controls">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</div>
</fieldset>
}
+40
View File
@@ -0,0 +1,40 @@
@using MileageTraker.Web.Utility
@model IEnumerable<MileageTraker.Web.Models.User>
@{
ViewBag.Title = "Users";
var grid = new WebGrid(Model, rowsPerPage: 45);
}
<h2 id="user-title">@ViewBag.Title</h2>
<div class="btn-toolbar pull-left">
@Html.ActionLink("Add new User", "Create", null, new{@class="btn"})
</div>
<div id="users-online">Users online now: <span class="badge badge-info">@Membership.GetNumberOfUsersOnline()</span></div>
@grid.GetHtml(columns:
grid.Columns(
grid.Column("Username", format:
@<text>@Html.Encode(item.Username)
@if (item.LastActivityDate > CustomExtensions.UserOnlineThreshold()) {
<span class='label label-info'>Online</span>
}
@if (item.IsLockedOut) {
<span class='label label-warning' title="@string.Format("Locked out on {0:d}", item.LastLockoutDate)">Locked Out</span>
}</text> ),
grid.Column("FirstName", "First Name"),
grid.Column("LastName", "Last Name"),
grid.Column("Roles", format: item =>
string.Join(", ", Roles.Provider.GetRolesForUser(item.Username) )),
grid.Column(format:
@<div class='btn-group'>
@Html.ActionLink("Edit", "Edit", new { id = item.UserId }, new { @class = "btn btn-mini" })
@Html.ActionLink("Details", "Details", new { id = item.UserId }, new { @class = "btn btn-mini" })
</div>)
),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed"},
numericLinksCount: 20
)
+1 -11
View File
@@ -3,16 +3,6 @@
@{
ViewBag.Title = "Create Vehicle";
}
@section Styles
{
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToVehicles"); }
@@ -22,7 +12,7 @@
{
@Html.Partial("_ValidationSummary")
<fieldset>
<label></label>
<legend></legend>
@Html.EditorForModel()
<div class="control-group">
+1 -11
View File
@@ -3,16 +3,6 @@
@{
ViewBag.Title = "Edit Vehicle";
}
@section Styles
{
<link href="@Url.Content("~/Content/jquery.qtip.min.css")" rel="stylesheet" type="text/css" />
}
@section Scripts
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToVehicles"); }
@@ -22,7 +12,7 @@
{
@Html.Partial("_ValidationSummary")
<fieldset>
<label></label>
<legend></legend>
@Html.EditorForModel()
<div class="control-group">
<div class="controls">
+6 -8
View File
@@ -1,5 +1,4 @@
@using MileageTraker.Web.Utility
@model IEnumerable<MileageTraker.Web.Models.Vehicle>
@model IEnumerable<MileageTraker.Web.Models.Vehicle>
@{
ViewBag.Title = "Vehicles";
@@ -12,7 +11,7 @@
<h2 id="vehicle-title">@ViewBag.Title</h2>
<div class="btn-toolbar">
@Html.ActionLink("Add another vehicle", "Create", null, new{@class="btn"})
@Html.ActionLink("Add Another Vehicle", "Create", null, new{@class="btn"})
@Html.ActionLink("Export", "Export", null, new { @class = "btn" })
</div>
<table class="table table-striped table-bordered table-hover table-condensed">
@@ -87,11 +86,10 @@
@Html.DisplayTextFor(m => item.CurrentOdometer)
</td>
<td>
@(new MvcHtmlString("<div class='btn-group'>")
.Concat(Html.ActionLink("Edit", "Edit", new { id = item.VehicleId }, new { @class = "btn btn-mini" }))
.Concat(Html.ActionLink("Details", "Details", new { id = item.VehicleId }, new { @class = "btn btn-mini" }))
//.Concat(Html.ActionLink("New log", "Create", new { id = item.VehicleId }, new { @class = "btn btn-mini" }))
.Concat("</div>"))
<div class='btn-group'>
@Html.ActionLink("Edit", "Edit", new { id = item.VehicleId }, new { @class = "btn btn-mini" })
@Html.ActionLink("Details", "Details", new { id = item.VehicleId }, new { @class = "btn btn-mini" })
</div>
</td>
</tr>
}
+1 -1
View File
@@ -1,3 +1,3 @@
@{
Layout = "~/Views/Shared/_Layout.admin.cshtml";
Layout = "~/Views/Shared/_Layout.cshtml";
}
+29 -17
View File
@@ -44,9 +44,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoMapper, Version=2.1.267.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<Reference Include="AutoMapper, Version=2.2.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\AutoMapper.2.1.267\lib\net40\AutoMapper.dll</HintPath>
<HintPath>..\packages\AutoMapper.2.2.0\lib\net40\AutoMapper.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -64,9 +64,6 @@
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="MoreLinq, Version=1.0.11522.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\morelinq.1.0\lib\net35\MoreLinq.dll</HintPath>
</Reference>
<Reference Include="System.configuration" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Web.ApplicationServices" />
@@ -107,11 +104,20 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Attributes\ActionLogAttribute.cs" />
<Compile Include="Attributes\DenyFutureDateAttribute.cs" />
<Compile Include="Attributes\DenyPreviousMonthDateAttribute.cs" />
<Compile Include="Attributes\FormatHintAttribute.cs" />
<Compile Include="Attributes\HttpParamActionAttribute.cs" />
<Compile Include="Attributes\InputSizeAttribute.cs" />
<Compile Include="Attributes\NoEditLabelAttribute.cs" />
<Compile Include="Attributes\UnitsAttribute.cs" />
<Compile Include="Context\MileageTrakerContext.cs" />
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\CityController.cs" />
<Compile Include="Controllers\ControllerBase.cs" />
<Compile Include="Controllers\EmployeeController.cs" />
<Compile Include="Controllers\UserController.cs" />
<Compile Include="Membership\CodeFirstMembershipProvider.cs" />
<Compile Include="Membership\CodeFirstRoleProvider.cs" />
<Compile Include="Membership\Crypto.cs" />
@@ -131,8 +137,6 @@
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Models\Role.cs" />
<Compile Include="Models\User.cs" />
<Compile Include="Utility\ActionLogAttribute.cs" />
<Compile Include="Utility\HttpParamActionAttribute.cs" />
<Compile Include="ViewModels\Account\ChangePasswordViewModel.cs" />
<Compile Include="ViewModels\Account\LoginViewModel.cs" />
<Compile Include="ViewModels\Account\RegisterModel.cs" />
@@ -140,10 +144,11 @@
<Compile Include="ViewModels\EmployeeMileageViewModel.cs" />
<Compile Include="ViewModels\Log\LogIndexViewModel.cs" />
<Compile Include="ViewModels\Log\LogPartialDetails.cs" />
<Compile Include="ViewModels\User\CreateUserViewModel.cs" />
<Compile Include="ViewModels\User\UserDetailsViewModel.cs" />
<Compile Include="ViewModels\Vehicle\VehicleMileageViewModel.cs" />
<Compile Include="ViewModels\Vehicle\VehiclePartialDetails.cs" />
<Compile Include="ViewModels\Vehicle\VehicleMileageItem.cs" />
<Compile Include="Utility\FormatHintAttribute.cs" />
<Compile Include="DAL\ChronologicalOrderException.cs" />
<Compile Include="DAL\DataService.cs" />
<Compile Include="Controllers\CreateLogController.cs" />
@@ -166,8 +171,6 @@
<Compile Include="Utility\TitleCaseFormatter.cs" />
<Compile Include="ViewModels\CreateLog\ConfirmCreateLogViewModel.cs" />
<Compile Include="ViewModels\CreateLog\CreateLogViewModel.cs" />
<Compile Include="Utility\DenyFutureDateAttribute.cs" />
<Compile Include="Utility\DenyPreviousMonthDateAttribute.cs" />
<Compile Include="ViewModels\Log\LogQueryViewModel.cs" />
<Compile Include="ViewModels\Log\LogResultsViewModel.cs" />
</ItemGroup>
@@ -178,6 +181,7 @@
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="Content\CreateLog.Index.css" />
<Content Include="Content\images\Header.login.mobile.png" />
<Content Include="Content\images\glyphicons-halflings-white.png" />
<Content Include="Content\images\glyphicons-halflings.png" />
<Content Include="Content\images\glyphicons_005_car.png" />
@@ -185,11 +189,11 @@
<Content Include="Content\images\glyphicons_005_car_half_white.png" />
<Content Include="Content\images\glyphicons_026_road.png" />
<Content Include="Content\images\Header.login.png" />
<Content Include="Content\images\Header.mobile.png" />
<Content Include="Content\images\Header.png" />
<Content Include="Content\jquery.qtip.min.css" />
<Content Include="Content\images\Rainbow.png" />
<Content Include="Content\images\spinner.gif" />
<Content Include="Content\Site.admin.css" />
<Content Include="Content\Site.css" />
<Content Include="Content\themes\custom-theme\images\ui-bg_flat_0_aaaaaa_40x100.png" />
<Content Include="Content\themes\custom-theme\images\ui-bg_flat_55_fbec88_40x100.png" />
@@ -241,7 +245,7 @@
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.admin.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Views\Web.config" />
<Content Include="Views\Log\BackToLogs.cshtml" />
<Content Include="Views\Vehicle\BackToVehicles.cshtml" />
@@ -255,11 +259,22 @@
<Content Include="Views\Shared\EditorTemplates\Password.cshtml" />
<Content Include="Views\Shared\EditorTemplates\Boolean.cshtml" />
<Content Include="Views\Shared\_Layout.login.cshtml" />
<Content Include="Views\Shared\_Layout.authentication.cshtml" />
<Content Include="Views\Shared\_NavAccountInfo.cshtml" />
<Content Include="Views\Shared\_ValidationSummary.cshtml" />
<Content Include="Views\User\Index.cshtml" />
<Content Include="Views\User\Details.cshtml" />
<Content Include="Views\User\Create.cshtml" />
<Content Include="Views\User\Edit.cshtml" />
<Content Include="Views\User\BackToUsers.cshtml" />
<Content Include="Views\Shared\EditorTemplates\MultilineText.cshtml" />
<Content Include="Views\Shared\EditorTemplates\EmailAddress.cshtml" />
<Content Include="Views\Shared\DisplayTemplates\EmailAddress.cshtml" />
<Content Include="Views\Shared\DisplayTemplates\Boolean.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
<Content Include="packages.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Views\Shared\EditorTemplates\DateTime.cshtml" />
@@ -272,9 +287,6 @@
<ItemGroup>
<Content Include="Views\Log\Index.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Shared\_Layout.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Vehicle\Index.cshtml" />
</ItemGroup>
+1 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="2.1.267" />
<package id="AutoMapper" version="2.2.0" targetFramework="net40" />
<package id="EntityFramework" version="4.3.1" />
<package id="ExcelLibrary" version="1.2011.7.30" />
<package id="jQuery" version="1.8.3" targetFramework="net40" />
@@ -11,6 +11,5 @@
<package id="Microsoft.AspNet.Razor" version="2.0.20715.0" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="morelinq" version="1.0" />
<package id="Twitter.Bootstrap" version="2.2.2" targetFramework="net40" />
</packages>
Binary file not shown.
Binary file not shown.
-15
View File
@@ -1,15 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>AutoMapper</name>
</assembly>
<members>
<member name="T:AutoMapper.MappingEngine.ConversionVisitor">
<summary>
This expression visitor will replace an input parameter by another one
see http://stackoverflow.com/questions/4601844/expression-tree-copy-or-convert
</summary>
</member>
</members>
</doc>
-671
View File
@@ -1,671 +0,0 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>AutoMapper</name>
</assembly>
<members>
<member name="T:AutoMapper.MappingEngine.ConversionVisitor">
<summary>
This expression visitor will replace an input parameter by another one
see http://stackoverflow.com/questions/4601844/expression-tree-copy-or-convert
</summary>
</member>
<member name="T:TvdP.Collections.ConcurrentDictionaryKey`2">
<summary>
Search key structure for <see cref="T:TvdP.Collections.ConcurrentDictionary`2"/>
</summary>
<typeparam name="TKey">Type of the key.</typeparam>
<typeparam name="TValue">Type of the value.</typeparam>
</member>
<member name="T:TvdP.Collections.ConcurrentDictionary`2">
<summary>
A Concurrent <see cref="T:System.Collections.Generic.IDictionary`2"/> implementation.
</summary>
<typeparam name="TKey">Type of the keys.</typeparam>
<typeparam name="TValue">Type of the values.</typeparam>
<remarks>
This class is threadsafe and highly concurrent. This means that multiple threads can do lookup and insert operations
on this dictionary simultaneously.
It is not guaranteed that collisions will not occur. The dictionary is partitioned in segments. A segment contains
a set of items based on a hash of those items. The more segments there are and the beter the hash, the fewer collisions will occur.
This means that a nearly empty ConcurrentDictionary is not as concurrent as one containing many items.
</remarks>
</member>
<member name="T:TvdP.Collections.ConcurrentHashtable`2">
<summary>
Base class for concurrent hashtable implementations
</summary>
<typeparam name="TStored">Type of the items stored in the hashtable.</typeparam>
<typeparam name="TSearch">Type of the key to search with.</typeparam>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.#ctor">
<summary>
Constructor (protected)
</summary>
<remarks>Use Initialize method after construction.</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.Initialize">
<summary>
Initialize the newly created ConcurrentHashtable. Invoke in final (sealed) constructor
or Create method.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.CreateSegmentRange(System.Int32,System.Int32)">
<summary>
Create a segment range
</summary>
<param name="segmentCount">Number of segments in range.</param>
<param name="initialSegmentSize">Number of slots allocated initialy in each segment.</param>
<returns>The created <see cref="T:TvdP.Collections.Segmentrange`2"/> instance.</returns>
</member>
<member name="F:TvdP.Collections.ConcurrentHashtable`2._NewRange">
<summary>
While adjusting the segmentation, _NewRange will hold a reference to the new range of segments.
when the adjustment is complete this reference will be copied to _CurrentRange.
</summary>
</member>
<member name="F:TvdP.Collections.ConcurrentHashtable`2._CurrentRange">
<summary>
Will hold the most current reange of segments. When busy adjusting the segmentation, this
field will hold a reference to the old range.
</summary>
</member>
<member name="F:TvdP.Collections.ConcurrentHashtable`2._SwitchPoint">
<summary>
While adjusting the segmentation this field will hold a boundary.
Clients accessing items with a key hash value below this boundary (unsigned compared)
will access _NewRange. The others will access _CurrentRange
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetItemHashCode(`0@)">
<summary>
Get a hashcode for given storeable item.
</summary>
<param name="item">Reference to the item to get a hash value for.</param>
<returns>The hash value as an <see cref="T:System.UInt32"/>.</returns>
<remarks>
The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough.
A storeable item and a matching search key should return the same hash code.
So the statement <code>ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true </code> should always be true;
</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetKeyHashCode(`1@)">
<summary>
Get a hashcode for given search key.
</summary>
<param name="key">Reference to the key to get a hash value for.</param>
<returns>The hash value as an <see cref="T:System.UInt32"/>.</returns>
<remarks>
The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough.
A storeable item and a matching search key should return the same hash code.
So the statement <code>ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true </code> should always be true;
</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.ItemEqualsKey(`0@,`1@)">
<summary>
Compares a storeable item to a search key. Should return true if they match.
</summary>
<param name="item">Reference to the storeable item to compare.</param>
<param name="key">Reference to the search key to compare.</param>
<returns>True if the storeable item and search key match; false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.ItemEqualsItem(`0@,`0@)">
<summary>
Compares two storeable items for equality.
</summary>
<param name="item1">Reference to the first storeable item to compare.</param>
<param name="item2">Reference to the second storeable item to compare.</param>
<returns>True if the two soreable items should be regarded as equal.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.IsEmpty(`0@)">
<summary>
Indicates if a specific item reference contains a valid item.
</summary>
<param name="item">The storeable item reference to check.</param>
<returns>True if the reference doesn't refer to a valid item; false otherwise.</returns>
<remarks>The statement <code>IsEmpty(default(TStoredI))</code> should always be true.</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetKeyType(`0@)">
<summary>
Returns the type of the key value or object.
</summary>
<param name="item">The stored item to get the type of the key for.</param>
<returns>The actual type of the key or null if it can not be determined.</returns>
<remarks>
Used for diagnostics purposes.
</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetSegment(System.UInt32)">
<summary>
Gets a segment out of either _NewRange or _CurrentRange based on the hash value.
</summary>
<param name="hash"></param>
<returns></returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetSegmentLockedForWriting(System.UInt32)">
<summary>
Gets a LOCKED segment out of either _NewRange or _CurrentRange based on the hash value.
Unlock needs to be called on this segment before it can be used by other clients.
</summary>
<param name="hash"></param>
<returns></returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetSegmentLockedForReading(System.UInt32)">
<summary>
Gets a LOCKED segment out of either _NewRange or _CurrentRange based on the hash value.
Unlock needs to be called on this segment before it can be used by other clients.
</summary>
<param name="hash"></param>
<returns></returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.FindItem(`1@,`0@)">
<summary>
Finds an item in the table collection that maches the given searchKey
</summary>
<param name="searchKey">The key to the item.</param>
<param name="item">Out reference to a field that will receive the found item.</param>
<returns>A boolean that will be true if an item has been found and false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.GetOldestItem(`0@,`0@)">
<summary>
Looks for an existing item in the table contents using an alternative copy. If it can be found it will be returned.
If not then the alternative copy will be added to the table contents and the alternative copy will be returned.
</summary>
<param name="searchKey">A copy to search an already existing instance with</param>
<param name="item">Out reference to receive the found item or the alternative copy</param>
<returns>A boolean that will be true if an existing copy was found and false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.ReplaceItem(`1@,`0@,`0@,System.Func{`0,System.Boolean})">
<summary>
Replaces and existing item
</summary>
<param name="newItem"></param>
<param name="oldItem"></param>
<param name="sanction"></param>
<returns>true is the existing item was successfully replaced.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.InsertItem(`0@,`0@)">
<summary>
Inserts an item in the table contents possibly replacing an existing item.
</summary>
<param name="searchKey">The item to insert in the table</param>
<param name="replacedItem">Out reference to a field that will receive any possibly replaced item.</param>
<returns>A boolean that will be true if an existing copy was found and replaced and false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.RemoveItem(`1@,`0@)">
<summary>
Removes an item from the table contents.
</summary>
<param name="searchKey">The key to find the item with.</param>
<param name="removedItem">Out reference to a field that will receive the found and removed item.</param>
<returns>A boolean that will be rue if an item was found and removed and false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.EnumerateAmorphLockedSegments(System.Boolean)">
<summary>
Enumerates all segments in _CurrentRange and locking them before yielding them and resleasing the lock afterwards
The order in which the segments are returned is undefined.
Lock SyncRoot before using this enumerable.
</summary>
<returns></returns>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.Clear">
<summary>
Removes all items from the collection.
Aquires a lock on SyncRoot before it does it's thing.
When this method returns and multiple threads have access to this table it
is not guaranteed that the table is actually empty.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.SegmentationAdjustmentNeeded">
<summary>
Determines if a segmentation adjustment is needed.
</summary>
<returns>True</returns>
</member>
<member name="F:TvdP.Collections.ConcurrentHashtable`2._AssessSegmentationPending">
<summary>
Bool as int (for interlocked functions) that is true if a Segmentation assesment is pending.
</summary>
</member>
<member name="F:TvdP.Collections.ConcurrentHashtable`2._AllocatedSpace">
<summary>
The total allocated number of item slots. Filled with nonempty items or not.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.EffectTotalAllocatedSpace(System.Int32)">
<summary>
When a segment resizes it uses this method to inform the hashtable of the change in allocated space.
</summary>
<param name="effect"></param>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.ScheduleMaintenance">
<summary>
Schedule a call to the AssessSegmentation() method.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.AssessSegmentation(System.Object)">
<summary>
Checks if segmentation needs to be adjusted and if so performs the adjustment.
</summary>
<param name="dummy"></param>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.AssessSegmentation">
<summary>
This method is called when a re-segmentation is expected to be needed. It checks if it actually is needed and, if so, performs the re-segementation.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentHashtable`2.SetSegmentation(System.Int32,System.Int32)">
<summary>
Adjusts the segmentation to the new segment count
</summary>
<param name="newSegmentCount">The new number of segments to use. This must be a power of 2.</param>
<param name="segmentSize">The number of item slots to reserve in each segment.</param>
</member>
<member name="P:TvdP.Collections.ConcurrentHashtable`2.SyncRoot">
<summary>
Returns an object that serves as a lock for range operations
</summary>
<remarks>
Clients use this primarily for enumerating over the Tables contents.
Locking doesn't guarantee that the contents don't change, but prevents operations that would
disrupt the enumeration process.
Operations that use this lock:
Count, Clear, DisposeGarbage and AssessSegmentation.
Keeping this lock will prevent the table from re-segmenting.
</remarks>
</member>
<member name="P:TvdP.Collections.ConcurrentHashtable`2.Items">
<summary>
Gets an IEnumerable to iterate over all items in all segments.
</summary>
<returns></returns>
<remarks>
A lock should be aquired and held on SyncRoot while this IEnumerable is being used.
The order in which the items are returned is undetermined.
</remarks>
</member>
<member name="P:TvdP.Collections.ConcurrentHashtable`2.Count">
<summary>
Returns a count of all items in teh collection. This may not be
aqurate when multiple threads are accessing this table.
Aquires a lock on SyncRoot before it does it's thing.
</summary>
</member>
<member name="P:TvdP.Collections.ConcurrentHashtable`2.MinSegments">
<summary>
Gives the minimum number of segments a hashtable can contain. This should be 1 or more and always a power of 2.
</summary>
</member>
<member name="P:TvdP.Collections.ConcurrentHashtable`2.MinSegmentAllocatedSpace">
<summary>
Gives the minimum number of allocated item slots per segment. This should be 1 or more, always a power of 2
and less than 1/2 of MeanSegmentAllocatedSpace.
</summary>
</member>
<member name="P:TvdP.Collections.ConcurrentHashtable`2.MeanSegmentAllocatedSpace">
<summary>
Gives the prefered number of allocated item slots per segment. This should be 4 or more and always a power of 2.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.#ctor">
<summary>
Constructs a <see cref="T:TvdP.Collections.ConcurrentDictionary`2"/> instance using the default <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> to compare keys.
</summary>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.#ctor(System.Collections.Generic.IEqualityComparer{`0})">
<summary>
Constructs a <see cref="T:TvdP.Collections.ConcurrentDictionary`2"/> instance using the specified <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> to compare keys.
</summary>
<param name="comparer">The <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> tp compare keys with.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="comparer"/> is null.</exception>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.GetItemHashCode(System.Nullable{System.Collections.Generic.KeyValuePair{`0,`1}}@)">
<summary>
Get a hashcode for given storeable item.
</summary>
<param name="item">Reference to the item to get a hash value for.</param>
<returns>The hash value as an <see cref="T:System.UInt32"/>.</returns>
<remarks>
The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough.
A storeable item and a matching search key should return the same hash code.
So the statement <code>ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true </code> should always be true;
</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.GetKeyHashCode(TvdP.Collections.ConcurrentDictionaryKey{`0,`1}@)">
<summary>
Get a hashcode for given search key.
</summary>
<param name="key">Reference to the key to get a hash value for.</param>
<returns>The hash value as an <see cref="T:System.UInt32"/>.</returns>
<remarks>
The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough.
A storeable item and a matching search key should return the same hash code.
So the statement <code>ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true </code> should always be true;
</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.ItemEqualsKey(System.Nullable{System.Collections.Generic.KeyValuePair{`0,`1}}@,TvdP.Collections.ConcurrentDictionaryKey{`0,`1}@)">
<summary>
Compares a storeable item to a search key. Should return true if they match.
</summary>
<param name="item">Reference to the storeable item to compare.</param>
<param name="key">Reference to the search key to compare.</param>
<returns>True if the storeable item and search key match; false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.ItemEqualsItem(System.Nullable{System.Collections.Generic.KeyValuePair{`0,`1}}@,System.Nullable{System.Collections.Generic.KeyValuePair{`0,`1}}@)">
<summary>
Compares two storeable items for equality.
</summary>
<param name="item1">Reference to the first storeable item to compare.</param>
<param name="item2">Reference to the second storeable item to compare.</param>
<returns>True if the two soreable items should be regarded as equal.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.IsEmpty(System.Nullable{System.Collections.Generic.KeyValuePair{`0,`1}}@)">
<summary>
Indicates if a specific item reference contains a valid item.
</summary>
<param name="item">The storeable item reference to check.</param>
<returns>True if the reference doesn't refer to a valid item; false otherwise.</returns>
<remarks>The statement <code>IsEmpty(default(TStoredI))</code> should always be true.</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#IDictionary{TKey@TValue}#Add(`0,`1)">
<summary>
Adds an element with the provided key and value to the dictionary.
</summary>
<param name="key">The object to use as the key of the element to add.</param>
<param name="value">The object to use as the value of the element to add.</param>
<exception cref="T:System.ArgumentException">An element with the same key already exists in the dictionary.</exception>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.ContainsKey(`0)">
<summary>
Determines whether the dictionary
contains an element with the specified key.
</summary>
<param name="key">The key to locate in the dictionary.</param>
<returns>true if the dictionary contains
an element with the key; otherwise, false.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#IDictionary{TKey@TValue}#Remove(`0)">
<summary>
Removes the element with the specified key from the dictionary.
</summary>
<param name="key">The key of the element to remove.</param>
<returns>true if the element is successfully removed; otherwise, false. This method
also returns false if key was not found in the original dictionary.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.TryGetValue(`0,`1@)">
<summary>
Gets the value associated with the specified key.
</summary>
<param name="key">The key whose value to get.</param>
<param name="value">
When this method returns, the value associated with the specified key, if
the key is found; otherwise, the default value for the type of the value
parameter. This parameter is passed uninitialized.
</param>
<returns>
true if the dictionary contains an element with the specified key; otherwise, false.
</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#ICollection{System#Collections#Generic#KeyValuePair{TKey@TValue}}#Add(System.Collections.Generic.KeyValuePair{`0,`1})">
<summary>
Adds an association to the dictionary.
</summary>
<param name="item">A <see cref="T:System.Collections.Generic.KeyValuePair`2"/> that represents the association to add.</param>
<exception cref="T:System.ArgumentException">An association with an equal key already exists in the dicitonary.</exception>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.Clear">
<summary>
Removes all items from the dictionary.
</summary>
<remarks>WHen working with multiple threads, that each can add items to this dictionary, it is not guaranteed that the dictionary will be empty when this method returns.</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#ICollection{System#Collections#Generic#KeyValuePair{TKey@TValue}}#Contains(System.Collections.Generic.KeyValuePair{`0,`1})">
<summary>
Determines whether the specified association exists in the dictionary.
</summary>
<param name="item">The key-value association to search fo in the dicionary.</param>
<returns>True if item is found in the dictionary; otherwise, false.</returns>
<remarks>
This method compares both key and value. It uses the default equality comparer to compare values.
</remarks>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#ICollection{System#Collections#Generic#KeyValuePair{TKey@TValue}}#CopyTo(System.Collections.Generic.KeyValuePair{`0,`1}[],System.Int32)">
<summary>
Copies all associations of the dictionary to an
<see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
</summary>
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the associations
copied from <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/>. The <see cref="T:System.Array"/> must
have zero-based indexing.</param>
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="array"/> is null.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="arrayIndex"/> is less than 0.</exception>
<exception cref="T:System.ArgumentException"><paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.</exception>
<exception cref="T:System.ArgumentException">The number of associations to be copied
is greater than the available space from <paramref name="arrayIndex"/> to the end of the destination
<paramref name="array"/>.</exception>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#ICollection{System#Collections#Generic#KeyValuePair{TKey@TValue}}#Remove(System.Collections.Generic.KeyValuePair{`0,`1})">
<summary>
Removes the specified association from the <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/>, comparing both key and value.
</summary>
<param name="item">A <see cref="T:System.Collections.Generic.KeyValuePair`2"/> representing the association to remove.</param>
<returns>true if the association was successfully removed from the <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/>;
otherwise, false. This method also returns false if the association is not found in
the original <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/>.
</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.GetEnumerator">
<summary>
Returns an enumerator that iterates through all associations in the <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/> at the moment of invocation.
</summary>
<returns>A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the associations.</returns>
</member>
<member name="M:TvdP.Collections.ConcurrentDictionary`2.System#Collections#IEnumerable#GetEnumerator">
<summary>
Returns an enumerator that iterates through all associations in the <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/> at the moment of invocation.
</summary>
<returns>A <see cref="T:System.Collections.IEnumerator"/> that can be used to iterate through the associations.</returns>
</member>
<member name="P:TvdP.Collections.ConcurrentDictionary`2.Comparer">
<summary>
Gives the <see cref="T:System.Collections.Generic.IEqualityComparer`1"/> of TKey that is used to compare keys.
</summary>
</member>
<member name="P:TvdP.Collections.ConcurrentDictionary`2.Keys">
<summary>
Gets an <see cref="T:System.Collections.Generic.ICollection`1"/> containing the keys of
the dictionary.
</summary>
<returns>An <see cref="T:System.Collections.Generic.ICollection`1"/> containing the keys of the dictionary.</returns>
<remarks>This property takes a snapshot of the current keys collection of the dictionary at the moment of invocation.</remarks>
</member>
<member name="P:TvdP.Collections.ConcurrentDictionary`2.Values">
<summary>
Gets an <see cref="T:System.Collections.Generic.ICollection`1"/> containing the values in
the dictionary.
</summary>
<returns>
An <see cref="T:System.Collections.Generic.ICollection`1"/> containing the values in the dictionary.
</returns>
<remarks>This property takes a snapshot of the current keys collection of the dictionary at the moment of invocation.</remarks>
</member>
<member name="P:TvdP.Collections.ConcurrentDictionary`2.Item(`0)">
<summary>
Gets or sets the value associated with the specified key.
</summary>
<param name="key">The key of the value to get or set.</param>
<returns>The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key.</returns>
<remarks>
When working with multiple threads, that can each potentialy remove the searched for item, a <see cref="T:System.Collections.Generic.KeyNotFoundException"/> can always be expected.
</remarks>
</member>
<member name="P:TvdP.Collections.ConcurrentDictionary`2.Count">
<summary>
Gets the number of elements contained in the <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/>.
</summary>
</member>
<member name="P:TvdP.Collections.ConcurrentDictionary`2.System#Collections#Generic#ICollection{System#Collections#Generic#KeyValuePair{TKey@TValue}}#IsReadOnly">
<summary>
Gets a value indicating whether the <see cref="T:TvdP.Collections.ConcurrentDictionaryKey`2"/> is read-only, which is always false.
</summary>
</member>
<member name="T:TvdP.Collections.Segment`2">
<summary>
A 'single writer - multi reader' threaded segment in a hashtable.
</summary>
<typeparam name="TStored"></typeparam>
<typeparam name="TSearch"></typeparam>
<remarks>
Though each segment can be accessed by 1 writer thread simultaneously, the hashtable becomes concurrent
for writing by containing many segments so that collisions are rare. The table will be fully concurrent
for read operations as far as they are not colliding with write operations.
Each segment is itself a small hashtable that can grow and shrink individualy. This prevents blocking of
the entire hashtable when growing or shrinking is needed. Because each segment is relatively small (depending on
the quality of the hash) resizing of the individual segments should not take much time.
</remarks>
</member>
<member name="M:TvdP.Collections.Segment`2.Initialize(System.Int32)">
<summary>
Initialize the segment.
</summary>
<param name="initialSize"></param>
</member>
<member name="M:TvdP.Collections.Segment`2.Welcome(TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
When segment gets introduced into hashtable then its allocated space should be added to the
total allocated space.
Single threaded access or locking is needed
</summary>
<param name="traits"></param>
</member>
<member name="M:TvdP.Collections.Segment`2.Bye(TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
When segment gets removed from hashtable then its allocated space should be subtracted to the
total allocated space.
Single threaded access or locking is needed
</summary>
<param name="traits"></param>
</member>
<member name="F:TvdP.Collections.Segment`2._List">
<summary>
Array with 'slots'. Each slot can be filled or empty.
</summary>
</member>
<member name="M:TvdP.Collections.Segment`2.InsertItemAtIndex(System.UInt32,System.UInt32,`0,TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Inserts an item into a *not empty* spot given by position i. It moves items forward until an empty spot is found.
</summary>
<param name="mask"></param>
<param name="i"></param>
<param name="itemCopy"></param>
<param name="traits"></param>
</member>
<member name="M:TvdP.Collections.Segment`2.FindItem(`1@,`0@,TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Find item in segment.
</summary>
<param name="key">Reference to the search key to use.</param>
<param name="item">Out reference to store the found item in.</param>
<param name="traits">Object that tells this segment how to treat items and keys.</param>
<returns>True if an item could be found, otherwise false.</returns>
</member>
<member name="M:TvdP.Collections.Segment`2.GetOldestItem(`0@,`0@,TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Find an existing item or, if it can't be found, insert a new item.
</summary>
<param name="key">Reference to the item that will be inserted if an existing item can't be found. It will also be used to search with.</param>
<param name="item">Out reference to store the found item or, if it can not be found, the new inserted item.</param>
<param name="traits">Object that tells this segment how to treat items and keys.</param>
<returns>True if an existing item could be found, otherwise false.</returns>
</member>
<member name="M:TvdP.Collections.Segment`2.InsertItem(`0@,`0@,TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Inserts an item in the segment, possibly replacing an equal existing item.
</summary>
<param name="key">A reference to the item to insert.</param>
<param name="item">An out reference where any replaced item will be written to, if no item was replaced the new item will be written to this reference.</param>
<param name="traits">Object that tells this segment how to treat items and keys.</param>
<returns>True if an existing item could be found and is replaced, otherwise false.</returns>
</member>
<member name="M:TvdP.Collections.Segment`2.RemoveItem(`1@,`0@,TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Removes an item from the segment.
</summary>
<param name="key">A reference to the key to search with.</param>
<param name="item">An out reference where the removed item will be stored or default(<typeparamref name="TStored"/>) if no item to remove can be found.</param>
<param name="traits">Object that tells this segment how to treat items and keys.</param>
<returns>True if an item could be found and is removed, false otherwise.</returns>
</member>
<member name="M:TvdP.Collections.Segment`2.GetNextItem(System.Int32,`0@,TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Iterate over items in the segment.
</summary>
<param name="beyond">Position beyond which the next filled slot will be found and the item in that slot returned. (Starting with -1)</param>
<param name="item">Out reference where the next item will be stored or default if the end of the segment is reached.</param>
<param name="traits">Object that tells this segment how to treat items and keys.</param>
<returns>The index position the next item has been found or -1 otherwise.</returns>
</member>
<member name="F:TvdP.Collections.Segment`2._Count">
<summary>
Total numer of filled slots in _List.
</summary>
</member>
<member name="M:TvdP.Collections.Segment`2.Trim(TvdP.Collections.ConcurrentHashtable{`0,`1})">
<summary>
Remove any excess allocated space
</summary>
<param name="traits"></param>
</member>
<member name="P:TvdP.Collections.Segment`2.IsAlive">
<summary>
Boolean value indicating if this segment has not been trashed yet.
</summary>
</member>
<member name="T:TvdP.Threading.TinyReaderWriterLock">
<summary>
Tiny spin lock that allows multiple readers simultanously and 1 writer exclusively
</summary>
</member>
<member name="M:TvdP.Threading.TinyReaderWriterLock.ReleaseForReading">
<summary>
Release a reader lock
</summary>
</member>
<member name="M:TvdP.Threading.TinyReaderWriterLock.ReleaseForWriting">
<summary>
Release a writer lock
</summary>
</member>
<member name="M:TvdP.Threading.TinyReaderWriterLock.LockForReading">
<summary>
Aquire a reader lock. Wait until lock is aquired.
</summary>
</member>
<member name="M:TvdP.Threading.TinyReaderWriterLock.LockForReading(System.Boolean)">
<summary>
Aquire a reader lock.
</summary>
<param name="wait">True if to wait until lock aquired, False to return immediately.</param>
<returns>Boolean indicating if lock was successfuly aquired.</returns>
</member>
<member name="M:TvdP.Threading.TinyReaderWriterLock.LockForWriting">
<summary>
Aquire a writer lock. Wait until lock is aquired.
</summary>
</member>
<member name="M:TvdP.Threading.TinyReaderWriterLock.LockForWriting(System.Boolean)">
<summary>
Aquire a writer lock.
</summary>
<param name="wait">True if to wait until lock aquired, False to return immediately.</param>
<returns>Boolean indicating if lock was successfuly aquired.</returns>
</member>
<member name="T:System.SerializableAttribute">
<summary>
Attempts to replicate the Desktop CLR.
</summary>
</member>
</members>
</doc>
Binary file not shown.
Binary file not shown.
Binary file not shown.