Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WidgetPlatform
- {
- public Widget LeftmostWidget { get; set; }
- public Widget RightmostWidget { get; set; }
- public String GetWidgetNames()
- {
- return LeftmostWidget.Name + " " + RightmostWidget.Name;
- }
- }
- public class WidgetPlatform
- {
- [Required]
- public Widget LeftmostWidget { get; set; }
- [Required]
- public Widget RightmostWidget { get; set; }
- public String GetWidgetNames()
- {
- return LeftmostWidget.Name + " " + RightmostWidget.Name;
- }
- }
- public class WidgetPlatform
- {
- public Widget LeftmostWidget { get; set; }
- public Widget RightmostWidget { get; set; }
- public WidgetPlatform()
- {
- this.LeftMostWidget = new Widget();
- this.RightMostWidget = new Widget();
- }
- public WidgetPlatform(Widget left, Widget right)
- {
- if(left == null || right == null)
- throw new ArgumentNullException("Eeep!");
- this.LeftMostWidget = left;
- this.RightMostWidget = right;
- }
- public String GetWidgetNames()
- {
- return LeftmostWidget.Name + " " + RightmostWidget.Name;
- }
- }
- public class WidgetPlatform
- {
- public Widget LeftWidget
- {
- get;
- private set;
- }
- public Widget RightWidget
- {
- get;
- private set;
- }
- WidgetPlatForm(Widget w1, Widget w2)
- {
- if (w1 == null || w2 == null)
- throw new ArgumentException();
- this.LeftWidget = w1;
- this.RightWidget = w2;
- }
- // Etc
- }
- public class WidgetPlatform
- {
- /// <summary>
- /// Hide the constructor.
- /// </summary>
- private WidgetPlatform(Widget left, Widget right)
- {
- this.LeftmostWidget = left;
- this.RightmostWidget = right;
- }
- public Widget LeftmostWidget
- {
- get;
- private set;
- }
- public Widget RightmostWidget
- {
- get;
- private set;
- }
- public static WidgetPlatform GetInstance(Widget left, Widget right)
- {
- return new WidgetPlatform(left, right);
- }
- }
Add Comment
Please, Sign In to add comment