Thanks again for your help with this. I had to leave this, but getting back to it now to try and get it working. I have modified my code below based on feedback and further trial and error.
As far as I can tell, this should work but can't get it to. The main problem seems to be 2 types of value in the class (in
LicCheck.cs) ie one which contains a lot of licensing information (
No_days), and trying to pass one part of this ie specifically the number of days left to another part of the class (
no_days), and then return this as an value (integer, double, etc), back to
Program.cs. This value will then be used to check on the number of days left.
Any suggestions/advice is much appreciated.
In LicCheck.cs class:
public class Lic
{
protected Manco.Licensing.License m_License;
private double no_days;
public Manco.Licensing.License No_days
{
get { return m_License; }
set
{
m_License = value;
int test = Convert.ToInt32(m_License.DaysLeft.TotalDays);
}
}
}
public class LicCheck : Lic
{
private double no_days;
public new double No_days
{
get { return no_days; }
set { no_days = Convert.ToInt32(m_License.DaysLeft.TotalDays); }
}
}
In Program.cs class:
static void Main()
{
LicCheck l1 = new LicCheck();
int x = Convert.ToInt32(l1.No_days);
}
[edit]fixed code formatting[/edit]