Skip to content

Commit 06bdf6a

Browse files
committed
updated Scheduler Custom Editor example to use IList instead of IQuarable, due to code refactoring
1 parent 13fe275 commit 06bdf6a

32 files changed

+68656
-125
lines changed

scheduler/scheduler-custom-editor/SchedulerCustomEditor.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2012
44
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchedulerCustomEditor", "SchedulerCustomEditor\SchedulerCustomEditor.csproj", "{E3EF35D5-D0CE-49CC-B254-852C734EDEDE}"
55
EndProject
6-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{7AE16E70-0ADD-4C32-ADE1-3888DDB046FD}"
7-
ProjectSection(SolutionItems) = preProject
8-
.nuget\NuGet.Config = .nuget\NuGet.Config
9-
.nuget\NuGet.exe = .nuget\NuGet.exe
10-
.nuget\NuGet.targets = .nuget\NuGet.targets
11-
EndProjectSection
12-
EndProject
136
Global
147
GlobalSection(SolutionConfigurationPlatforms) = preSolution
158
Debug|Any CPU = Debug|Any CPU

scheduler/scheduler-custom-editor/SchedulerCustomEditor/Models/Sample.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scheduler/scheduler-custom-editor/SchedulerCustomEditor/Models/Sample.edmx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<edmx:Runtime>
55
<!-- SSDL content -->
66
<edmx:StorageModels>
7-
<Schema Namespace="SampleModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
7+
<Schema Namespace="SampleModel.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
88
<EntityContainer Name="SampleModelStoreContainer">
99
<EntitySet Name="MeetingAttendees" EntityType="SampleModel.Store.MeetingAttendees" store:Type="Tables" Schema="dbo" />
1010
<EntitySet Name="Meetings" EntityType="SampleModel.Store.Meetings" store:Type="Tables" Schema="dbo" />
@@ -66,7 +66,8 @@
6666
</Dependent>
6767
</ReferentialConstraint>
6868
</Association>
69-
</Schema></edmx:StorageModels>
69+
</Schema>
70+
</edmx:StorageModels>
7071
<!-- CSDL content -->
7172
<edmx:ConceptualModels>
7273
<Schema Namespace="SampleModel" Alias="Self" p1:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:p1="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">

scheduler/scheduler-custom-editor/SchedulerCustomEditor/Models/SchedulerMeetingService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using Kendo.Mvc.UI;
44
using System;
5+
using System.Collections.Generic;
56
using System.Linq;
67
using System.Web.Mvc;
78

@@ -19,7 +20,7 @@ public SchedulerMeetingService()
1920
{
2021
}
2122

22-
public virtual IQueryable<MeetingViewModel> GetAll()
23+
public virtual IList<MeetingViewModel> GetAll() // IList should be replaced by IQueryable if you are using version prior to Q3 2016 SP1.
2324
{
2425
return db.Meetings.ToList().Select(meeting => new MeetingViewModel
2526
{
@@ -36,7 +37,7 @@ public virtual IQueryable<MeetingViewModel> GetAll()
3637
RecurrenceException = meeting.RecurrenceException,
3738
RecurrenceID = meeting.RecurrenceID,
3839
Attendees = meeting.MeetingAttendees.Select(m => m.AttendeeID).ToArray()
39-
}).AsQueryable();
40+
}).ToList(); //ToList should be replaced by AsQueryable if you are using version prior to Q3 2016 SP1.
4041
}
4142

4243
public virtual void Insert(MeetingViewModel meeting, ModelStateDictionary modelState)

scheduler/scheduler-custom-editor/SchedulerCustomEditor/SchedulerCustomEditor.csproj

Lines changed: 15 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
</ProductVersion>
99
<SchemaVersion>2.0</SchemaVersion>
1010
<ProjectGuid>{E3EF35D5-D0CE-49CC-B254-852C734EDEDE}</ProjectGuid>
11-
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
11+
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
1212
<OutputType>Library</OutputType>
1313
<AppDesignerFolder>Properties</AppDesignerFolder>
1414
<RootNamespace>SchedulerCustomEditor</RootNamespace>
1515
<AssemblyName>SchedulerCustomEditor</AssemblyName>
16-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
16+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1717
<MvcBuildViews>false</MvcBuildViews>
1818
<FileUpgradeFlags>
1919
</FileUpgradeFlags>
@@ -24,10 +24,6 @@
2424
<IISExpressWindowsAuthentication />
2525
<IISExpressUseClassicPipelineMode />
2626
<UpgradeBackupLocation />
27-
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
28-
<RestorePackages>true</RestorePackages>
29-
<TargetFrameworkProfile />
30-
<WebGreaseLibPath>..\packages\WebGrease.1.5.2\lib</WebGreaseLibPath>
3127
</PropertyGroup>
3228
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3329
<DebugSymbols>true</DebugSymbols>
@@ -47,75 +43,37 @@
4743
<WarningLevel>4</WarningLevel>
4844
</PropertyGroup>
4945
<ItemGroup>
50-
<Reference Include="Antlr3.Runtime, Version=3.4.1.9004, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
51-
<SpecificVersion>False</SpecificVersion>
52-
<HintPath>..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>
53-
</Reference>
54-
<Reference Include="EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
55-
<SpecificVersion>False</SpecificVersion>
46+
<Reference Include="EntityFramework">
5647
<HintPath>..\packages\EntityFramework.5.0.0\lib\net45\EntityFramework.dll</HintPath>
5748
</Reference>
58-
<Reference Include="Kendo.Mvc, Version=2015.3.930.340, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL">
59-
<SpecificVersion>False</SpecificVersion>
60-
<HintPath>..\..\..\..\..\Program Files (x86)\Telerik\UI for ASP.NET MVC Q3 2015\wrappers\aspnetmvc\Binaries\Mvc5\Kendo.Mvc.dll</HintPath>
49+
<Reference Include="Kendo.Mvc">
50+
<HintPath>..\lib\KENDOUIMVC\2013.3.1119.340\Kendo.Mvc.dll</HintPath>
6151
</Reference>
6252
<Reference Include="Microsoft.CSharp" />
63-
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
64-
<Private>True</Private>
65-
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
66-
</Reference>
67-
<Reference Include="System.Data.DataSetExtensions" />
6853
<Reference Include="System.Data.Entity" />
6954
<Reference Include="System.Runtime.Serialization" />
7055
<Reference Include="System.Security" />
71-
<Reference Include="System.Web.Extensions" />
56+
<Reference Include="System.Web.WebPages, Version=1.0.0.0,&#xD;&#xA;Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL " />
57+
<Reference Include="System.Web.Helpers, Version=1.0.0.0,&#xD;&#xA;Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
7258
<Reference Include="System" />
7359
<Reference Include="System.Data" />
7460
<Reference Include="System.Drawing" />
7561
<Reference Include="System.Web.DynamicData" />
7662
<Reference Include="System.Web.Entity" />
7763
<Reference Include="System.Web.ApplicationServices" />
7864
<Reference Include="System.ComponentModel.DataAnnotations" />
65+
<Reference Include="System.Core" />
66+
<Reference Include="System.Data.DataSetExtensions" />
67+
<Reference Include="System.Xml.Linq" />
7968
<Reference Include="System.Web" />
69+
<Reference Include="System.Web.Extensions" />
8070
<Reference Include="System.Web.Abstractions" />
81-
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
82-
<SpecificVersion>False</SpecificVersion>
83-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
84-
</Reference>
85-
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
86-
<SpecificVersion>False</SpecificVersion>
87-
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
88-
</Reference>
89-
<Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
90-
<SpecificVersion>False</SpecificVersion>
91-
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
92-
</Reference>
93-
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
94-
<SpecificVersion>False</SpecificVersion>
95-
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
96-
</Reference>
9771
<Reference Include="System.Web.Routing" />
98-
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
99-
<SpecificVersion>False</SpecificVersion>
100-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
101-
</Reference>
102-
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
103-
<SpecificVersion>False</SpecificVersion>
104-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
105-
</Reference>
106-
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
107-
<SpecificVersion>False</SpecificVersion>
108-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
109-
</Reference>
11072
<Reference Include="System.Xml" />
11173
<Reference Include="System.Configuration" />
11274
<Reference Include="System.Web.Services" />
11375
<Reference Include="System.EnterpriseServices" />
114-
<Reference Include="System.Xml.Linq" />
115-
<Reference Include="WebGrease, Version=1.5.2.14234, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
116-
<SpecificVersion>False</SpecificVersion>
117-
<HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath>
118-
</Reference>
76+
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
11977
</ItemGroup>
12078
<ItemGroup>
12179
<Compile Include="Controllers\HomeController.cs" />
@@ -215,6 +173,9 @@
215173
<ItemGroup>
216174
<Content Include="Views\Shared\EditorTemplates\Url.cshtml" />
217175
</ItemGroup>
176+
<ItemGroup>
177+
<Content Include="packages.config" />
178+
</ItemGroup>
218179
<ItemGroup>
219180
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
220181
</ItemGroup>
@@ -242,9 +203,6 @@
242203
<LastGenOutput>Sample.cs</LastGenOutput>
243204
</Content>
244205
</ItemGroup>
245-
<ItemGroup>
246-
<Content Include="packages.config" />
247-
</ItemGroup>
248206
<PropertyGroup>
249207
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
250208
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
@@ -280,11 +238,4 @@
280238
<UserProperties UseCdnSupport="True" />
281239
</VisualStudio>
282240
</ProjectExtensions>
283-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
284-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
285-
<PropertyGroup>
286-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
287-
</PropertyGroup>
288-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
289-
</Target>
290241
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@model object
22

3-
@Html.Kendo().TextBoxFor(model => model)
3+
@Html.TextBoxFor(model => model, new {@class="k-textbox" })

scheduler/scheduler-custom-editor/SchedulerCustomEditor/Views/Shared/_Layout.cshtml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
<head>
44
<title>@ViewBag.Title</title>
55
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
6-
<link href="http://cdn.kendostatic.com/2015.3.930/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
7-
<link href="http://cdn.kendostatic.com/2015.3.930/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
8-
<link href="http://cdn.kendostatic.com/2015.3.930/styles/kendo.dataviz.default.min.css" rel="stylesheet" type="text/css" />
9-
<script src="http://cdn.kendostatic.com/2015.3.930/js/jquery.min.js"></script>
10-
<script src="http://cdn.kendostatic.com/2015.3.930/js/jszip.min.js"></script>
11-
<script src="http://cdn.kendostatic.com/2015.3.930/js/kendo.all.min.js"></script>
12-
<script src="http://cdn.kendostatic.com/2015.3.930/js/kendo.aspnetmvc.min.js"></script>
13-
<script src="http://cdn.kendostatic.com/2015.3.930/js/kendo.timezones.min.js"></script>
6+
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
7+
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
8+
<script src="http://cdn.kendostatic.com/2013.3.1119/js/jquery.min.js"></script>
9+
<script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.all.min.js"></script>
10+
<script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.aspnetmvc.min.js"></script>
11+
<script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.timezones.min.js"></script>
1412
</head>
1513

1614
<body>

scheduler/scheduler-custom-editor/SchedulerCustomEditor/Views/web.config

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22

33
<configuration>
44
<configSections>
5-
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
6-
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
7-
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
5+
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
6+
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
7+
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
88
</sectionGroup>
99
</configSections>
1010

1111
<system.web.webPages.razor>
12-
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
12+
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
1313
<pages pageBaseType="System.Web.Mvc.WebViewPage">
1414
<namespaces>
1515
<add namespace="System.Web.Mvc" />
1616
<add namespace="System.Web.Mvc.Ajax" />
1717
<add namespace="System.Web.Mvc.Html" />
18-
<add namespace="System.Web.Optimization" />
1918
<add namespace="System.Web.Routing" />
20-
<add namespace="SchedulerCustomEditor" />
21-
<add namespace="Kendo.Mvc.UI" />
19+
<add namespace="Kendo.Mvc.UI" />
2220
</namespaces>
2321
</pages>
2422
</system.web.webPages.razor>
@@ -27,7 +25,28 @@
2725
<add key="webpages:Enabled" value="false" />
2826
</appSettings>
2927

28+
<system.web>
29+
<httpHandlers>
30+
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
31+
</httpHandlers>
32+
33+
<!--
34+
Enabling request validation in view pages would cause validation to occur
35+
after the input has already been processed by the controller. By default
36+
MVC performs request validation before a controller processes the input.
37+
To change this behavior apply the ValidateInputAttribute to a
38+
controller or action.
39+
-->
40+
<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
41+
<controls>
42+
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
43+
</controls>
44+
</pages>
45+
</system.web>
46+
3047
<system.webServer>
48+
<validation validateIntegratedModeConfiguration="false" />
49+
3150
<handlers>
3251
<remove name="BlockViewHandler" />
3352
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Antlr" version="3.4.1.9004" targetFramework="net452" />
4-
<package id="EntityFramework" version="5.0.0" targetFramework="net452" />
5-
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
6-
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
7-
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net452" />
8-
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
9-
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
10-
<package id="WebGrease" version="1.5.2" targetFramework="net452" />
3+
<package id="EntityFramework" version="5.0.0" targetFramework="net45" />
114
</packages>

0 commit comments

Comments
 (0)