Events, EventViewer, Common prjs, UI.EventLogs, UI.Calendar, EventTriggers, GetCalendarEvents() in WT/I.

This commit is contained in:
Milan Hanajik
2020-04-21 10:46:42 +02:00
parent 66631855bb
commit b1d692230e
161 changed files with 13377 additions and 933 deletions
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6CBC43B6-E950-49B2-B14A-563C50FCD5C3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Calendar4NET</RootNamespace>
<AssemblyName>Calendar</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Calendar.xml</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CalendarCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CalendarEvent.cs" />
<Compile Include="CustomEvent.cs" />
<Compile Include="CustomRecurringFunctionAttribute.cs" />
<Compile Include="EventComparer.cs" />
<Compile Include="EventDetailsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="EventDetailsForm.Designer.cs">
<DependentUpon>EventDetailsForm.cs</DependentUpon>
</Compile>
<Compile Include="EventToolTipCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="EventToolTipCtrl.Designer.cs">
<DependentUpon>EventToolTipCtrl.cs</DependentUpon>
</Compile>
<Compile Include="HolidayEvent.cs" />
<Compile Include="ICalendarEvent.cs" />
<Compile Include="NavigateLeftButtonCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="NavigateRightButtonCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RectangleComparer.cs" />
<Compile Include="Resources\Strings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
<Compile Include="RoundedRectangle.cs" />
<Compile Include="CoolButtonCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CoolButtonCtrl.Designer.cs">
<DependentUpon>CoolButtonCtrl.cs</DependentUpon>
</Compile>
<Compile Include="ScrollPanelCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ScrollPanelCtrl.Designer.cs">
<DependentUpon>ScrollPanelCtrl.cs</DependentUpon>
</Compile>
<Compile Include="TodayButtonCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="CalendarCtrl.resx">
<DependentUpon>CalendarCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CoolButtonCtrl.resx">
<DependentUpon>CoolButtonCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="EventDetailsForm.resx">
<DependentUpon>EventDetailsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="EventToolTipCtrl.resx">
<DependentUpon>EventToolTipCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NavigateLeftButtonCtrl.resx">
<DependentUpon>NavigateLeftButtonCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NavigateRightButtonCtrl.resx">
<DependentUpon>NavigateRightButtonCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources\Strings.cs.resx" />
<EmbeddedResource Include="Resources\Strings.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="ScrollPanelCtrl.resx">
<DependentUpon>ScrollPanelCtrl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TodayButtonCtrl.resx">
<DependentUpon>TodayButtonCtrl.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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>
File diff suppressed because it is too large Load Diff
+123
View File
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="_contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
+12
View File
@@ -0,0 +1,12 @@
using System;
using System.Drawing;
namespace TBF.UI.Calendar
{
internal class CalendarEventInstance
{
public Config.CalendarEvent.ICalendarEvent Event { get; set; }
public Rectangle EventArea { get; set; }
public DateTime Date { get; set; }
}
}
+400
View File
@@ -0,0 +1,400 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using NHibernate;
using Config.Entities;
using Config.CalendarEvent;
using Events.Entities;
using TBF.Resources;
using TBF.UiBridge;
namespace TBF.UI.Calendar
{
public partial class CalendarTabPageCtrl : UserControl
{
static readonly ILog log = LogManager.GetLogger(typeof(CalendarTabPageCtrl));
IList<ICalendarEvent> eventsFromComponents;
IList<CustomEvent> customEvents; /// Custom events loaded from the local config DB
Timer timer;
DateTime lastTimeCalendarEventsServed;
public CalendarTabPageCtrl()
{
InitializeComponent();
eventsFromComponents = new List<ICalendarEvent>();
Localize();
}
void Localize()
{
newEventButton.Text = Strings.New_event;
calendarEventsListViewEx.Columns.Add(Strings.Date_and_time, 100);
calendarEventsListViewEx.Columns.Add(Strings.Frequency, 70);
calendarEventsListViewEx.Columns.Add(Strings.Source, 50);
calendarEventsListViewEx.Columns.Add(Strings.Title, 200);
calendarEventsListViewEx.Columns.Add(Strings.Action);
calendarEventsListViewEx.Columns.Add(Strings.Parameters);
calendarEventsListViewEx.Columns.Add(Strings.On_exact_day);
calendarEventsListViewEx.Columns.Add(Strings.Read_only);
}
void AddOne(ICalendarEvent evnt)
{
ListViewItem lvi = new ListViewItem(evnt.Date.ToString(evnt.AllDay ? Constants.DateFormat : Constants.DateTimeFormat));
lvi.SubItems.Add(Config.CalendarEvent.Utils.Freq2String(evnt.Frequency));
lvi.SubItems.Add(evnt.Source);
lvi.SubItems.Add(evnt.Title);
lvi.SubItems.Add(Config.CalendarEvent.Utils.Action2String(evnt.AutoAction));
lvi.SubItems.Add(evnt.Parameters);
lvi.SubItems.Add(evnt.TriggerOnExactDayOnly ? Strings.yes : Strings.no);
lvi.SubItems.Add(evnt.ReadOnly ? Strings.yes : Strings.no);
lvi.Tag = evnt;
calendarEventsListViewEx.Items.Add(lvi);
}
public void StartCalendar(IList<ICalendarEvent> eventsFromComponents)
{
this.eventsFromComponents = eventsFromComponents;
try
{
/// Read custom events from the database
ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
customEvents = session.QueryOver<CustomEvent>().List();
TripplicateShiftCustomEvents(customEvents);
/// Calendar
foreach (var evnt in eventsFromComponents) calendarCtrl1.AddEvent(evnt);
foreach (var evnt in customEvents) calendarCtrl1.AddEvent(evnt);
/// List view in the right pane
calendarEventsListViewEx.Items.Clear();
foreach (var e in customEvents) AddOne(e);
foreach (var e in eventsFromComponents) if (!e.Hidden) AddOne(e);
/// Serve events (determine if any event was triggered)
lastTimeCalendarEventsServed = DateTime.Now;
ServeCalendarEventsNotifWarnErrorFatal(lastTimeCalendarEventsServed, session, customEvents);
}
catch (Exception)
{
customEvents = new List<CustomEvent>();
log.ErrorFormat("Failed to load custom events from the LOCAL config database");
}
calendarCtrl1.CalendarView = CalendarViews.Month;
timer = new System.Windows.Forms.Timer();
timer.Interval = 300000; /// 300000 ms = 300 s = 5 min
timer.Tick += new EventHandler(timer_Tick);
timer.Start();
}
/// <summary>
/// After StartCalendar() was called this function is invoked every 5 minutes
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void timer_Tick(object sender, EventArgs args)
{
DateTime currentTime = DateTime.Now;
if ((currentTime.Hour != lastTimeCalendarEventsServed.Hour) ||
(currentTime.Minute % 30) != (lastTimeCalendarEventsServed.Minute % 30))
{
/// Serve events at the beginning of each half hour
ServeCalendarEventsNotifWarnErrorFatal(currentTime);
lastTimeCalendarEventsServed = currentTime;
}
}
/// <summary>
/// Triggers events corresponding to triggered motification.warning/error calendar events.
/// </summary>
/// <param name="currentTime">Current time</param>
void ServeCalendarEventsNotifWarnErrorFatal(DateTime currentTime, ISession parentSession = null, IList<CustomEvent> customEventsFromDB = null)
{
IList<Events.Entities.Event> eventsToTrigger = new List<Events.Entities.Event>();
foreach (var calEvent in eventsFromComponents)
{
AutoAction a = calEvent.AutoAction;
if (a == AutoAction.Notification || a == AutoAction.Warning || a == AutoAction.Error || a == AutoAction.FatalErr)
{
if (Config.CalendarEvent.Utils.IsCalendarEventTrigerred(calEvent, currentTime))
{
eventsToTrigger.Add(new Events.Entities.Event(null,
calEvent.Source,
EventClass.Metrology,
ToSeverity(calEvent.AutoAction),
calEvent.Title,
calEvent.Parameters,
null,
SubscriberGroup.Metrology | SubscriberGroup.Maintenance |
SubscriberGroup.Production | SubscriberGroup.Management));
if (calEvent.Frequency == Frequency.Once)
{
eventsFromComponents.Remove(calEvent);
}
else
{
Config.CalendarEvent.Utils.UpdateRecurringDate(calEvent, currentTime);
}
}
}
}
try
{
var session = (parentSession != null) ? parentSession : Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
var customEvents = (customEventsFromDB != null) ? customEventsFromDB : session.QueryOver<CustomEvent>() .List();
foreach (var calEvent in customEvents)
{
AutoAction a = calEvent.AutoAction;
if (a == AutoAction.Notification || a == AutoAction.Warning || a == AutoAction.Error || a == AutoAction.FatalErr)
{
if (Config.CalendarEvent.Utils.IsCalendarEventTrigerred(calEvent, currentTime))
{
eventsToTrigger.Add(new Events.Entities.Event(null,
calEvent.Source,
EventClass.Undefined,
ToSeverity(calEvent.AutoAction),
calEvent.Title,
calEvent.Parameters,
null,
SubscriberGroup.Metrology | SubscriberGroup.Maintenance |
SubscriberGroup.Production | SubscriberGroup.Management));
if (calEvent.Frequency == Frequency.Once)
{
session.Delete(calEvent);
}
else if (calEvent.UpdateRecurringDate(currentTime))
{
session.SaveOrUpdate(calEvent);
}
}
}
}
session.Flush();
}
catch (Exception exc)
{
log.ErrorFormat("Failed to load or update CustomEvent-s in ServeTriggerEvtCalendarEvents(): {0}", exc.Message);
}
if (eventsToTrigger.Count > 0)
{
try
{
ISession session = global::Events.DB.CreateSession();
global::Events.DB.LoadSubscribers(session);
foreach (var e in eventsToTrigger)
{
TBF.UiBridge.Bridge.TriggerEvent(session, e);
}
session.Flush();
}
catch (Exception exc)
{
log.ErrorFormat("Failed to trigger events in ServeTriggerEvtCalendarEvents(): {0}", exc.Message);
}
}
}
/// <summary>
/// Returns an array of parameters of selected actions.
/// This function is not invoked from UI thread.
/// </summary>
/// <param name="selectedAction">Selected AutoAction</param>
/// <param name="maxCount">Max. number of calendar events served</param>
/// <returns>List of strings of triggered actions</returns>
public static IList<string> ServeCalendarEventsInvokeXY(AutoAction selectedAction, int maxCount = 1)
{
DateTime currentTime = DateTime.Now;
IList<string> parametersList = new List<string>();
if (maxCount <= 0) return parametersList;
try
{
ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
var customEventsFromDB = session.QueryOver<CustomEvent>().List();
foreach (var calEvent in customEventsFromDB)
{
if (calEvent.AutoAction == selectedAction && Config.CalendarEvent.Utils.IsCalendarEventTrigerred(calEvent, currentTime))
{
parametersList.Add(calEvent.Parameters);
if (calEvent.Frequency == Frequency.Once)
{
session.Delete(calEvent);
}
else if (calEvent.UpdateRecurringDate(currentTime))
{
session.SaveOrUpdate(calEvent);
}
if (parametersList.Count >= maxCount) break;
}
}
session.Flush();
}
catch (Exception exc)
{
log.ErrorFormat("Failed to load or update CustomEvent-s in ServeSelectedCalendarEvents(): {0}", exc.Message);
}
if (parametersList.Count > 0)
{
/// TODO: Invoke calendar redraw in UI thread
}
return parametersList;
}
/// <summary>
/// Convert calendar event AutoAction to event Severity
/// </summary>
/// <param name="action">AutoAction enum value</param>
/// <returns>Severity enum value</returns>
Events.Entities.Severity ToSeverity(AutoAction action)
{
switch (action)
{
default:
case AutoAction.Notification: return global::Events.Entities.Severity.Notification;
case AutoAction.Warning: return global::Events.Entities.Severity.Warning;
case AutoAction.Error: return global::Events.Entities.Severity.Error;
case AutoAction.FatalErr: return global::Events.Entities.Severity.FatalError;
}
}
void TripplicateShiftCustomEvents(IList<CustomEvent> customEvents)
{
/// Tripplicate each custom event with frequency 'EveryShift'
for (int i = customEvents.Count - 1; i >= 0; i--)
{
if (customEvents[i].Frequency == Frequency.EveryShift)
{
DateTime dt = customEvents[i].Date;
var ev2 = (CustomEvent)customEvents[i].Clone();
ev2.Date = new DateTime(dt.Year, dt.Month, dt.Day, (dt.Hour + 8) % 24, dt.Minute, 0);
ev2.ReadOnly = true;
customEvents.Insert(i + 1, ev2);
var ev3 = (CustomEvent)customEvents[i].Clone();
ev3.Date = new DateTime(dt.Year, dt.Month, dt.Day, (dt.Hour + 16) % 24, dt.Minute, 0);
ev3.ReadOnly = true;
customEvents.Insert(i + 2, ev3);
}
}
}
private void newEventButton_Click(object sender, EventArgs ea)
{
EventDetailsForm dlg = new EventDetailsForm();
if (dlg.ShowDialog() == DialogResult.OK && dlg.NewEvent is CustomEvent)
{
try
{
ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
session.SaveOrUpdate(dlg.NewEvent as CustomEvent);
session.Flush();
customEvents = session.QueryOver<CustomEvent>().List();
TripplicateShiftCustomEvents(customEvents);
/// Calendar
calendarCtrl1.ClearEvents();
foreach (var e in eventsFromComponents) calendarCtrl1.AddEvent(e);
foreach (var e in customEvents) calendarCtrl1.AddEvent(e);
/// List view in the right pane
calendarEventsListViewEx.Items.Clear();
foreach (var e in customEvents) AddOne(e);
foreach (var e in eventsFromComponents) if (!e.Hidden) AddOne(e);
}
catch (Exception)
{
log.ErrorFormat("Failed to save new calendar event to the local config database");
}
}
}
private void calendarEventsListViewEx_MouseDoubleClick(object sender, MouseEventArgs mea)
{
if (calendarEventsListViewEx.SelectedIndices.Count != 1) return;
CustomEvent evnt = calendarEventsListViewEx.SelectedItems[0].Tag as CustomEvent;
if (evnt == null || evnt.ReadOnly) return;
EventDetailsForm dlg = new EventDetailsForm { Event = evnt };
if (dlg.ShowDialog() != DialogResult.OK) return;
try
{
/// Re-read selected custom event from the database
ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
var cEvents = session.QueryOver<CustomEvent>()
.Where(x => (x.Id == evnt.Id))
.List();
if (cEvents.Count == 1)
{
cEvents[0].Date = dlg.NewEvent.Date;
cEvents[0].Frequency = dlg.NewEvent.Frequency;
cEvents[0].AllDay = dlg.NewEvent.AllDay;
cEvents[0].TriggerOnExactDayOnly = dlg.NewEvent.TriggerOnExactDayOnly;
cEvents[0].Source = dlg.NewEvent.Source;
cEvents[0].Title = dlg.NewEvent.Title;
cEvents[0].AutoAction = dlg.NewEvent.AutoAction;
cEvents[0].Parameters = dlg.NewEvent.Parameters;
cEvents[0].Rank = dlg.NewEvent.Rank;
cEvents[0].Hidden = dlg.NewEvent.Hidden;
cEvents[0].ReadOnly = dlg.NewEvent.ReadOnly;
cEvents[0].BackColor = dlg.NewEvent.BackColor;
cEvents[0].TextColor = dlg.NewEvent.TextColor;
cEvents[0].TooltipEnabled = dlg.NewEvent.TooltipEnabled;
cEvents[0].CustomRecurringFunction = null;
session.SaveOrUpdate(cEvents[0]);
session.Flush();
customEvents = session.QueryOver<CustomEvent>().List();
TripplicateShiftCustomEvents(customEvents);
/// Calendar
calendarCtrl1.ClearEvents();
foreach (var e in eventsFromComponents) calendarCtrl1.AddEvent(e);
foreach (var e in customEvents) calendarCtrl1.AddEvent(e);
/// List view in the right pane
calendarEventsListViewEx.Items.Clear();
foreach (var e in customEvents) AddOne(e);
foreach (var e in eventsFromComponents) if (!e.Hidden) AddOne(e);
}
}
catch (Exception)
{
MessageBox.Show("Cannot save change to the database", Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}
+157
View File
@@ -0,0 +1,157 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
namespace TBF.UI.Calendar
{
partial class CalendarTabPageCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CalendarTabPageCtrl));
this.logTextBox = new System.Windows.Forms.TextBox();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.calendarCtrl1 = new TBF.UI.Calendar.CalendarCtrl();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.newEventButton = new System.Windows.Forms.Button();
this.calendarEventsListViewEx = new Common.UIControls.ListViewEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// logTextBox
//
resources.ApplyResources(this.logTextBox, "logTextBox");
this.logTextBox.Name = "logTextBox";
//
// splitContainer1
//
resources.ApplyResources(this.splitContainer1, "splitContainer1");
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel1.Controls.Add(this.calendarCtrl1);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
//
// calendarCtrl1
//
this.calendarCtrl1.AllowEditingEvents = true;
this.calendarCtrl1.CalendarDate = new System.DateTime(2020, 3, 23, 22, 33, 35, 216);
this.calendarCtrl1.CalendarView = TBF.UI.Calendar.CalendarViews.Month;
this.calendarCtrl1.DateHeaderFont = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold);
this.calendarCtrl1.DayOfWeekFont = new System.Drawing.Font("Arial", 10F);
this.calendarCtrl1.DaysFont = new System.Drawing.Font("Arial", 10F);
this.calendarCtrl1.DayViewTimeFont = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold);
this.calendarCtrl1.DimDisabledEvents = true;
resources.ApplyResources(this.calendarCtrl1, "calendarCtrl1");
this.calendarCtrl1.HighlightCurrentDay = true;
this.calendarCtrl1.LoadPresetHolidays = false;
this.calendarCtrl1.Name = "calendarCtrl1";
this.calendarCtrl1.ShowArrowControls = true;
this.calendarCtrl1.ShowDashedBorderOnDisabledEvents = true;
this.calendarCtrl1.ShowDateInHeader = true;
this.calendarCtrl1.ShowDisabledEvents = false;
this.calendarCtrl1.ShowEventTooltips = true;
this.calendarCtrl1.ShowTodayButton = true;
this.calendarCtrl1.TodayFont = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold);
//
// splitContainer2
//
resources.ApplyResources(this.splitContainer2, "splitContainer2");
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.newEventButton);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.calendarEventsListViewEx);
//
// newEventButton
//
resources.ApplyResources(this.newEventButton, "newEventButton");
this.newEventButton.Name = "newEventButton";
this.newEventButton.UseVisualStyleBackColor = true;
this.newEventButton.Click += new System.EventHandler(this.newEventButton_Click);
//
// calendarEventsListViewEx
//
this.calendarEventsListViewEx.AllowColumnReorder = true;
resources.ApplyResources(this.calendarEventsListViewEx, "calendarEventsListViewEx");
this.calendarEventsListViewEx.DoubleClickActivation = false;
this.calendarEventsListViewEx.FullRowSelect = true;
this.calendarEventsListViewEx.GridLines = true;
this.calendarEventsListViewEx.Name = "calendarEventsListViewEx";
this.calendarEventsListViewEx.UseCompatibleStateImageBehavior = false;
this.calendarEventsListViewEx.View = System.Windows.Forms.View.Details;
this.calendarEventsListViewEx.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.calendarEventsListViewEx_MouseDoubleClick);
//
// CalendarTabPageCtrl
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Silver;
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.logTextBox);
this.Name = "CalendarTabPageCtrl";
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox logTextBox;
private System.Windows.Forms.SplitContainer splitContainer1;
private CalendarCtrl calendarCtrl1;
private System.Windows.Forms.Button newEventButton;
private System.Windows.Forms.SplitContainer splitContainer2;
private Common.UIControls.ListViewEx calendarEventsListViewEx;
}
}
+354
View File
@@ -0,0 +1,354 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="logTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>98, 249</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="logTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>2, 2, 2, 2</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="logTextBox.Multiline" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="logTextBox.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
<value>Both</value>
</data>
<data name="logTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>644, 420</value>
</data>
<data name="logTextBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;logTextBox.Name" xml:space="preserve">
<value>logTextBox</value>
</data>
<data name="&gt;&gt;logTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;logTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;logTextBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="splitContainer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="splitContainer1.IsSplitterFixed" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="splitContainer1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="calendarCtrl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="calendarCtrl1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="calendarCtrl1.Size" type="System.Drawing.Size, System.Drawing">
<value>600, 689</value>
</data>
<data name="calendarCtrl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;calendarCtrl1.Name" xml:space="preserve">
<value>calendarCtrl1</value>
</data>
<data name="&gt;&gt;calendarCtrl1.Type" xml:space="preserve">
<value>TBF.UI.Calendar.CalendarCtrl, TBF, Version=2.26.1446.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;calendarCtrl1.Parent" xml:space="preserve">
<value>splitContainer1.Panel1</value>
</data>
<data name="&gt;&gt;calendarCtrl1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel1.Name" xml:space="preserve">
<value>splitContainer1.Panel1</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel1.Parent" xml:space="preserve">
<value>splitContainer1</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="splitContainer2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="splitContainer2.IsSplitterFixed" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="splitContainer2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="splitContainer2.Orientation" type="System.Windows.Forms.Orientation, System.Windows.Forms">
<value>Horizontal</value>
</data>
<data name="newEventButton.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 15</value>
</data>
<data name="newEventButton.Size" type="System.Drawing.Size, System.Drawing">
<value>134, 39</value>
</data>
<data name="newEventButton.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="newEventButton.Text" xml:space="preserve">
<value>New custom event</value>
</data>
<data name="&gt;&gt;newEventButton.Name" xml:space="preserve">
<value>newEventButton</value>
</data>
<data name="&gt;&gt;newEventButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;newEventButton.Parent" xml:space="preserve">
<value>splitContainer2.Panel1</value>
</data>
<data name="&gt;&gt;newEventButton.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel1.Name" xml:space="preserve">
<value>splitContainer2.Panel1</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel1.Parent" xml:space="preserve">
<value>splitContainer2</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="calendarEventsListViewEx.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="calendarEventsListViewEx.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="calendarEventsListViewEx.Size" type="System.Drawing.Size, System.Drawing">
<value>361, 615</value>
</data>
<data name="calendarEventsListViewEx.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;calendarEventsListViewEx.Name" xml:space="preserve">
<value>calendarEventsListViewEx</value>
</data>
<data name="&gt;&gt;calendarEventsListViewEx.Type" xml:space="preserve">
<value>Common.UIControls.ListViewEx, Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;calendarEventsListViewEx.Parent" xml:space="preserve">
<value>splitContainer2.Panel2</value>
</data>
<data name="&gt;&gt;calendarEventsListViewEx.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel2.Name" xml:space="preserve">
<value>splitContainer2.Panel2</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel2.Parent" xml:space="preserve">
<value>splitContainer2</value>
</data>
<data name="&gt;&gt;splitContainer2.Panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="splitContainer2.Size" type="System.Drawing.Size, System.Drawing">
<value>361, 689</value>
</data>
<data name="splitContainer2.SplitterDistance" type="System.Int32, mscorlib">
<value>70</value>
</data>
<data name="splitContainer2.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;splitContainer2.Name" xml:space="preserve">
<value>splitContainer2</value>
</data>
<data name="&gt;&gt;splitContainer2.Type" xml:space="preserve">
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;splitContainer2.Parent" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;splitContainer2.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel2.Name" xml:space="preserve">
<value>splitContainer1.Panel2</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel2.Parent" xml:space="preserve">
<value>splitContainer1</value>
</data>
<data name="&gt;&gt;splitContainer1.Panel2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="splitContainer1.Size" type="System.Drawing.Size, System.Drawing">
<value>965, 689</value>
</data>
<data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
<value>600</value>
</data>
<data name="splitContainer1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;splitContainer1.Name" xml:space="preserve">
<value>splitContainer1</value>
</data>
<data name="&gt;&gt;splitContainer1.Type" xml:space="preserve">
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;splitContainer1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;splitContainer1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 8.25pt</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>965, 689</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>CalendarTabPageCtrl</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
@@ -0,0 +1,89 @@
using System;
using System.Drawing;
using Config.CalendarEvent;
namespace TBF.UI.Calendar
{
/// <summary>
/// An event that defines a calibration due date
/// </summary>
public class CalibrationDueDateEvent : ICalendarEvent
{
public DateTime Date { get; set; } /// The Date that the event occurs
public Frequency Frequency { get; set; } /// A value indicating how often the event occurs
public bool AllDay { get; set; } /// True if the time component of the date can be ignored
public bool TriggerOnExactDayOnly { get; set; } /// If this is a recurring event, set this to true to make the event show up only from the day specified forward
public string Source { get; set; } /// Source of this calendar event (becomes the source of the triggered event)
public string Title { get; set; } /// The name of the event (becomes the text of the triggered event)
public AutoAction AutoAction { get; set; } /// Automated action to be done or event to be triggered (becomes Severity)
public string Parameters { get; set; } /// Automated action parameters (e.g. name of a procedure to start)
public int Rank { get; set; } /// The ranking of the event that determines the order in which it is displayed on a particular day
public bool Hidden { get; set; } /// True if the event is enabled, otherwise false
public bool ReadOnly { get; set; } /// True if the event details cannot be modified
public int BackColor { get; set; } /// The color that the event show up in on the calendar: (MSB)AARRGGBB(LSB)
public int TextColor { get; set; } /// The text color of the event: (MSB)AARRGGBB(LSB)
public bool TooltipEnabled { get; set; } /// True if a tooltip should be displayed when hovering over the event
public Config.CalendarEvent.CustomRecurringFrequenciesHandler CustomRecurringFunction { get; set; }
/// <summary>
/// CalibrationDueEvent Constructor
/// </summary>
public CalibrationDueDateEvent()
{
/// Date
Frequency = Frequency.Once;
AllDay = true;
TriggerOnExactDayOnly = false;
/// Source
/// Text
AutoAction = AutoAction.Error;
Parameters = string.Empty;
Rank = 1;
Hidden = false;
ReadOnly = true;
BackColor = unchecked((int)0xFFA00000);
TextColor = unchecked((int)0xFFFFFFFF);
TooltipEnabled = true;
}
public CalibrationDueDateEvent(DateTime date, string source, string text)
: this()
{
Date = date;
Source = source;
Title = text;
}
public ICalendarEvent Clone()
{
return new CalibrationDueDateEvent
{
Date = this.Date,
Frequency = this.Frequency,
AllDay = this.AllDay,
TriggerOnExactDayOnly = this.TriggerOnExactDayOnly,
Source = this.Source,
Title = this.Title,
AutoAction = this.AutoAction,
Parameters = this.Parameters,
Rank = this.Rank,
Hidden = this.Hidden,
ReadOnly = this.ReadOnly,
BackColor = this.BackColor,
TextColor = this.TextColor,
TooltipEnabled = this.TooltipEnabled,
CustomRecurringFunction = this.CustomRecurringFunction,
};
}
public override string ToString()
{
if (string.IsNullOrEmpty(Source))
{
return Title;
}
return string.Format("{0}: {1}", Source, Title);
}
}
}
@@ -0,0 +1,89 @@
using System;
using System.Drawing;
using Config.CalendarEvent;
namespace TBF.UI.Calendar
{
/// <summary>
/// An event that defines a calibration reminder
/// </summary>
public class CalibrationReminderEvent : ICalendarEvent
{
public DateTime Date { get; set; } /// The Date that the event occurs
public Frequency Frequency { get; set; } /// A value indicating how often the event occurs
public bool AllDay { get; set; } /// True if the time component of the date can be ignored
public bool TriggerOnExactDayOnly { get; set; } /// If this is a recurring event, set this to true to make the event show up only from the day specified forward
public string Source { get; set; } /// Source of this calendar event (becomes the source of the triggered event)
public string Title { get; set; } /// The name of the event (becomes the text of the triggered event)
public AutoAction AutoAction { get; set; } /// Automated action to be done or event to be triggered (triggered event Severity)
public string Parameters { get; set; } /// Automated action parameters (e.g. name of a procedure to start)
public int Rank { get; set; } /// The ranking of the event that determines the order in which it is displayed on a particular day
public bool Hidden { get; set; } /// True if the event is enabled, otherwise false
public bool ReadOnly { get; set; } /// True if the event details cannot be modified
public int BackColor { get; set; } /// The color that the event show up in on the calendar: (MSB)AARRGGBB(LSB)
public int TextColor { get; set; } /// The text color of the event: (MSB)AARRGGBB(LSB)
public bool TooltipEnabled { get; set; } /// True if a tooltip should be displayed when hovering over the event
public Config.CalendarEvent.CustomRecurringFrequenciesHandler CustomRecurringFunction { get; set; }
/// <summary>
/// CalibrationReminderEvent Constructor
/// </summary>
public CalibrationReminderEvent(bool daily = false)
{
/// Date
Frequency = daily ? Frequency.Daily : Frequency.Weekly;
AllDay = true;
TriggerOnExactDayOnly = false;
/// Source
/// Text
AutoAction = daily ? AutoAction.Warning : AutoAction.Notification;
Parameters = string.Empty;
Rank = 1;
Hidden = true;
ReadOnly = true;
BackColor = unchecked((int)0xFFA00000);
TextColor = unchecked((int)0xFFFFFFFF);
TooltipEnabled = true;
}
public CalibrationReminderEvent(DateTime date, string source, string text, bool daily = false)
: this(daily)
{
Date = date;
Source = source;
Title = text;
}
public ICalendarEvent Clone()
{
return new CalibrationReminderEvent
{
Date = this.Date,
Frequency = this.Frequency,
AllDay = this.AllDay,
TriggerOnExactDayOnly = this.TriggerOnExactDayOnly,
Source = this.Source,
Title = this.Title,
AutoAction = this.AutoAction,
Parameters = this.Parameters,
Rank = this.Rank,
Hidden = this.Hidden,
ReadOnly = this.ReadOnly,
BackColor = this.BackColor,
TextColor = this.TextColor,
TooltipEnabled = this.TooltipEnabled,
CustomRecurringFunction = this.CustomRecurringFunction,
};
}
public override string ToString()
{
if (string.IsNullOrEmpty(Source))
{
return Title;
}
return string.Format("{0}: {1}", Source, Title);
}
}
}
@@ -0,0 +1,49 @@
using System;
namespace TBF.UI.Calendar
{
/// <summary>
/// An attribute to mark Custom Recurring Functions
/// </summary>
public class CustomRecurringFunction : Attribute
{
private readonly string _name;
private readonly string _description;
/// <summary>
/// Returns the name of the custom recurring function
/// </summary>
public string Name
{
get { return _name; }
}
/// <summary>
/// Returns a description of the custom recurring function
/// </summary>
public string Description
{
get { return _description; }
}
/// <summary>
/// CustomRecurringFunction Constructor
/// </summary>
/// <param name="name">The name of the function</param>
/// <param name="description">A description of the function</param>
public CustomRecurringFunction(string name, string description)
{
_name = name;
_description = description;
}
/// <summary>
/// CustomRecurringFunction Constructor
/// </summary>
/// <param name="name">The name of the function</param>
public CustomRecurringFunction(string name)
{
_name = name;
_description = "";
}
}
}
+23
View File
@@ -0,0 +1,23 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using Config.CalendarEvent;
namespace TBF.UI.Calendar
{
internal class EventComparer : IComparer<ICalendarEvent>
{
public int Compare(ICalendarEvent x, ICalendarEvent y)
{
int rslt;
if ((rslt = x.Rank.CompareTo(y.Rank)) != 0) return rslt;
if ((rslt = x.Date.Day.CompareTo(y.Date.Day)) != 0) return rslt;
if ((rslt = x.Date.Month.CompareTo(y.Date.Month)) != 0) return rslt;
if ((rslt = x.Date.Year.CompareTo(y.Date.Year)) != 0) return rslt;
if ((rslt = x.Date.Hour.CompareTo(y.Date.Hour)) != 0) return rslt;
if ((rslt = x.Date.Minute.CompareTo(y.Date.Minute)) != 0) return rslt;
return x.Rank.CompareTo(y.Rank);
}
}
}
+373
View File
@@ -0,0 +1,373 @@
namespace TBF.UI.Calendar
{
partial class EventDetailsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.txtEventTitle = new System.Windows.Forms.TextBox();
this.dateTimePicker = new System.Windows.Forms.DateTimePicker();
this.label2 = new System.Windows.Forms.Label();
this.basicsGroupBox = new System.Windows.Forms.GroupBox();
this.timeComboBox = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.txtEventSource = new System.Windows.Forms.TextBox();
this.chkHidden = new System.Windows.Forms.CheckBox();
this.recurringOptionsGroupBox = new System.Windows.Forms.GroupBox();
this.chkTriggerOnExactDayOnly = new System.Windows.Forms.CheckBox();
this.cbRecurringFrequency = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.appearanceGroupBox = new System.Windows.Forms.GroupBox();
this.chkEnableTooltip = new System.Windows.Forms.CheckBox();
this.pnlTextColor = new System.Windows.Forms.Panel();
this.label6 = new System.Windows.Forms.Label();
this.pnlEventColor = new System.Windows.Forms.Panel();
this.label5 = new System.Windows.Forms.Label();
this.fontDialog1 = new System.Windows.Forms.FontDialog();
this.okButton = new System.Windows.Forms.Button();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.cancelButton = new System.Windows.Forms.Button();
this.parametersGroupBox = new System.Windows.Forms.GroupBox();
this.autoActionComboBox = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.parametersTextBox = new System.Windows.Forms.TextBox();
this.basicsGroupBox.SuspendLayout();
this.recurringOptionsGroupBox.SuspendLayout();
this.appearanceGroupBox.SuspendLayout();
this.parametersGroupBox.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(67, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Event name:";
//
// txtEventName
//
this.txtEventTitle.Location = new System.Drawing.Point(120, 19);
this.txtEventTitle.Name = "txtEventName";
this.txtEventTitle.Size = new System.Drawing.Size(215, 20);
this.txtEventTitle.TabIndex = 1;
//
// dateTimePicker
//
this.dateTimePicker.CustomFormat = "dd.MM.yyyy dddd";
this.dateTimePicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePicker.Location = new System.Drawing.Point(120, 20);
this.dateTimePicker.Name = "dateTimePicker";
this.dateTimePicker.Size = new System.Drawing.Size(135, 20);
this.dateTimePicker.TabIndex = 2;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 23);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(76, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Date and time:";
//
// basicsGroupBox
//
this.basicsGroupBox.Controls.Add(this.label4);
this.basicsGroupBox.Controls.Add(this.txtEventSource);
this.basicsGroupBox.Controls.Add(this.label1);
this.basicsGroupBox.Controls.Add(this.txtEventTitle);
this.basicsGroupBox.Location = new System.Drawing.Point(12, 11);
this.basicsGroupBox.Name = "basicsGroupBox";
this.basicsGroupBox.Size = new System.Drawing.Size(349, 76);
this.basicsGroupBox.TabIndex = 4;
this.basicsGroupBox.TabStop = false;
this.basicsGroupBox.Text = "Basics";
//
// timeComboBox
//
this.timeComboBox.FormattingEnabled = true;
this.timeComboBox.Location = new System.Drawing.Point(261, 19);
this.timeComboBox.Name = "timeComboBox";
this.timeComboBox.Size = new System.Drawing.Size(74, 21);
this.timeComboBox.TabIndex = 8;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(10, 49);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(73, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Event source:";
//
// txtEventSource
//
this.txtEventSource.Location = new System.Drawing.Point(120, 46);
this.txtEventSource.Name = "txtEventSource";
this.txtEventSource.Size = new System.Drawing.Size(215, 20);
this.txtEventSource.TabIndex = 7;
//
// chkHidden
//
this.chkHidden.AutoSize = true;
this.chkHidden.Location = new System.Drawing.Point(29, 24);
this.chkHidden.Name = "chkHidden";
this.chkHidden.Size = new System.Drawing.Size(60, 17);
this.chkHidden.TabIndex = 4;
this.chkHidden.Text = "Hidden";
this.chkHidden.UseVisualStyleBackColor = true;
//
// recurringOptionsGroupBox
//
this.recurringOptionsGroupBox.Controls.Add(this.timeComboBox);
this.recurringOptionsGroupBox.Controls.Add(this.chkTriggerOnExactDayOnly);
this.recurringOptionsGroupBox.Controls.Add(this.cbRecurringFrequency);
this.recurringOptionsGroupBox.Controls.Add(this.label3);
this.recurringOptionsGroupBox.Controls.Add(this.label2);
this.recurringOptionsGroupBox.Controls.Add(this.dateTimePicker);
this.recurringOptionsGroupBox.Location = new System.Drawing.Point(12, 93);
this.recurringOptionsGroupBox.Name = "recurringOptionsGroupBox";
this.recurringOptionsGroupBox.Size = new System.Drawing.Size(349, 100);
this.recurringOptionsGroupBox.TabIndex = 5;
this.recurringOptionsGroupBox.TabStop = false;
this.recurringOptionsGroupBox.Text = "Time and Recurring Frequency";
//
// chkTriggerOnExactDayOnly
//
this.chkTriggerOnExactDayOnly.AutoSize = true;
this.chkTriggerOnExactDayOnly.Location = new System.Drawing.Point(29, 77);
this.chkTriggerOnExactDayOnly.Name = "chkTriggerOnExactDayOnly";
this.chkTriggerOnExactDayOnly.Size = new System.Drawing.Size(145, 17);
this.chkTriggerOnExactDayOnly.TabIndex = 2;
this.chkTriggerOnExactDayOnly.Text = "Trigger on exact day only";
this.chkTriggerOnExactDayOnly.UseVisualStyleBackColor = true;
//
// cbRecurringFrequency
//
this.cbRecurringFrequency.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbRecurringFrequency.FormattingEnabled = true;
this.cbRecurringFrequency.Location = new System.Drawing.Point(120, 47);
this.cbRecurringFrequency.Name = "cbRecurringFrequency";
this.cbRecurringFrequency.Size = new System.Drawing.Size(215, 21);
this.cbRecurringFrequency.TabIndex = 1;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 50);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(106, 13);
this.label3.TabIndex = 0;
this.label3.Text = "Recurring frequency:";
//
// appearanceGroupBox
//
this.appearanceGroupBox.Controls.Add(this.chkEnableTooltip);
this.appearanceGroupBox.Controls.Add(this.pnlTextColor);
this.appearanceGroupBox.Controls.Add(this.label6);
this.appearanceGroupBox.Controls.Add(this.pnlEventColor);
this.appearanceGroupBox.Controls.Add(this.chkHidden);
this.appearanceGroupBox.Controls.Add(this.label5);
this.appearanceGroupBox.Location = new System.Drawing.Point(12, 199);
this.appearanceGroupBox.Name = "appearanceGroupBox";
this.appearanceGroupBox.Size = new System.Drawing.Size(349, 75);
this.appearanceGroupBox.TabIndex = 6;
this.appearanceGroupBox.TabStop = false;
this.appearanceGroupBox.Text = "Appearance Settings";
//
// chkEnableTooltip
//
this.chkEnableTooltip.AutoSize = true;
this.chkEnableTooltip.Location = new System.Drawing.Point(29, 45);
this.chkEnableTooltip.Name = "chkEnableTooltip";
this.chkEnableTooltip.Size = new System.Drawing.Size(90, 17);
this.chkEnableTooltip.TabIndex = 7;
this.chkEnableTooltip.Text = "Enable tooltip";
this.chkEnableTooltip.UseVisualStyleBackColor = true;
//
// pnlTextColor
//
this.pnlTextColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlTextColor.Location = new System.Drawing.Point(266, 46);
this.pnlTextColor.Name = "pnlTextColor";
this.pnlTextColor.Size = new System.Drawing.Size(30, 15);
this.pnlTextColor.TabIndex = 6;
this.pnlTextColor.DoubleClick += new System.EventHandler(this.PnlTextColorDoubleClick);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(171, 46);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(89, 13);
this.label6.TabIndex = 5;
this.label6.Text = "Event Text Color:";
//
// pnlEventColor
//
this.pnlEventColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pnlEventColor.Location = new System.Drawing.Point(266, 22);
this.pnlEventColor.Name = "pnlEventColor";
this.pnlEventColor.Size = new System.Drawing.Size(30, 15);
this.pnlEventColor.TabIndex = 4;
this.pnlEventColor.DoubleClick += new System.EventHandler(this.PnlEventColorDoubleClick);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(171, 22);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 13);
this.label5.TabIndex = 3;
this.label5.Text = "Event Color:";
//
// fontDialog1
//
this.fontDialog1.ScriptsOnly = true;
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(182, 379);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(85, 42);
this.okButton.TabIndex = 7;
this.okButton.Text = "&OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Location = new System.Drawing.Point(276, 379);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(85, 42);
this.cancelButton.TabIndex = 8;
this.cancelButton.Text = "&Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// parametersGroupBox
//
this.parametersGroupBox.Controls.Add(this.autoActionComboBox);
this.parametersGroupBox.Controls.Add(this.label7);
this.parametersGroupBox.Controls.Add(this.parametersTextBox);
this.parametersGroupBox.Location = new System.Drawing.Point(12, 280);
this.parametersGroupBox.Name = "parametersGroupBox";
this.parametersGroupBox.Size = new System.Drawing.Size(349, 85);
this.parametersGroupBox.TabIndex = 9;
this.parametersGroupBox.TabStop = false;
this.parametersGroupBox.Text = "Triggered action and parameters";
//
// autoActionComboBox
//
this.autoActionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.autoActionComboBox.FormattingEnabled = true;
this.autoActionComboBox.Location = new System.Drawing.Point(120, 21);
this.autoActionComboBox.Name = "autoActionComboBox";
this.autoActionComboBox.Size = new System.Drawing.Size(215, 21);
this.autoActionComboBox.TabIndex = 5;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(10, 24);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(40, 13);
this.label7.TabIndex = 4;
this.label7.Text = "Action:";
//
// parametersTextBox
//
this.parametersTextBox.Location = new System.Drawing.Point(13, 51);
this.parametersTextBox.Name = "parametersTextBox";
this.parametersTextBox.Size = new System.Drawing.Size(322, 20);
this.parametersTextBox.TabIndex = 3;
//
// EventDetailsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(373, 432);
this.Controls.Add(this.parametersGroupBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.appearanceGroupBox);
this.Controls.Add(this.recurringOptionsGroupBox);
this.Controls.Add(this.basicsGroupBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "EventDetailsForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "EventDetails";
this.Load += new System.EventHandler(this.EventDetailsLoad);
this.basicsGroupBox.ResumeLayout(false);
this.basicsGroupBox.PerformLayout();
this.recurringOptionsGroupBox.ResumeLayout(false);
this.recurringOptionsGroupBox.PerformLayout();
this.appearanceGroupBox.ResumeLayout(false);
this.appearanceGroupBox.PerformLayout();
this.parametersGroupBox.ResumeLayout(false);
this.parametersGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtEventTitle;
private System.Windows.Forms.DateTimePicker dateTimePicker;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox basicsGroupBox;
private System.Windows.Forms.GroupBox recurringOptionsGroupBox;
private System.Windows.Forms.ComboBox cbRecurringFrequency;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox chkTriggerOnExactDayOnly;
private System.Windows.Forms.CheckBox chkHidden;
private System.Windows.Forms.GroupBox appearanceGroupBox;
private System.Windows.Forms.FontDialog fontDialog1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Panel pnlEventColor;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Panel pnlTextColor;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.CheckBox chkEnableTooltip;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.GroupBox parametersGroupBox;
private System.Windows.Forms.TextBox parametersTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtEventSource;
private System.Windows.Forms.ComboBox autoActionComboBox;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ComboBox timeComboBox;
}
}
+141
View File
@@ -0,0 +1,141 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
using Config.Entities;
using Config.CalendarEvent;
using TBF.Resources;
namespace TBF.UI.Calendar
{
internal partial class EventDetailsForm : Form
{
private ICalendarEvent evnt;
private ICalendarEvent newEvnt;
public ICalendarEvent Event
{
get { return evnt; }
set
{
evnt = value;
FillValues();
}
}
public ICalendarEvent NewEvent
{
get { return newEvnt; }
}
public EventDetailsForm()
{
InitializeComponent();
Text = Strings.Event_details;
for (Frequency f = Frequency.Once; f < Frequency.Count; f++)
{
cbRecurringFrequency.Items.Add(Config.CalendarEvent.Utils.Freq2String(f));
}
for (AutoAction a = AutoAction.None; a < AutoAction.Count; a++)
{
autoActionComboBox.Items.Add(Config.CalendarEvent.Utils.Action2String(a));
}
string[] times = { Strings.All_day,
"00:00", "00:30", "01:00", "01:30", "02:00", "02:30", "03:00", "03:30", "04:00", "04:30", "05:00", "05:30",
"06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30",
"12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30",
"18:00", "18:30", "19:00", "19:30", "20:00", "20:30", "21:00", "21:30", "22:00", "22:30", "23:00", "23:30" };
foreach (var s in times) timeComboBox.Items.Add(s);
}
private void EventDetailsLoad(object sender, EventArgs e)
{
if (evnt == null)
{
DateTime now = DateTime.Now;
Event = newEvnt = new Config.Entities.CustomEvent(new DateTime(now.Year, now.Month, now.Day, now.Hour, 30 * (now.Minute / 30), 0), Strings.New_event);
}
else
{
newEvnt = (CustomEvent)evnt.Clone();
}
}
private void FillValues()
{
txtEventTitle.Text = evnt.Title;
txtEventSource.Text = evnt.Source;
dateTimePicker.Value = evnt.Date;
timeComboBox.Text = evnt.AllDay ? Strings.All_day : evnt.Date.ToString("HH:mm");
cbRecurringFrequency.SelectedItem = Config.CalendarEvent.Utils.Freq2String(evnt.Frequency);
chkTriggerOnExactDayOnly.Checked = evnt.TriggerOnExactDayOnly;
chkHidden.Checked = evnt.Hidden;
autoActionComboBox.SelectedItem = Config.CalendarEvent.Utils.Action2String(evnt.AutoAction);
parametersTextBox.Text = evnt.Parameters;
pnlEventColor.BackColor = System.Drawing.Color.FromArgb(evnt.BackColor);
pnlTextColor.BackColor = System.Drawing.Color.FromArgb(evnt.TextColor);
chkEnableTooltip.Checked = evnt.TooltipEnabled;
}
private void okButton_Click(object sender, EventArgs e)
{
newEvnt.Title = txtEventTitle.Text;
newEvnt.Source = txtEventSource.Text;
newEvnt.Date = dateTimePicker.Value;
DateTime timeOnly;
if (timeComboBox.Text == Strings.All_day)
{
newEvnt.AllDay = true;
}
else if (DateTime.TryParse(timeComboBox.Text, out timeOnly))
{
newEvnt.AllDay = false;
newEvnt.Date = new DateTime(newEvnt.Date.Year, newEvnt.Date.Month, newEvnt.Date.Day, timeOnly.Hour, timeOnly.Minute, 0);
}
newEvnt.Hidden = chkHidden.Checked;
newEvnt.Frequency = Config.CalendarEvent.Utils.String2Freq(cbRecurringFrequency.SelectedItem.ToString());
newEvnt.TriggerOnExactDayOnly = chkTriggerOnExactDayOnly.Checked;
newEvnt.TooltipEnabled = chkEnableTooltip.Checked;
newEvnt.AutoAction = Config.CalendarEvent.Utils.String2Action(autoActionComboBox.SelectedItem.ToString());
newEvnt.Parameters = parametersTextBox.Text;
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void PnlEventColorDoubleClick(object sender, EventArgs e)
{
colorDialog1.Color = System.Drawing.Color.FromArgb(newEvnt.BackColor);
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
pnlEventColor.BackColor = colorDialog1.Color;
newEvnt.BackColor = colorDialog1.Color.ToArgb();
}
}
private void PnlTextColorDoubleClick(object sender, EventArgs e)
{
colorDialog1.Color = System.Drawing.Color.FromArgb(newEvnt.BackColor);
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
pnlTextColor.BackColor = colorDialog1.Color;
newEvnt.TextColor = colorDialog1.Color.ToArgb();
}
}
}
}
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="fontDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
</root>
+48
View File
@@ -0,0 +1,48 @@
namespace TBF.UI.Calendar
{
partial class EventToolTipCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// EventToolTip
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Transparent;
this.DoubleBuffered = true;
this.Name = "EventToolTip";
this.Load += new System.EventHandler(this.EventToolTipLoad);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.EventToolTipPaint);
this.ResumeLayout(false);
}
#endregion
}
}
+179
View File
@@ -0,0 +1,179 @@
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace TBF.UI.Calendar
{
internal partial class EventToolTipCtrl : UserControl
{
private Color _eventToolTipColor;
private Color _eventToolTipTextColor;
private Color _eventToolTipBorderColor;
private Font _eventToolTipFont;
private bool _shouldRender;
private string _eventToolTipText;
private Margin _eventToolTipMargins;
public Margin EventToolTipMargins
{
get { return _eventToolTipMargins; }
set
{
_eventToolTipMargins = value;
Refresh();
}
}
public string EventToolTipText
{
get { return _eventToolTipText; }
set
{
_eventToolTipText = value;
Refresh();
}
}
public bool ShouldRender
{
get { return _shouldRender; }
set
{
_shouldRender = value;
Refresh();
}
}
public Font EventToolTipFont
{
get { return _eventToolTipFont; }
set
{
_eventToolTipFont = value;
Refresh();
}
}
public Color EventToolTipBorderColor
{
get { return _eventToolTipBorderColor; }
set
{
_eventToolTipBorderColor = value;
Refresh();
}
}
public Color EventToolTipTextColor
{
get { return _eventToolTipTextColor; }
set
{
_eventToolTipTextColor = value;
Refresh();
}
}
public Color EventToolTipColor
{
get { return _eventToolTipColor; }
set
{
_eventToolTipColor = value;
Refresh();
}
}
public EventToolTipCtrl()
{
InitializeComponent();
_shouldRender = false;
_eventToolTipBorderColor = Color.Black;
_eventToolTipColor = Color.Yellow;
_eventToolTipFont = new Font("Arial", 10, FontStyle.Regular);
_eventToolTipText = "";
_eventToolTipTextColor = Color.Black;
_eventToolTipMargins = new Margin { Top = 10, Right = 10, Bottom = 10, Left = 10 };
}
private void EventToolTipLoad(object sender, EventArgs e)
{
}
public Size CalculateSize()
{
Graphics g = CreateGraphics();
SizeF textSize = g.MeasureString(_eventToolTipText, _eventToolTipFont);
Size = new Size((int)textSize.Width + _eventToolTipMargins.Left + _eventToolTipMargins.Right,
(int)textSize.Height + _eventToolTipMargins.Top + _eventToolTipMargins.Bottom);
g.Dispose();
return Size;
}
private void EventToolTipPaint(object sender, PaintEventArgs e)
{
if (!_shouldRender)
return;
SizeF textSize = e.Graphics.MeasureString(_eventToolTipText, _eventToolTipFont);
Size = new Size((int)textSize.Width + _eventToolTipMargins.Left + _eventToolTipMargins.Right,
(int)textSize.Height + _eventToolTipMargins.Top + _eventToolTipMargins.Bottom);
var bmp = new Bitmap(ClientSize.Width, ClientSize.Height);
Graphics g = Graphics.FromImage(bmp);
GraphicsPath gp = Common.UIControls.RoundedRectangle.Create(0, 0, ClientSize.Width - 1, ClientSize.Height - 1, 5,
Common.UIControls.RoundedRectangle.RectangleCorners.All);
BackColor = Color.Transparent;
g.FillPath(new SolidBrush(_eventToolTipColor), gp);
g.DrawPath(new Pen(_eventToolTipBorderColor), gp);
int totHorMargin = _eventToolTipMargins.Left + _eventToolTipMargins.Right;
int totVerMargin = _eventToolTipMargins.Top + _eventToolTipMargins.Bottom;
g.DrawString(_eventToolTipText, _eventToolTipFont, new SolidBrush(_eventToolTipTextColor),
(ClientSize.Width - textSize.Width + totHorMargin) / 2f - _eventToolTipMargins.Right,
(ClientSize.Height - textSize.Height + totVerMargin) / 2f - _eventToolTipMargins.Bottom - 1);
e.Graphics.DrawImage(bmp, 0, 0);
gp.Dispose();
g.Dispose();
bmp.Dispose();
}
}
internal class Margin
{
public int Left
{
get;
set;
}
public int Right
{
get;
set;
}
public int Top
{
get;
set;
}
public int Bottom
{
get;
set;
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+76
View File
@@ -0,0 +1,76 @@
using System;
using System.Drawing;
using Config.CalendarEvent;
namespace TBF.UI.Calendar
{
/// <summary>
/// An event that defines a holiday
/// </summary>
public class HolidayEvent : ICalendarEvent
{
public DateTime Date { get; set; }
public Frequency Frequency { get; set; }
public bool AllDay { get; set; }
public bool TriggerOnExactDayOnly { get; set; }
public string Source { get; set; }
public string Title { get; set; }
public AutoAction AutoAction { get; set; }
public string Parameters { get; set; }
public int Rank { get; set; }
public bool Hidden { get; set; }
public bool ReadOnly { get; set; }
public int BackColor { get; set; }
public int TextColor { get; set; }
public bool TooltipEnabled { get; set; }
public Config.CalendarEvent.CustomRecurringFrequenciesHandler CustomRecurringFunction { get; set; }
/// <summary>
/// HolidayEvent Constructor
/// </summary>
public HolidayEvent()
{
/// Date
Frequency = Frequency.Once;
AllDay = true;
TriggerOnExactDayOnly = true;
Source = "Calendar";
/// Text
AutoAction = AutoAction.None;
Parameters = string.Empty;
Rank = 1;
Hidden = false;
ReadOnly = true;
BackColor = unchecked((int)0xFF50AAFF);
TextColor = unchecked((int)0xFFFFFFFF);
TooltipEnabled = true;
}
public ICalendarEvent Clone()
{
return new HolidayEvent
{
Date = this.Date,
Frequency = this.Frequency,
AllDay = this.AllDay,
TriggerOnExactDayOnly = this.TriggerOnExactDayOnly,
Source = this.Source,
Title = this.Title,
AutoAction = this.AutoAction,
Parameters = this.Parameters,
Rank = this.Rank,
Hidden = this.Hidden,
ReadOnly = this.ReadOnly,
BackColor = this.BackColor,
TextColor = this.TextColor,
TooltipEnabled = this.TooltipEnabled,
CustomRecurringFunction = this.CustomRecurringFunction,
};
}
public override string ToString()
{
return Title;
}
}
}
+24
View File
@@ -0,0 +1,24 @@
namespace TBF.UI.Calendar
{
internal class NavigateLeftButtonCtrl : Common.UIControls.CoolButtonCtrl
{
public NavigateLeftButtonCtrl()
{
Size = new System.Drawing.Size(42, 29);
ButtonText = "<";
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// NavigateLeftButton
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.DoubleBuffered = true;
this.Name = "NavigateLeftButton";
this.ResumeLayout(false);
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,24 @@
namespace TBF.UI.Calendar
{
internal class NavigateRightButtonCtrl : Common.UIControls.CoolButtonCtrl
{
public NavigateRightButtonCtrl()
{
Size = new System.Drawing.Size(42, 29);
ButtonText = ">";
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// NavigateRightButton
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.DoubleBuffered = true;
this.Name = "NavigateRightButton";
this.ResumeLayout(false);
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+13
View File
@@ -0,0 +1,13 @@
using System.Collections.Generic;
using System.Drawing;
namespace TBF.UI.Calendar
{
public class RectangleComparer : IComparer<Rectangle>
{
public int Compare(Rectangle x, Rectangle y)
{
return x.Y.CompareTo(y.Y);
}
}
}
+52
View File
@@ -0,0 +1,52 @@
namespace TBF.UI.Calendar
{
partial class ScrollPanelCtrl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// ScrollPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.DoubleBuffered = true;
this.Name = "ScrollPanel";
this.Size = new System.Drawing.Size(280, 242);
this.Load += new System.EventHandler(this.ScrollPanel_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.ScrollPanel_Paint);
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.ScrollPanel_MouseClick);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ScrollPanel_MouseDown);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.ScrollPanel_MouseMove);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ScrollPanel_MouseUp);
this.ResumeLayout(false);
}
#endregion
}
}
+100
View File
@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace TBF.UI.Calendar
{
internal partial class ScrollPanelCtrl : UserControl
{
private int _scrollOffset;
private bool _mouseDown;
private Point _oldMouseCoords;
private int _bmpSize;
[DllImport("user32.dll")]
static extern short GetKeyState(int nVirtKey);
public event MouseEventHandler RightButtonClicked;
public ScrollPanelCtrl()
{
InitializeComponent();
_scrollOffset = 0;
_mouseDown = false;
_oldMouseCoords = new Point(0, 0);
}
public int ScrollOffset
{
get { return _scrollOffset; }
}
private void ScrollPanel_Load(object sender, EventArgs e)
{
//BackColor = Color.Blue;
}
private void ScrollPanel_Paint(object sender, PaintEventArgs e)
{
var c = (CalendarCtrl)Parent;
Bitmap bmp = c.RequestImage();
if (bmp == null)
return;
e.Graphics.DrawImage(bmp, new Rectangle(0, 0, ClientSize.Width, ClientSize.Height),
new Rectangle(0, _scrollOffset, ClientSize.Width, ClientSize.Height),
GraphicsUnit.Pixel);
_bmpSize = bmp.Height;
//e.Graphics.Dispose();
bmp.Dispose();
}
private void ScrollPanel_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
_mouseDown = true;
_oldMouseCoords = e.Location;
}
}
private void ScrollPanel_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
_mouseDown = false;
}
private void ScrollPanel_MouseMove(object sender, MouseEventArgs e)
{
if (_mouseDown && e.Location.Y < _oldMouseCoords.Y && _scrollOffset < _bmpSize - _scrollOffset - ClientSize.Height)
{
int offset = _oldMouseCoords.Y - e.Location.Y;
_scrollOffset += offset;
Refresh();
}
if (_mouseDown && e.Location.Y > _oldMouseCoords.Y && _scrollOffset > 0)
{
int offset = e.Location.Y - _oldMouseCoords.Y;
_scrollOffset -= offset;
Refresh();
}
_oldMouseCoords = e.Location;
}
private void ScrollPanel_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (RightButtonClicked != null)
RightButtonClicked(sender, e);
}
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+26
View File
@@ -0,0 +1,26 @@
using TBF.Resources;
namespace TBF.UI.Calendar
{
internal class TodayButtonCtrl : Common.UIControls.CoolButtonCtrl
{
public TodayButtonCtrl()
{
Size = new System.Drawing.Size(72, 29);
ButtonText = Strings.Today;
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// TodayButton
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.DoubleBuffered = true;
this.Name = "TodayButton";
this.ResumeLayout(false);
}
}
}
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>