T
tony
Hello!
I access the class MyComparer in this way.
steel_post.Sort(new MeltPracDataComposition.Composition.MyComparer());
You can see the class definition for MyComparer below.
As you can see this class MyComparer in located withing class Composition
and this
class Composition is located within class MeltPracDataComposition.
Now to my problem if I use the default which I thing is internal on the
class definition for class MyComparer I get this compile error.
C:\PK\Development\Products\UTCAS\4.0\SRC\MeltPracApplication\Dialog\Composit
ionForm.cs(456):
'MeltPracData.MeltPracDataComposition.Composition.MyComparer' is
inaccessible due to its protection level
But if I prefix the class MyComparer with the keword internal I don't get
any compile error.
As I have understood is the default on class definition always internal so
if that is the case
I wouldn't have got these compile errors when using the default.
Can somebody explain why I got compile error when using the default
especially when
the default is internal and when using the internal I don't get any compile
errors.
public class MeltPracDataComposition : MeltPracData
{
public class Composition : IComparable
{
...
class MyComparer : IComparer
{
region IComparer Members
public int Compare(object x, object y)
{
return
((Composition)x).Order.CompareTo(((Composition)y).Order );
}
#endregion
}// end class MyComparer
}// end class Composition
}//end class MeltPracDataComposition
//Tony
I access the class MyComparer in this way.
steel_post.Sort(new MeltPracDataComposition.Composition.MyComparer());
You can see the class definition for MyComparer below.
As you can see this class MyComparer in located withing class Composition
and this
class Composition is located within class MeltPracDataComposition.
Now to my problem if I use the default which I thing is internal on the
class definition for class MyComparer I get this compile error.
C:\PK\Development\Products\UTCAS\4.0\SRC\MeltPracApplication\Dialog\Composit
ionForm.cs(456):
'MeltPracData.MeltPracDataComposition.Composition.MyComparer' is
inaccessible due to its protection level
But if I prefix the class MyComparer with the keword internal I don't get
any compile error.
As I have understood is the default on class definition always internal so
if that is the case
I wouldn't have got these compile errors when using the default.
Can somebody explain why I got compile error when using the default
especially when
the default is internal and when using the internal I don't get any compile
errors.
public class MeltPracDataComposition : MeltPracData
{
public class Composition : IComparable
{
...
class MyComparer : IComparer
{
region IComparer Members
public int Compare(object x, object y)
{
return
((Composition)x).Order.CompareTo(((Composition)y).Order );
}
#endregion
}// end class MyComparer
}// end class Composition
}//end class MeltPracDataComposition
//Tony