crlf
This commit is contained in:
220
DayPilot.csproj
220
DayPilot.csproj
@@ -1,101 +1,121 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProductVersion>10.0.20506</ProductVersion>
|
<ProductVersion>10.0.20506</ProductVersion>
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
<ProjectGuid>{5D7983A4-CCFF-46F6-920F-F184A031D7E1}</ProjectGuid>
|
<ProjectGuid>{5D7983A4-CCFF-46F6-920F-F184A031D7E1}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>DayPilot</RootNamespace>
|
<RootNamespace>DayPilot</RootNamespace>
|
||||||
<AssemblyName>DayPilot</AssemblyName>
|
<AssemblyName>DayPilot</AssemblyName>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<OldToolsVersion>3.5</OldToolsVersion>
|
||||||
<UpgradeBackupLocation>
|
<UpgradeBackupLocation>
|
||||||
</UpgradeBackupLocation>
|
</UpgradeBackupLocation>
|
||||||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
<TargetFrameworkProfile />
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
</PropertyGroup>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugType>full</DebugType>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<Optimize>false</Optimize>
|
<DebugType>full</DebugType>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<Optimize>false</Optimize>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<WarningLevel>4</WarningLevel>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<DebugType>pdbonly</DebugType>
|
</PropertyGroup>
|
||||||
<Optimize>true</Optimize>
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<DebugType>pdbonly</DebugType>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<Optimize>true</Optimize>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<WarningLevel>4</WarningLevel>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
</PropertyGroup>
|
<WarningLevel>4</WarningLevel>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Corp|AnyCPU'">
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<OutputPath>bin\Corp\</OutputPath>
|
</PropertyGroup>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Corp|AnyCPU'">
|
||||||
<DebugType>full</DebugType>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<OutputPath>bin\Corp\</OutputPath>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
<DebugType>full</DebugType>
|
||||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
</PropertyGroup>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<ItemGroup>
|
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||||
<Reference Include="System" />
|
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||||
<Reference Include="System.Data" />
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<Reference Include="System.Design" />
|
</PropertyGroup>
|
||||||
<Reference Include="System.Drawing" />
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'sfu|AnyCPU'">
|
||||||
<Reference Include="System.Web" />
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<Reference Include="System.Xml" />
|
<OutputPath>bin\sfu\</OutputPath>
|
||||||
</ItemGroup>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ItemGroup>
|
<DebugType>full</DebugType>
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<AutoGen>True</AutoGen>
|
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
||||||
</Compile>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<Compile Include="Utils\Encoder.cs" />
|
</PropertyGroup>
|
||||||
<Compile Include="Utils\TimeFormatter.cs" />
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SFU2|AnyCPU'">
|
||||||
<Compile Include="Utils\Week.cs" />
|
<OutputPath>bin\SFU2\</OutputPath>
|
||||||
<Compile Include="Web\Ui\Block.cs" />
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
<Compile Include="Web\Ui\Column.cs" />
|
</PropertyGroup>
|
||||||
<Compile Include="Web\Ui\Day.cs" />
|
<ItemGroup>
|
||||||
<Compile Include="Web\Ui\DayPilotCalendar.cs" />
|
<Reference Include="System" />
|
||||||
<Compile Include="Web\Ui\DayPilotCalendarProperties.cs" />
|
<Reference Include="System.Data" />
|
||||||
<Compile Include="Web\Ui\DayPilotScheduler.cs" />
|
<Reference Include="System.Design" />
|
||||||
<Compile Include="Web\Ui\Design\DayPilotCalendarDesigner.cs" />
|
<Reference Include="System.Drawing" />
|
||||||
<Compile Include="Web\Ui\Enums\GroupByEnum.cs" />
|
<Reference Include="System.Web" />
|
||||||
<Compile Include="Web\Ui\Event.cs" />
|
<Reference Include="System.Xml" />
|
||||||
<Compile Include="Web\Ui\EventComparer.cs" />
|
</ItemGroup>
|
||||||
<Compile Include="Web\Ui\EventDelegates.cs" />
|
<ItemGroup>
|
||||||
<Compile Include="Web\Ui\NonBusinessHoursBehavior.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Web\Ui\Resource.cs" />
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
<Compile Include="Web\Ui\ResourceCollection.cs" />
|
<AutoGen>True</AutoGen>
|
||||||
<Compile Include="Web\Ui\Serialization\ResourceCollectionConverter.cs" />
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<Compile Include="Web\Ui\TimeFormat.cs" />
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
<Compile Include="Web\Ui\UserActionHandling.cs" />
|
</Compile>
|
||||||
</ItemGroup>
|
<Compile Include="Utils\Encoder.cs" />
|
||||||
<ItemGroup>
|
<Compile Include="Utils\TimeFormatter.cs" />
|
||||||
<None Include="app.config" />
|
<Compile Include="Utils\Week.cs" />
|
||||||
<None Include="Properties\Settings.settings">
|
<Compile Include="Web\Ui\Block.cs" />
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Compile Include="Web\Ui\Column.cs" />
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<Compile Include="Web\Ui\Day.cs" />
|
||||||
</None>
|
<Compile Include="Web\Ui\DayPilotCalendar.cs" />
|
||||||
</ItemGroup>
|
<Compile Include="Web\Ui\DayPilotCalendarProperties.cs" />
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Compile Include="Web\Ui\DayPilotScheduler.cs" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<Compile Include="Web\Ui\Design\DayPilotCalendarDesigner.cs" />
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
<Compile Include="Web\Ui\Enums\GroupByEnum.cs" />
|
||||||
<Target Name="BeforeBuild">
|
<Compile Include="Web\Ui\Event.cs" />
|
||||||
</Target>
|
<Compile Include="Web\Ui\EventComparer.cs" />
|
||||||
<Target Name="AfterBuild">
|
<Compile Include="Web\Ui\EventDelegates.cs" />
|
||||||
</Target>
|
<Compile Include="Web\Ui\NonBusinessHoursBehavior.cs" />
|
||||||
-->
|
<Compile Include="Web\Ui\Resource.cs" />
|
||||||
|
<Compile Include="Web\Ui\ResourceCollection.cs" />
|
||||||
|
<Compile Include="Web\Ui\Serialization\ResourceCollectionConverter.cs" />
|
||||||
|
<Compile Include="Web\Ui\TimeFormat.cs" />
|
||||||
|
<Compile Include="Web\Ui\UserActionHandling.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
</Project>
|
</Project>
|
||||||
52
DayPilot.sln
52
DayPilot.sln
@@ -1,26 +1,26 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||||
# Visual Studio 2008
|
# Visual Studio 2008
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DayPilot", "DayPilot.csproj", "{5D7983A4-CCFF-46F6-920F-F184A031D7E1}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DayPilot", "DayPilot.csproj", "{5D7983A4-CCFF-46F6-920F-F184A031D7E1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dpMvc2", "..\..\..\Projects\dpMvc2\dpMvc2.csproj", "{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dpMvc2", "..\..\..\Projects\dpMvc2\dpMvc2.csproj", "{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Release|Any CPU.Build.0 = Release|Any CPU
|
{5D7983A4-CCFF-46F6-920F-F184A031D7E1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Release|Any CPU.Build.0 = Release|Any CPU
|
{2A46CBBE-6F72-433B-96ED-6B5CEA12F696}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
/*
|
/*
|
||||||
Copyright © 2005 - 2008 Annpoint, s.r.o.
|
Copyright © 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("DayPilot")]
|
[assembly: AssemblyTitle("DayPilot")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("DayPilot")]
|
[assembly: AssemblyProduct("DayPilot")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2005 - 2008 Annpoint, s.r.o.")]
|
[assembly: AssemblyCopyright("Copyright © 2005 - 2008 Annpoint, s.r.o.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("e5d0e09d-0160-4c7c-a16e-374ba8867712")]
|
[assembly: Guid("e5d0e09d-0160-4c7c-a16e-374ba8867712")]
|
||||||
|
|
||||||
[assembly: TagPrefix("DayPilot.Web.Ui", "DayPilot")]
|
[assembly: TagPrefix("DayPilot.Web.Ui", "DayPilot")]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("3.0.210.0")]
|
[assembly: AssemblyVersion("3.0.210.0")]
|
||||||
[assembly: AssemblyFileVersion("3.0.210.0")]
|
[assembly: AssemblyFileVersion("3.0.210.0")]
|
||||||
|
|||||||
74
Properties/Settings.Designer.cs
generated
74
Properties/Settings.Designer.cs
generated
@@ -1,37 +1,37 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.20506.1
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace DayPilot.Properties {
|
namespace DayPilot.Properties {
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
public static Settings Default {
|
public static Settings Default {
|
||||||
get {
|
get {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
|
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\bookings.mdf;Integrated" +
|
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\bookings.mdf;Integrated" +
|
||||||
" Security=True;User Instance=True")]
|
" Security=True;User Instance=True")]
|
||||||
public string bookingsConnectionString {
|
public string bookingsConnectionString {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["bookingsConnectionString"]));
|
return ((string)(this["bookingsConnectionString"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DayPilot.Properties" GeneratedClassName="Settings">
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DayPilot.Properties" GeneratedClassName="Settings">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="bookingsConnectionString" Type="(Connection string)" Scope="Application">
|
<Setting Name="bookingsConnectionString" Type="(Connection string)" Scope="Application">
|
||||||
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
||||||
<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||||
<ConnectionString>Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bookings.mdf;Integrated Security=True;User Instance=True</ConnectionString>
|
<ConnectionString>Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bookings.mdf;Integrated Security=True;User Instance=True</ConnectionString>
|
||||||
<ProviderName>System.Data.SqlClient</ProviderName>
|
<ProviderName>System.Data.SqlClient</ProviderName>
|
||||||
</SerializableConnectionString></DesignTimeValue>
|
</SerializableConnectionString></DesignTimeValue>
|
||||||
<Value Profile="(Default)">Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bookings.mdf;Integrated Security=True;User Instance=True</Value>
|
<Value Profile="(Default)">Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bookings.mdf;Integrated Security=True;User Instance=True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
246
Utils/Encoder.cs
246
Utils/Encoder.cs
@@ -1,123 +1,123 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
namespace DayPilot.Utils
|
namespace DayPilot.Utils
|
||||||
{
|
{
|
||||||
internal class Encoder
|
internal class Encoder
|
||||||
{
|
{
|
||||||
private static HttpApplication _app = null;
|
private static HttpApplication _app = null;
|
||||||
private static HttpServerUtility Server
|
private static HttpServerUtility Server
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (HttpContext.Current != null)
|
if (HttpContext.Current != null)
|
||||||
return HttpContext.Current.Server;
|
return HttpContext.Current.Server;
|
||||||
|
|
||||||
if (_app == null)
|
if (_app == null)
|
||||||
_app = new HttpApplication();
|
_app = new HttpApplication();
|
||||||
return _app.Server;
|
return _app.Server;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string HtmlEncode(string input)
|
internal static string HtmlEncode(string input)
|
||||||
{
|
{
|
||||||
if (input == null)
|
if (input == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Server.HtmlEncode(input);
|
return Server.HtmlEncode(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal static string UrlEncode(string input)
|
internal static string UrlEncode(string input)
|
||||||
{
|
{
|
||||||
// return Server.UrlPathEncode(input);
|
// return Server.UrlPathEncode(input);
|
||||||
if (input == null)
|
if (input == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return input.Replace("&", "%26");
|
return input.Replace("&", "%26");
|
||||||
// return Server.UrlEncode(input);
|
// return Server.UrlEncode(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string UrlDecode(string input)
|
internal static string UrlDecode(string input)
|
||||||
{
|
{
|
||||||
return Server.UrlDecode(input);
|
return Server.UrlDecode(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static DateTime UrlDecodeDateTime(string input)
|
internal static DateTime UrlDecodeDateTime(string input)
|
||||||
{
|
{
|
||||||
CultureInfo culture = new CultureInfo("en-US");
|
CultureInfo culture = new CultureInfo("en-US");
|
||||||
string decoded = Server.UrlDecode(input);
|
string decoded = Server.UrlDecode(input);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return DateTime.ParseExact(decoded, culture.DateTimeFormat.SortableDateTimePattern, culture.DateTimeFormat);
|
return DateTime.ParseExact(decoded, culture.DateTimeFormat.SortableDateTimePattern, culture.DateTimeFormat);
|
||||||
}
|
}
|
||||||
catch (FormatException e)
|
catch (FormatException e)
|
||||||
{
|
{
|
||||||
throw new ApplicationException("Unable to parse DateTime: '" + decoded + "'.", e);
|
throw new ApplicationException("Unable to parse DateTime: '" + decoded + "'.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string UrlEncode(IList list)
|
internal static string UrlEncode(IList list)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
bool isFirst = true;
|
bool isFirst = true;
|
||||||
foreach (object o in list)
|
foreach (object o in list)
|
||||||
{
|
{
|
||||||
string item;
|
string item;
|
||||||
if (o is DateTime)
|
if (o is DateTime)
|
||||||
{
|
{
|
||||||
DateTime dt = (DateTime) o;
|
DateTime dt = (DateTime) o;
|
||||||
item = dt.ToString("s");
|
item = dt.ToString("s");
|
||||||
}
|
}
|
||||||
else if (o == null)
|
else if (o == null)
|
||||||
{
|
{
|
||||||
item = String.Empty;
|
item = String.Empty;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item = o.ToString();
|
item = o.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isFirst)
|
if (!isFirst)
|
||||||
{
|
{
|
||||||
sb.Append("&");
|
sb.Append("&");
|
||||||
}
|
}
|
||||||
|
|
||||||
sb.Append(UrlEncode(item));
|
sb.Append(UrlEncode(item));
|
||||||
|
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,83 +1,83 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using DayPilot.Web.Ui;
|
using DayPilot.Web.Ui;
|
||||||
|
|
||||||
namespace DayPilot.Utils
|
namespace DayPilot.Utils
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper class for hour formatting.
|
/// Helper class for hour formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TimeFormatter
|
public class TimeFormatter
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extracts hour from DateTime class and formats it for 12/24 hours clock.
|
/// Extracts hour from DateTime class and formats it for 12/24 hours clock.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="time"></param>
|
/// <param name="time"></param>
|
||||||
/// <param name="clock"></param>
|
/// <param name="clock"></param>
|
||||||
/// <param name="format"></param>
|
/// <param name="format"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetHour(DateTime time, TimeFormat clock, string format)
|
public static string GetHour(DateTime time, TimeFormat clock, string format)
|
||||||
{
|
{
|
||||||
return GetHour(time.Hour, clock, format);
|
return GetHour(time.Hour, clock, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Formats an hour number for 12/24 hours clock.
|
/// Formats an hour number for 12/24 hours clock.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hour"></param>
|
/// <param name="hour"></param>
|
||||||
/// <param name="clock"></param>
|
/// <param name="clock"></param>
|
||||||
/// <param name="format"></param>
|
/// <param name="format"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetHour(int hour, TimeFormat clock, string format)
|
public static string GetHour(int hour, TimeFormat clock, string format)
|
||||||
{
|
{
|
||||||
bool am = (hour / 12) == 0;
|
bool am = (hour / 12) == 0;
|
||||||
if (clock == TimeFormat.Clock12Hours)
|
if (clock == TimeFormat.Clock12Hours)
|
||||||
{
|
{
|
||||||
hour = hour % 12;
|
hour = hour % 12;
|
||||||
if (hour == 0)
|
if (hour == 0)
|
||||||
hour = 12;
|
hour = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
string suffix = String.Empty;
|
string suffix = String.Empty;
|
||||||
if (clock == TimeFormat.Clock12Hours)
|
if (clock == TimeFormat.Clock12Hours)
|
||||||
{
|
{
|
||||||
if (am)
|
if (am)
|
||||||
{
|
{
|
||||||
suffix = "AM";
|
suffix = "AM";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
suffix = "PM";
|
suffix = "PM";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(format))
|
if (String.IsNullOrEmpty(format))
|
||||||
{
|
{
|
||||||
format = "{0} {1}";
|
format = "{0} {1}";
|
||||||
}
|
}
|
||||||
|
|
||||||
return String.Format(format, hour, suffix);
|
return String.Format(format, hour, suffix);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
316
Utils/Week.cs
316
Utils/Week.cs
@@ -1,158 +1,158 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace DayPilot.Utils
|
namespace DayPilot.Utils
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper class for week manipulation and formatting.
|
/// Helper class for week manipulation and formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Week
|
public class Week
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the first day of this week. Based on current culture.
|
/// Gets the first day of this week. Based on current culture.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static DateTime FirstDayOfWeek()
|
public static DateTime FirstDayOfWeek()
|
||||||
{
|
{
|
||||||
return FirstDayOfWeek(DateTime.Today);
|
return FirstDayOfWeek(DateTime.Today);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the first day of a week where day (parameter) belongs. Based on current culture.
|
/// Gets the first day of a week where day (parameter) belongs. Based on current culture.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static DateTime FirstDayOfWeek(DateTime day)
|
public static DateTime FirstDayOfWeek(DateTime day)
|
||||||
{
|
{
|
||||||
return FirstDayOfWeek(day, Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek);
|
return FirstDayOfWeek(day, Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the first day of a week where day (parameter) belongs. weekStart (parameter) specifies the starting day of week.
|
/// Gets the first day of a week where day (parameter) belongs. weekStart (parameter) specifies the starting day of week.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static DateTime FirstDayOfWeek(DateTime day, DayOfWeek weekStarts)
|
public static DateTime FirstDayOfWeek(DateTime day, DayOfWeek weekStarts)
|
||||||
{
|
{
|
||||||
DateTime d = day;
|
DateTime d = day;
|
||||||
while (d.DayOfWeek != weekStarts)
|
while (d.DayOfWeek != weekStarts)
|
||||||
{
|
{
|
||||||
d = d.AddDays(-1);
|
d = d.AddDays(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns Monday of the week where day (parameter) belongs.
|
/// Returns Monday of the week where day (parameter) belongs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="day"></param>
|
/// <param name="day"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static DateTime FirstWorkingDayOfWeek(DateTime day)
|
public static DateTime FirstWorkingDayOfWeek(DateTime day)
|
||||||
{
|
{
|
||||||
return FirstDayOfWeek(day, DayOfWeek.Monday);
|
return FirstDayOfWeek(day, DayOfWeek.Monday);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// http://konsulent.sandelien.no/VB_help/Week/
|
// http://konsulent.sandelien.no/VB_help/Week/
|
||||||
// just for Monday being the first day of week
|
// just for Monday being the first day of week
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculates week number for the specified date according to ISO 8601.
|
/// Calculates week number for the specified date according to ISO 8601.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="date"></param>
|
/// <param name="date"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static int WeekNrISO8601(DateTime date)
|
public static int WeekNrISO8601(DateTime date)
|
||||||
{
|
{
|
||||||
bool ThursdayFlag = false;
|
bool ThursdayFlag = false;
|
||||||
int DayOfYear = date.DayOfYear;
|
int DayOfYear = date.DayOfYear;
|
||||||
|
|
||||||
int StartWeekDayOfYear =
|
int StartWeekDayOfYear =
|
||||||
(int)(new DateTime(date.Year, 1, 1)).DayOfWeek;
|
(int)(new DateTime(date.Year, 1, 1)).DayOfWeek;
|
||||||
int EndWeekDayOfYear =
|
int EndWeekDayOfYear =
|
||||||
(int)(new DateTime(date.Year, 12, 31)).DayOfWeek;
|
(int)(new DateTime(date.Year, 12, 31)).DayOfWeek;
|
||||||
|
|
||||||
if (StartWeekDayOfYear == 0)
|
if (StartWeekDayOfYear == 0)
|
||||||
StartWeekDayOfYear = 7;
|
StartWeekDayOfYear = 7;
|
||||||
if (EndWeekDayOfYear == 0)
|
if (EndWeekDayOfYear == 0)
|
||||||
EndWeekDayOfYear = 7;
|
EndWeekDayOfYear = 7;
|
||||||
|
|
||||||
int DaysInFirstWeek = 8 - (StartWeekDayOfYear);
|
int DaysInFirstWeek = 8 - (StartWeekDayOfYear);
|
||||||
|
|
||||||
if (StartWeekDayOfYear == 4 || EndWeekDayOfYear == 4)
|
if (StartWeekDayOfYear == 4 || EndWeekDayOfYear == 4)
|
||||||
ThursdayFlag = true;
|
ThursdayFlag = true;
|
||||||
|
|
||||||
int FullWeeks = (int)Math.Ceiling((DayOfYear - (DaysInFirstWeek)) / 7.0);
|
int FullWeeks = (int)Math.Ceiling((DayOfYear - (DaysInFirstWeek)) / 7.0);
|
||||||
|
|
||||||
int WeekNumber = FullWeeks;
|
int WeekNumber = FullWeeks;
|
||||||
|
|
||||||
if (DaysInFirstWeek >= 4)
|
if (DaysInFirstWeek >= 4)
|
||||||
WeekNumber = WeekNumber + 1;
|
WeekNumber = WeekNumber + 1;
|
||||||
|
|
||||||
if (WeekNumber > 52 && !ThursdayFlag)
|
if (WeekNumber > 52 && !ThursdayFlag)
|
||||||
WeekNumber = 1;
|
WeekNumber = 1;
|
||||||
|
|
||||||
if (WeekNumber == 0)
|
if (WeekNumber == 0)
|
||||||
WeekNumber = WeekNrISO8601(new DateTime(date.Year - 1, 12, 31));
|
WeekNumber = WeekNrISO8601(new DateTime(date.Year - 1, 12, 31));
|
||||||
return WeekNumber;
|
return WeekNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns day names (using current culture).
|
/// Returns day names (using current culture).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static ArrayList GetDayNames()
|
public static ArrayList GetDayNames()
|
||||||
{
|
{
|
||||||
return GetDayNames("dddd");
|
return GetDayNames("dddd");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns day names (using current culture).
|
/// Returns day names (using current culture).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="format">Corresponds to DateTime.ToString() formats. "DD" is also available (first two characters of short day name).</param>
|
/// <param name="format">Corresponds to DateTime.ToString() formats. "DD" is also available (first two characters of short day name).</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static ArrayList GetDayNames(string format)
|
public static ArrayList GetDayNames(string format)
|
||||||
{
|
{
|
||||||
ArrayList result = new ArrayList();
|
ArrayList result = new ArrayList();
|
||||||
DateTime start = new DateTime(2006, 12, 31); // Sunday
|
DateTime start = new DateTime(2006, 12, 31); // Sunday
|
||||||
for (int i = 0; i < 7; i++)
|
for (int i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
// this uses the current culture
|
// this uses the current culture
|
||||||
string name;
|
string name;
|
||||||
if (format == "DD")
|
if (format == "DD")
|
||||||
{
|
{
|
||||||
name = start.AddDays(i).ToString("ddd").Substring(0, 2);
|
name = start.AddDays(i).ToString("ddd").Substring(0, 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
name = start.AddDays(i).ToString(format);
|
name = start.AddDays(i).ToString(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
result.Add(name);
|
result.Add(name);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
254
Web/Ui/Block.cs
254
Web/Ui/Block.cs
@@ -1,127 +1,127 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Block is a set of concurrent events.
|
/// Block is a set of concurrent events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class Block
|
internal class Block
|
||||||
{
|
{
|
||||||
internal ArrayList Columns;
|
internal ArrayList Columns;
|
||||||
private ArrayList events = new ArrayList();
|
private ArrayList events = new ArrayList();
|
||||||
|
|
||||||
|
|
||||||
internal Block()
|
internal Block()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Add(Event ev)
|
internal void Add(Event ev)
|
||||||
{
|
{
|
||||||
events.Add(ev);
|
events.Add(ev);
|
||||||
arrangeColumns();
|
arrangeColumns();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Column createColumn()
|
private Column createColumn()
|
||||||
{
|
{
|
||||||
Column col = new Column();
|
Column col = new Column();
|
||||||
this.Columns.Add(col);
|
this.Columns.Add(col);
|
||||||
col.Block = this;
|
col.Block = this;
|
||||||
|
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void arrangeColumns()
|
private void arrangeColumns()
|
||||||
{
|
{
|
||||||
// cleanup
|
// cleanup
|
||||||
this.Columns = new ArrayList();
|
this.Columns = new ArrayList();
|
||||||
|
|
||||||
foreach(Event e in events)
|
foreach(Event e in events)
|
||||||
e.Column = null;
|
e.Column = null;
|
||||||
|
|
||||||
// there always will be at least one column because arrangeColumns is called only from Add()
|
// there always will be at least one column because arrangeColumns is called only from Add()
|
||||||
createColumn();
|
createColumn();
|
||||||
|
|
||||||
foreach (Event e in events)
|
foreach (Event e in events)
|
||||||
{
|
{
|
||||||
foreach (Column col in Columns)
|
foreach (Column col in Columns)
|
||||||
{
|
{
|
||||||
if (col.CanAdd(e))
|
if (col.CanAdd(e))
|
||||||
{
|
{
|
||||||
col.Add(e);
|
col.Add(e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// it wasn't placed
|
// it wasn't placed
|
||||||
if (e.Column == null)
|
if (e.Column == null)
|
||||||
{
|
{
|
||||||
Column col = createColumn();
|
Column col = createColumn();
|
||||||
col.Add(e);
|
col.Add(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool OverlapsWith(Event e)
|
internal bool OverlapsWith(Event e)
|
||||||
{
|
{
|
||||||
if (events.Count == 0)
|
if (events.Count == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (this.BoxStart < e.BoxEnd && this.BoxEnd > e.BoxStart);
|
return (this.BoxStart < e.BoxEnd && this.BoxEnd > e.BoxStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal DateTime BoxStart
|
internal DateTime BoxStart
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime min = DateTime.MaxValue;
|
DateTime min = DateTime.MaxValue;
|
||||||
|
|
||||||
foreach(Event ev in events)
|
foreach(Event ev in events)
|
||||||
{
|
{
|
||||||
if (ev.BoxStart < min)
|
if (ev.BoxStart < min)
|
||||||
min = ev.BoxStart;
|
min = ev.BoxStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
return min;
|
return min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal DateTime BoxEnd
|
internal DateTime BoxEnd
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime max = DateTime.MinValue;
|
DateTime max = DateTime.MinValue;
|
||||||
|
|
||||||
foreach(Event ev in events)
|
foreach(Event ev in events)
|
||||||
{
|
{
|
||||||
if (ev.BoxEnd > max)
|
if (ev.BoxEnd > max)
|
||||||
max = ev.BoxEnd;
|
max = ev.BoxEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
238
Web/Ui/Column.cs
238
Web/Ui/Column.cs
@@ -1,119 +1,119 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using DayPilot.Web.Ui;
|
using DayPilot.Web.Ui;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Column is a column of events in a Block.
|
/// Column is a column of events in a Block.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Column
|
public class Column
|
||||||
{
|
{
|
||||||
private ArrayList events = new ArrayList();
|
private ArrayList events = new ArrayList();
|
||||||
internal Block Block;
|
internal Block Block;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the width of the column in percent.
|
/// Gets the width of the column in percent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int WidthPct
|
public int WidthPct
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Block == null)
|
if (Block == null)
|
||||||
throw new ApplicationException("This Column does not belong to any Block.");
|
throw new ApplicationException("This Column does not belong to any Block.");
|
||||||
|
|
||||||
if (Block.Columns.Count == 0)
|
if (Block.Columns.Count == 0)
|
||||||
throw new ApplicationException("Internal error: Problem with Block.Column.Counts (it is zero).");
|
throw new ApplicationException("Internal error: Problem with Block.Column.Counts (it is zero).");
|
||||||
|
|
||||||
// the last block will be a bit longer to make sure the total width is 100%
|
// the last block will be a bit longer to make sure the total width is 100%
|
||||||
if (isLastInBlock)
|
if (isLastInBlock)
|
||||||
return 100 / Block.Columns.Count + 100 % Block.Columns.Count;
|
return 100 / Block.Columns.Count + 100 % Block.Columns.Count;
|
||||||
else
|
else
|
||||||
return 100 / Block.Columns.Count;
|
return 100 / Block.Columns.Count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the starting percent of the column.
|
/// Gets the starting percent of the column.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int StartsAtPct
|
public int StartsAtPct
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Block == null)
|
if (Block == null)
|
||||||
throw new ApplicationException("This Column does not belong to any Block.");
|
throw new ApplicationException("This Column does not belong to any Block.");
|
||||||
|
|
||||||
if (Block.Columns.Count == 0)
|
if (Block.Columns.Count == 0)
|
||||||
throw new ApplicationException("Internal error: Problem with Block.Column.Counts (it is zero).");
|
throw new ApplicationException("Internal error: Problem with Block.Column.Counts (it is zero).");
|
||||||
|
|
||||||
return 100 / Block.Columns.Count * Number;
|
return 100 / Block.Columns.Count * Number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isLastInBlock
|
private bool isLastInBlock
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Block.Columns[Block.Columns.Count - 1] == this;
|
return Block.Columns[Block.Columns.Count - 1] == this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal Column()
|
internal Column()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool CanAdd(Event e)
|
internal bool CanAdd(Event e)
|
||||||
{
|
{
|
||||||
foreach (Event ev in events)
|
foreach (Event ev in events)
|
||||||
{
|
{
|
||||||
if (ev.OverlapsWith(e))
|
if (ev.OverlapsWith(e))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Add(Event e)
|
internal void Add(Event e)
|
||||||
{
|
{
|
||||||
if (e.Column != null)
|
if (e.Column != null)
|
||||||
throw new ApplicationException("This Event was already placed into a Column.");
|
throw new ApplicationException("This Event was already placed into a Column.");
|
||||||
|
|
||||||
events.Add(e);
|
events.Add(e);
|
||||||
e.Column = this;
|
e.Column = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the order number of the column.
|
/// Gets the order number of the column.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Number
|
public int Number
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Block == null)
|
if (Block == null)
|
||||||
throw new ApplicationException("This Column doesn't belong to any Block.");
|
throw new ApplicationException("This Column doesn't belong to any Block.");
|
||||||
|
|
||||||
return Block.Columns.IndexOf(this);
|
return Block.Columns.IndexOf(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
472
Web/Ui/Day.cs
472
Web/Ui/Day.cs
@@ -1,236 +1,236 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Day handles events of a single day.
|
/// Day handles events of a single day.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class Day : ISerializable
|
internal class Day : ISerializable
|
||||||
{
|
{
|
||||||
internal List<Event> events = new List<Event>();
|
internal List<Event> events = new List<Event>();
|
||||||
private List<Block> blocks = new List<Block>();
|
private List<Block> blocks = new List<Block>();
|
||||||
|
|
||||||
internal int cellDuration; // in minutes
|
internal int cellDuration; // in minutes
|
||||||
|
|
||||||
private DateTime start;
|
private DateTime start;
|
||||||
internal DateTime end;
|
internal DateTime end;
|
||||||
|
|
||||||
internal string Name;
|
internal string Name;
|
||||||
internal string Value;
|
internal string Value;
|
||||||
|
|
||||||
internal DateTime Start
|
internal DateTime Start
|
||||||
{
|
{
|
||||||
get { return start; }
|
get { return start; }
|
||||||
}
|
}
|
||||||
|
|
||||||
internal DateTime End
|
internal DateTime End
|
||||||
{
|
{
|
||||||
get { return end; }
|
get { return end; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Day(DateTime date)
|
public Day(DateTime date)
|
||||||
{
|
{
|
||||||
this.start = date.Date;
|
this.start = date.Date;
|
||||||
this.end = date.Date.AddDays(1);
|
this.end = date.Date.AddDays(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal Day(DateTime start, DateTime end, string header, string id, int cellDuration)
|
internal Day(DateTime start, DateTime end, string header, string id, int cellDuration)
|
||||||
{
|
{
|
||||||
this.start = start.Date;
|
this.start = start.Date;
|
||||||
this.end = end.Date;
|
this.end = end.Date;
|
||||||
this.Name = header;
|
this.Name = header;
|
||||||
this.Value = id;
|
this.Value = id;
|
||||||
this.cellDuration = cellDuration;
|
this.cellDuration = cellDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stripAndAddEvent(Event e)
|
private void stripAndAddEvent(Event e)
|
||||||
{
|
{
|
||||||
stripAndAddEvent(e.Start, e.End, e.PK, e.Name, e.Resource, e.Owner);
|
stripAndAddEvent(e.Start, e.End, e.PK, e.Name, e.Resource, e.Owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stripAndAddEvent(DateTime start, DateTime end, string pk, string name, string resource, string owner)
|
private void stripAndAddEvent(DateTime start, DateTime end, string pk, string name, string resource, string owner)
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(Value)) // this applies to resources view only
|
if (!String.IsNullOrEmpty(Value)) // this applies to resources view only
|
||||||
{
|
{
|
||||||
if (Value != resource) // don't add events that don't belong to this column
|
if (Value != resource) // don't add events that don't belong to this column
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the event happens before this day
|
// the event happens before this day
|
||||||
if (end <= Start)
|
if (end <= Start)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// the event happens after this day
|
// the event happens after this day
|
||||||
if (start >= End)
|
if (start >= End)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// this is invalid event that does have no duration
|
// this is invalid event that does have no duration
|
||||||
if (start >= end)
|
if (start >= end)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// fix the starting time
|
// fix the starting time
|
||||||
if (start < Start)
|
if (start < Start)
|
||||||
start = Start;
|
start = Start;
|
||||||
|
|
||||||
|
|
||||||
// fix the ending time
|
// fix the ending time
|
||||||
if (end > End)
|
if (end > End)
|
||||||
end = End;
|
end = End;
|
||||||
|
|
||||||
events.Add(new Event(pk, start, end, name, resource, owner));
|
events.Add(new Event(pk, start, end, name, resource, owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
private void stripAndAddEvent(Event e)
|
private void stripAndAddEvent(Event e)
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(Value)) // this applies to resources view only
|
if (!String.IsNullOrEmpty(Value)) // this applies to resources view only
|
||||||
{
|
{
|
||||||
if (Value != e.Resource) // don't add events that don't belong to this column
|
if (Value != e.Resource) // don't add events that don't belong to this column
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the event happens before this day
|
// the event happens before this day
|
||||||
if (e.End <= Start)
|
if (e.End <= Start)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// the event happens after this day
|
// the event happens after this day
|
||||||
if (e.Start >= End.AddDays(1))
|
if (e.Start >= End.AddDays(1))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// this is invalid event that has no duration
|
// this is invalid event that has no duration
|
||||||
if (e.Start >= e.End)
|
if (e.Start >= e.End)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Event part = new Event(this, e);
|
// Event part = new Event(this, e);
|
||||||
events.Add(e);
|
events.Add(e);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads events from ArrayList of Events.
|
/// Loads events from ArrayList of Events.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="events">ArrayList that contains the Events.</param>
|
/// <param name="events">ArrayList that contains the Events.</param>
|
||||||
public void Load(ArrayList events)
|
public void Load(ArrayList events)
|
||||||
{
|
{
|
||||||
if (events == null)
|
if (events == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Event e in events)
|
foreach (Event e in events)
|
||||||
{
|
{
|
||||||
stripAndAddEvent(e);
|
stripAndAddEvent(e);
|
||||||
}
|
}
|
||||||
putIntoBlocks();
|
putIntoBlocks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void putIntoBlocks()
|
private void putIntoBlocks()
|
||||||
{
|
{
|
||||||
foreach (Event e in events)
|
foreach (Event e in events)
|
||||||
{
|
{
|
||||||
// if there is no block, create the first one
|
// if there is no block, create the first one
|
||||||
if (lastBlock == null)
|
if (lastBlock == null)
|
||||||
{
|
{
|
||||||
blocks.Add(new Block());
|
blocks.Add(new Block());
|
||||||
}
|
}
|
||||||
// or if the event doesn't overlap with the last block, create a new block
|
// or if the event doesn't overlap with the last block, create a new block
|
||||||
else if (!lastBlock.OverlapsWith(e))
|
else if (!lastBlock.OverlapsWith(e))
|
||||||
{
|
{
|
||||||
blocks.Add(new Block());
|
blocks.Add(new Block());
|
||||||
}
|
}
|
||||||
|
|
||||||
// any case, add it to some block
|
// any case, add it to some block
|
||||||
lastBlock.Add(e);
|
lastBlock.Add(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Block lastBlock
|
private Block lastBlock
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (blocks.Count == 0)
|
if (blocks.Count == 0)
|
||||||
return null;
|
return null;
|
||||||
return blocks[blocks.Count - 1];
|
return blocks[blocks.Count - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
public void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
internal int MaxColumns()
|
internal int MaxColumns()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
foreach (Block b in blocks)
|
foreach (Block b in blocks)
|
||||||
{
|
{
|
||||||
if (b.Columns.Count > i)
|
if (b.Columns.Count > i)
|
||||||
i = b.Columns.Count;
|
i = b.Columns.Count;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime BoxStart
|
public DateTime BoxStart
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime min = DateTime.MaxValue;
|
DateTime min = DateTime.MaxValue;
|
||||||
|
|
||||||
foreach (Block block in blocks)
|
foreach (Block block in blocks)
|
||||||
{
|
{
|
||||||
if (block.BoxStart < min)
|
if (block.BoxStart < min)
|
||||||
min = block.BoxStart;
|
min = block.BoxStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
return min;
|
return min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The end of the box of the last event.
|
/// The end of the box of the last event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime BoxEnd
|
public DateTime BoxEnd
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
DateTime max = DateTime.MinValue;
|
DateTime max = DateTime.MinValue;
|
||||||
|
|
||||||
foreach (Block block in blocks)
|
foreach (Block block in blocks)
|
||||||
{
|
{
|
||||||
if (block.BoxEnd > max)
|
if (block.BoxEnd > max)
|
||||||
max = block.BoxEnd;
|
max = block.BoxEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,44 +1,44 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Web.UI.Design.WebControls;
|
using System.Web.UI.Design.WebControls;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui.Design
|
namespace DayPilot.Web.Ui.Design
|
||||||
{
|
{
|
||||||
public class DayPilotCalendarDesigner : DataBoundControlDesigner
|
public class DayPilotCalendarDesigner : DataBoundControlDesigner
|
||||||
{
|
{
|
||||||
protected override void PreFilterProperties(IDictionary properties)
|
protected override void PreFilterProperties(IDictionary properties)
|
||||||
{
|
{
|
||||||
base.PreFilterProperties(properties);
|
base.PreFilterProperties(properties);
|
||||||
|
|
||||||
properties.Remove("Height");
|
properties.Remove("Height");
|
||||||
properties.Remove("BorderStyle");
|
properties.Remove("BorderStyle");
|
||||||
properties.Remove("BorderWidth");
|
properties.Remove("BorderWidth");
|
||||||
properties.Remove("CssClass");
|
properties.Remove("CssClass");
|
||||||
properties.Remove("Font");
|
properties.Remove("Font");
|
||||||
properties.Remove("ForeColor");
|
properties.Remove("ForeColor");
|
||||||
properties.Remove("ToolTip");
|
properties.Remove("ToolTip");
|
||||||
properties.Remove("EndDate");
|
properties.Remove("EndDate");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui.Enums
|
namespace DayPilot.Web.Ui.Enums
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Header grouping units.
|
/// Header grouping units.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum GroupByEnum
|
public enum GroupByEnum
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Grouped by hour.
|
/// Grouped by hour.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Hour,
|
Hour,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Grouped by day.
|
/// Grouped by day.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Day,
|
Day,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Grouped by week.
|
/// Grouped by week.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Week,
|
Week,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Grouped by month.
|
/// Grouped by month.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Month,
|
Month,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// No grouping.
|
/// No grouping.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
284
Web/Ui/Event.cs
284
Web/Ui/Event.cs
@@ -1,142 +1,142 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for Event.
|
/// Summary description for Event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Event
|
public class Event
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event start.
|
/// Event start.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime Start;
|
public DateTime Start;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event end;
|
/// Event end;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime End;
|
public DateTime End;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event name;
|
/// Event name;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event primary key.
|
/// Event primary key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PK;
|
public string PK;
|
||||||
|
|
||||||
public string Resource;
|
public string Resource;
|
||||||
public string Owner;
|
public string Owner;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Column to which this event belongs.
|
/// Column to which this event belongs.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
public Column Column;
|
public Column Column;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Event()
|
public Event()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor that prefills the fields.
|
/// Constructor that prefills the fields.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pk"></param>
|
/// <param name="pk"></param>
|
||||||
/// <param name="start"></param>
|
/// <param name="start"></param>
|
||||||
/// <param name="end"></param>
|
/// <param name="end"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
public Event(string pk, DateTime start, DateTime end, string name) : this(pk, start, end, name, null)
|
public Event(string pk, DateTime start, DateTime end, string name) : this(pk, start, end, name, null)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Event(string pk, DateTime start, DateTime end, string name, string resource): this(pk, start, end, name, resource, null)
|
public Event(string pk, DateTime start, DateTime end, string name, string resource): this(pk, start, end, name, resource, null)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public Event(string pk, DateTime start, DateTime end, string name, string resource, string owner)
|
public Event(string pk, DateTime start, DateTime end, string name, string resource, string owner)
|
||||||
{
|
{
|
||||||
this.PK = pk;
|
this.PK = pk;
|
||||||
this.Start = start;
|
this.Start = start;
|
||||||
this.End = end;
|
this.End = end;
|
||||||
this.Name = name;
|
this.Name = name;
|
||||||
this.Resource = resource;
|
this.Resource = resource;
|
||||||
this.Owner = owner;
|
this.Owner = owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the starting time of an event box.
|
/// Gets the starting time of an event box.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime BoxStart
|
public DateTime BoxStart
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Start.Minute >= 30)
|
if (Start.Minute >= 30)
|
||||||
return new DateTime(Start.Year, Start.Month, Start.Day, Start.Hour, 30, 0);
|
return new DateTime(Start.Year, Start.Month, Start.Day, Start.Hour, 30, 0);
|
||||||
else
|
else
|
||||||
return new DateTime(Start.Year, Start.Month, Start.Day, Start.Hour, 0, 0);
|
return new DateTime(Start.Year, Start.Month, Start.Day, Start.Hour, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the ending time of an event box.
|
/// Gets the ending time of an event box.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime BoxEnd
|
public DateTime BoxEnd
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (End.Minute > 30)
|
if (End.Minute > 30)
|
||||||
{
|
{
|
||||||
DateTime hourPlus = End.AddHours(1);
|
DateTime hourPlus = End.AddHours(1);
|
||||||
return new DateTime(hourPlus.Year, hourPlus.Month, hourPlus.Day, hourPlus.Hour, 0, 0);
|
return new DateTime(hourPlus.Year, hourPlus.Month, hourPlus.Day, hourPlus.Hour, 0, 0);
|
||||||
}
|
}
|
||||||
else if (End.Minute > 0)
|
else if (End.Minute > 0)
|
||||||
{
|
{
|
||||||
return new DateTime(End.Year, End.Month, End.Day, End.Hour, 30, 0);
|
return new DateTime(End.Year, End.Month, End.Day, End.Hour, 30, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return new DateTime(End.Year, End.Month, End.Day, End.Hour, 0, 0);
|
return new DateTime(End.Year, End.Month, End.Day, End.Hour, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if this box overlaps with e's box.
|
/// Returns true if this box overlaps with e's box.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool OverlapsWith(Event e)
|
public bool OverlapsWith(Event e)
|
||||||
{
|
{
|
||||||
return (this.BoxStart < e.BoxEnd && this.BoxEnd > e.Start);
|
return (this.BoxStart < e.BoxEnd && this.BoxEnd > e.Start);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +1,52 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
public class EventComparer : IComparer
|
public class EventComparer : IComparer
|
||||||
{
|
{
|
||||||
|
|
||||||
// Calls CaseInsensitiveComparer.Compare with the parameters reversed.
|
// Calls CaseInsensitiveComparer.Compare with the parameters reversed.
|
||||||
public int Compare(object x, object y)
|
public int Compare(object x, object y)
|
||||||
{
|
{
|
||||||
Event first = (Event) x;
|
Event first = (Event) x;
|
||||||
Event second = (Event) y;
|
Event second = (Event) y;
|
||||||
|
|
||||||
if (first.Start < second.Start)
|
if (first.Start < second.Start)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first.Start > second.Start)
|
if (first.Start > second.Start)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first.End > second.End)
|
if (first.End > second.End)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +1,80 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delegate for passing an event primary key.
|
/// Delegate for passing an event primary key.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public delegate void EventClickDelegate(object sender, EventClickEventArgs e);
|
public delegate void EventClickDelegate(object sender, EventClickEventArgs e);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Delegate for passing a starting time.
|
/// Delegate for passing a starting time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public delegate void FreeClickDelegate(object sender, FreeClickEventArgs e);
|
public delegate void FreeClickDelegate(object sender, FreeClickEventArgs e);
|
||||||
|
|
||||||
|
|
||||||
public class EventClickEventArgs : EventArgs
|
public class EventClickEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
private string value;
|
private string value;
|
||||||
|
|
||||||
public string Value
|
public string Value
|
||||||
{
|
{
|
||||||
get { return value; }
|
get { return value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public EventClickEventArgs(string value)
|
public EventClickEventArgs(string value)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FreeClickEventArgs : EventArgs
|
public class FreeClickEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
private DateTime start;
|
private DateTime start;
|
||||||
private string resource;
|
private string resource;
|
||||||
|
|
||||||
|
|
||||||
public DateTime Start
|
public DateTime Start
|
||||||
{
|
{
|
||||||
get { return start; }
|
get { return start; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Resource
|
public string Resource
|
||||||
{
|
{
|
||||||
get { return resource; }
|
get { return resource; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public FreeClickEventArgs(DateTime start)
|
public FreeClickEventArgs(DateTime start)
|
||||||
{
|
{
|
||||||
this.start = start;
|
this.start = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FreeClickEventArgs(DateTime start, string resource)
|
public FreeClickEventArgs(DateTime start, string resource)
|
||||||
{
|
{
|
||||||
this.start = start;
|
this.start = start;
|
||||||
this.resource = resource;
|
this.resource = resource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Behavior of the non-business hours.
|
/// Behavior of the non-business hours.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum NonBusinessHoursBehavior
|
public enum NonBusinessHoursBehavior
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Hides the non-business hours if there is no event in that time.
|
/// Hides the non-business hours if there is no event in that time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
HideIfPossible,
|
HideIfPossible,
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Always hides the non-business hours.
|
/// Always hides the non-business hours.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Hide,
|
Hide,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Always shows the non-business hours.
|
/// Always shows the non-business hours.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Show
|
Show
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,87 +1,87 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class representing a resource <see cref="DayPilotScheduler">DayPilotScheduler</see>.
|
/// Class representing a resource <see cref="DayPilotScheduler">DayPilotScheduler</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class Resource
|
public class Resource
|
||||||
{
|
{
|
||||||
private string val;
|
private string val;
|
||||||
private string name;
|
private string name;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Resource()
|
public Resource()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor that sets the default values.
|
/// Constructor that sets the default values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">Row name (visible).</param>
|
/// <param name="name">Row name (visible).</param>
|
||||||
/// <param name="val">Row value (id).</param>
|
/// <param name="val">Row value (id).</param>
|
||||||
public Resource(string name, string val)
|
public Resource(string name, string val)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.val = val;
|
this.val = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Row value (id).
|
/// Row value (id).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Value
|
public string Value
|
||||||
{
|
{
|
||||||
get { return val; }
|
get { return val; }
|
||||||
set { val = value; }
|
set { val = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get or set the row name (<see cref="Resource.Name">Row.Name</see>).
|
/// Get or set the row name (<see cref="Resource.Name">Row.Name</see>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return name; }
|
get { return name; }
|
||||||
set { name = value; }
|
set { name = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///<summary>
|
///<summary>
|
||||||
///Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
|
///Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
|
||||||
///</summary>
|
///</summary>
|
||||||
///
|
///
|
||||||
///<returns>
|
///<returns>
|
||||||
///A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
|
///A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>.
|
||||||
///</returns>
|
///</returns>
|
||||||
///<filterpriority>2</filterpriority>
|
///<filterpriority>2</filterpriority>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,155 +1,155 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using DayPilot.Web.Ui.Serialization;
|
using DayPilot.Web.Ui.Serialization;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Collection of resources definitions.
|
/// Collection of resources definitions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
||||||
[TypeConverter(typeof(ResourceCollectionConverter))]
|
[TypeConverter(typeof(ResourceCollectionConverter))]
|
||||||
public class ResourceCollection : CollectionBase
|
public class ResourceCollection : CollectionBase
|
||||||
{
|
{
|
||||||
internal bool designMode;
|
internal bool designMode;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the specified <see cref="Resource">Resource</see>.
|
/// Gets the specified <see cref="Resource">Resource</see>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="index">Item index</param>
|
/// <param name="index">Item index</param>
|
||||||
/// <returns>Resource at the specified position.</returns>
|
/// <returns>Resource at the specified position.</returns>
|
||||||
public Resource this[int index]
|
public Resource this[int index]
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return ((Resource)List[index]);
|
return ((Resource)List[index]);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
List[index] = value;
|
List[index] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts ResourceCollection to ArrayList.
|
/// Converts ResourceCollection to ArrayList.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>ArrayList with ResourceCollection items.</returns>
|
/// <returns>ArrayList with ResourceCollection items.</returns>
|
||||||
public ArrayList ToArrayList()
|
public ArrayList ToArrayList()
|
||||||
{
|
{
|
||||||
ArrayList retArray = new ArrayList();
|
ArrayList retArray = new ArrayList();
|
||||||
for (int i = 0; i < this.Count; i++)
|
for (int i = 0; i < this.Count; i++)
|
||||||
{
|
{
|
||||||
retArray.Add(this[i]);
|
retArray.Add(this[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return retArray;
|
return retArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a new <see cref="Resource">Resource</see> to the collection.
|
/// Adds a new <see cref="Resource">Resource</see> to the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">Resource to be added.</param>
|
/// <param name="value">Resource to be added.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Add(Resource value)
|
public int Add(Resource value)
|
||||||
{
|
{
|
||||||
return (List.Add(value));
|
return (List.Add(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a new <see cref="Resource">Resource</see> to the collection.
|
/// Adds a new <see cref="Resource">Resource</see> to the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">Resource name</param>
|
/// <param name="name">Resource name</param>
|
||||||
/// <param name="id">Resource id</param>
|
/// <param name="id">Resource id</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int Add(string name, string id)
|
public int Add(string name, string id)
|
||||||
{
|
{
|
||||||
return Add(new Resource(name, id));
|
return Add(new Resource(name, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines the index of a specific item in the collection.
|
/// Determines the index of a specific item in the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int IndexOf(Resource value)
|
public int IndexOf(Resource value)
|
||||||
{
|
{
|
||||||
return (List.IndexOf(value));
|
return (List.IndexOf(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inserts a new resource at the specified position.
|
/// Inserts a new resource at the specified position.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="index">New resource position.</param>
|
/// <param name="index">New resource position.</param>
|
||||||
/// <param name="value">Resource to be added.</param>
|
/// <param name="value">Resource to be added.</param>
|
||||||
public void Insert(int index, Resource value)
|
public void Insert(int index, Resource value)
|
||||||
{
|
{
|
||||||
List.Insert(index, value);
|
List.Insert(index, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a Resource from the collection.
|
/// Removes a Resource from the collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">Resource to be removed.</param>
|
/// <param name="value">Resource to be removed.</param>
|
||||||
public void Remove(Resource value)
|
public void Remove(Resource value)
|
||||||
{
|
{
|
||||||
List.Remove(value);
|
List.Remove(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the collection contains a specified resource.
|
/// Determines whether the collection contains a specified resource.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">Resource to be found.</param>
|
/// <param name="value">Resource to be found.</param>
|
||||||
/// <returns>True if the collection contains the resource</returns>
|
/// <returns>True if the collection contains the resource</returns>
|
||||||
public bool Contains(Resource value)
|
public bool Contains(Resource value)
|
||||||
{
|
{
|
||||||
return (List.Contains(value));
|
return (List.Contains(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new collection from an ArrayList.
|
/// Creates a new collection from an ArrayList.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="items">ArrayList that contains the new resources.</param>
|
/// <param name="items">ArrayList that contains the new resources.</param>
|
||||||
public ResourceCollection(ArrayList items)
|
public ResourceCollection(ArrayList items)
|
||||||
: base()
|
: base()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < items.Count; i++)
|
for (int i = 0; i < items.Count; i++)
|
||||||
{
|
{
|
||||||
if (items[i] is Resource)
|
if (items[i] is Resource)
|
||||||
{
|
{
|
||||||
this.Add((Resource)items[i]);
|
this.Add((Resource)items[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new ResourceCollection.
|
/// Creates a new ResourceCollection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ResourceCollection()
|
public ResourceCollection()
|
||||||
: base()
|
: base()
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,136 +1,136 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using Encoder=DayPilot.Utils.Encoder;
|
using Encoder=DayPilot.Utils.Encoder;
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui.Serialization
|
namespace DayPilot.Web.Ui.Serialization
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Internal class for serializing ResourceCollection (ViewState).
|
/// Internal class for serializing ResourceCollection (ViewState).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ResourceCollectionConverter : TypeConverter
|
public class ResourceCollectionConverter : TypeConverter
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context"></param>
|
/// <param name="context"></param>
|
||||||
/// <param name="sourceType"></param>
|
/// <param name="sourceType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
|
||||||
{
|
{
|
||||||
if (sourceType == typeof(String))
|
if (sourceType == typeof(String))
|
||||||
return true;
|
return true;
|
||||||
return base.CanConvertFrom(context, sourceType);
|
return base.CanConvertFrom(context, sourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context"></param>
|
/// <param name="context"></param>
|
||||||
/// <param name="destinationType"></param>
|
/// <param name="destinationType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
|
||||||
{
|
{
|
||||||
if (destinationType == typeof(String))
|
if (destinationType == typeof(String))
|
||||||
return true;
|
return true;
|
||||||
return base.CanConvertTo(context, destinationType);
|
return base.CanConvertTo(context, destinationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context"></param>
|
/// <param name="context"></param>
|
||||||
/// <param name="culture"></param>
|
/// <param name="culture"></param>
|
||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
|
||||||
{
|
{
|
||||||
String state = value as String;
|
String state = value as String;
|
||||||
if (state == null)
|
if (state == null)
|
||||||
{
|
{
|
||||||
return base.ConvertFrom(context, culture, value);
|
return base.ConvertFrom(context, culture, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == String.Empty)
|
if (state == String.Empty)
|
||||||
{
|
{
|
||||||
return new ResourceCollection();
|
return new ResourceCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] parts = state.Split('&');
|
String[] parts = state.Split('&');
|
||||||
|
|
||||||
ResourceCollection collection = new ResourceCollection();
|
ResourceCollection collection = new ResourceCollection();
|
||||||
foreach (string encRes in parts)
|
foreach (string encRes in parts)
|
||||||
{
|
{
|
||||||
string[] props = Encoder.UrlDecode(encRes).Split('&');
|
string[] props = Encoder.UrlDecode(encRes).Split('&');
|
||||||
|
|
||||||
Resource r = new Resource();
|
Resource r = new Resource();
|
||||||
r.Name = Encoder.UrlDecode(props[0]);
|
r.Name = Encoder.UrlDecode(props[0]);
|
||||||
r.Value = Encoder.UrlDecode(props[1]);
|
r.Value = Encoder.UrlDecode(props[1]);
|
||||||
|
|
||||||
collection.Add(r);
|
collection.Add(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
return collection;
|
return collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context"></param>
|
/// <param name="context"></param>
|
||||||
/// <param name="culture"></param>
|
/// <param name="culture"></param>
|
||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
/// <param name="destinationType"></param>
|
/// <param name="destinationType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
|
||||||
{
|
{
|
||||||
if (destinationType == null)
|
if (destinationType == null)
|
||||||
throw new ArgumentException("destinationType");
|
throw new ArgumentException("destinationType");
|
||||||
ResourceCollection collection = value as ResourceCollection;
|
ResourceCollection collection = value as ResourceCollection;
|
||||||
|
|
||||||
if (collection == null)
|
if (collection == null)
|
||||||
{
|
{
|
||||||
return base.ConvertTo(context, culture, value, destinationType);
|
return base.ConvertTo(context, culture, value, destinationType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (collection.designMode)
|
if (collection.designMode)
|
||||||
{
|
{
|
||||||
return "(Collection)";
|
return "(Collection)";
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList al = new ArrayList();
|
ArrayList al = new ArrayList();
|
||||||
|
|
||||||
foreach (Resource r in collection)
|
foreach (Resource r in collection)
|
||||||
{
|
{
|
||||||
ArrayList properties = new ArrayList();
|
ArrayList properties = new ArrayList();
|
||||||
properties.Add(r.Name);
|
properties.Add(r.Name);
|
||||||
properties.Add(r.Value);
|
properties.Add(r.Value);
|
||||||
|
|
||||||
al.Add(Encoder.UrlEncode(properties));
|
al.Add(Encoder.UrlEncode(properties));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Encoder.UrlEncode(al);
|
return Encoder.UrlEncode(al);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,39 +1,39 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Options for the time format.
|
/// Options for the time format.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum TimeFormat
|
public enum TimeFormat
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 12-hours time format (e.g. 2 p.m.)
|
/// 12-hours time format (e.g. 2 p.m.)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Clock12Hours,
|
Clock12Hours,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 24-hours time format (e.g. 14:00)
|
/// 24-hours time format (e.g. 14:00)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Clock24Hours
|
Clock24Hours
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,40 @@
|
|||||||
/*
|
/*
|
||||||
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
Copyright <20> 2005 - 2008 Annpoint, s.r.o.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
Unless required by applicable law or agreed to in writing, software
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
NOTE: Reuse requires the following acknowledgement (see also NOTICE):
|
||||||
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
This product includes DayPilot (http://www.daypilot.org) developed by Annpoint, s.r.o.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace DayPilot.Web.Ui
|
namespace DayPilot.Web.Ui
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Summary description for UserActionHandling.
|
/// Summary description for UserActionHandling.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum UserActionHandling
|
public enum UserActionHandling
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// It should run a JavaScript action.
|
/// It should run a JavaScript action.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
JavaScript,
|
JavaScript,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// It should call a PostBack.
|
/// It should call a PostBack.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PostBack
|
PostBack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
18
app.config
18
app.config
@@ -1,10 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="DayPilot.Properties.Settings.bookingsConnectionString"
|
<add name="DayPilot.Properties.Settings.bookingsConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bookings.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
|
||||||
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\bookings.mdf;Integrated Security=True;User Instance=True"
|
</connectionStrings>
|
||||||
providerName="System.Data.SqlClient" />
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/></startup></configuration>
|
||||||
</connectionStrings>
|
|
||||||
</configuration>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user