----- Frans Bouma [C# MVP] wrote: -----
Richard said:
I have created a new class ServiceTimer based upon the .NET
System.Timers.Timer class. This has a new property
CollectionIntervalMinutes which I expected to be added to the
'Behavior' > section of the class properties and also to be available
as a 'Dynamic' > property so that I could control it from the
application config file. The > new property is not shown, but the
properties inherited from the base class > are.tried > creating the new class as both a standard class and a
component class. >> How should I declare properties in the new class
so that they are included > in 'Behavior' and ensure they are
available as 'Dynamic' properties?
It's perhaps wise to post your property's declaration, so we can see
which attributes you have applied to the property.
Also consider that VS.NET-related issues like the one you're having
are more at home in the vs.net related newsgroups.
FB
--
Get LLBLGen Pro, the new O/R mapper for .NET:
http://www.llblgen.com
My .NET Blog:
http://weblogs.asp.net/fbouma
Microsoft C# MVP
Sorry, bit of a newbie here. Not sure which VS newsgroup would be
appropriate.
My C# code is below, hope that helps.
============================================================================
==
using System;
using System.Timers;
using System.ComponentModel;
namespace EA_Read_Event_Logs_Service
{
/// <summary>
/// Summary description for ServiceTimer.
/// </summary>
public class ServiceTimer: System.Timers.Timer
{
public ServiceTimer()
{
//
// TODO: Add constructor logic here
//
}
public void ScheduleNext()
{
DateTime d1 = DateTime.Now;
Enabled = true;
Interval = (CollectionInterval * 60 * 1000) -
((((d1.Hour * 60) + d1.Minute) * 60 + d1.Second) * 1000 +
d1.Millisecond) % (CollectionInterval * 60 * 1000); }
/// <summary>
/// Interval between log collections, maximum value one day, units are
minutes /// </summary>
public double CollectionIntervalMinutes
{
get
{
return CollectionInterval;
}
set
{
if ((value <= 60 * 24) & (value > 0))
{
CollectionInterval = value;
}
else
{
throw new ArgumentOutOfRangeException("CollectionInterval", value,
"Collection Interval must be less than 1440 (1 day) and greater than 0");
}; }
}
/// <summary>
/// Minutes to wait between collections
/// </summary>
private double CollectionInterval = 60;
}
}