User Profile
Collapse
-
Sorry about the late response, I got tied up with a couple of other things. I think that I'm going to go with two collections one with the actual objects and then the other will contain the interfaces for the objects. Syncing shouldn't be a problem as the list will be static.... -
Correct, specifying teh getter means that it is read only. Which is what I want....Leave a comment:
-
Sorry. I forgot to add the getter. Does the following make it clearer:
...Code:public interface IRobotDeck { .. Collection<T> Positions where T: IDeckPosition {get;} int MyProperty {get;} }Leave a comment:
-
Yes, It inherits from the interface.
I have a visual control that I'll use to display the RobotDeck. This control will be in a different assembly, our controls assembly. I did not want to introduce a dependency to our manufacturing assembly.
I may just break out that control into its own assembly and live with the dependency....Leave a comment:
-
-
I get the same error "cannot convert type x to type y via built in conversion" whether the conversion is automatic or manual.Leave a comment:
-
The problem with that is that the following does not work:
The above throws an error that there is no automatic conversion between the two collections.Code:public class RobotDeck : IRobotDeck { private Collection<MyDeckPosition> _positions; public Collection<IDeckPosition> Positions { get return _positions;} }Leave a comment:
-
C# How to declare a generic property with a constraint?
I'm trying to declare a property that is a generic and has a constraint and having no luck. Is it possible?
I want something like the following:
Code:public interface IDeckPosition { ... } public interface IRobotDeck { ... Collection<T> Positions where T: IDeckPosition }
No activity results to display
Show More
Leave a comment: