public static Size ToCanvasDim(this IScreenDim Dim, Size charBoxDim) { var x = charBoxDim.Width * Dim.Width; var y = charBoxDim.Height * Dim.Height; return(new Size(x, y)); }
public void Apply( string ScreenName, string NamespaceName, string ScreenGuid, IScreenDim ScreenDim, IEnumerable<IScreenItem> ModelItems) { this.ScreenName = ScreenName; this.NamespaceName = NamespaceName; this.ScreenGuid = ScreenGuid; this.ScreenDim = ScreenDim; this.ModelItems = ModelItems.ToObservableCollection(); }
/// <summary> /// screen dimensions are either wide screen, 27x132 or not 24x80. /// </summary> public static bool GetIsWideScreen(this IScreenDim Dim) { if (Dim == null) { return(false); } else { return((Dim.Height == 27) && (Dim.Width == 132)); } }
public static bool GetIsNormalScreen(this IScreenDim Dim) { if (Dim == null) { return(false); } else { return((Dim.Height == 24) && (Dim.Width == 80)); } }
public ScreenDefn( string ScreenName, string NamespaceName, string ScreenGuid, IScreenDim ScreenDim, IEnumerable <IScreenItem> Items) { this.ScreenName = ScreenName; this.NamespaceName = NamespaceName; this.ScreenGuid = ScreenGuid; this.ScreenDim = ScreenDim; this.Items = new List <IScreenItem>(); this.LoadItems(Items); }
public WorkScreenDefnModel( ActionCode? WorkMode, string ScreenName, string NamespaceName, IScreenDim ScreenDim, IEnumerable<IScreenItem> Items) { this.WorkMode = WorkMode; this.ScreenName = ScreenName; this.NamespaceName = NamespaceName; this.ScreenDim = new ScreenDimModel(ScreenDim); if (Items != null) this.ModelItems = Items.ToObservableCollection(); else this.ModelItems = new ObservableCollection<IScreenItem>(); }
public static void SetIsWideScreen(this IScreenDim Dim, bool IsWide) { if (IsWide == true) { Dim.Height = 27; Dim.Width = 132; } else { Dim.Height = 24; Dim.Width = 80; } }
public static XElement ToXElement(this IScreenDim Dim, XName Name) { if (Dim == null) { return(new XElement(Name, null)); } else { XElement xe = new XElement(Name, new XElement("Height", Dim.Height), new XElement("Width", Dim.Width) ); return(xe); } }
public ScreenDefnModel( string ScreenName, string NamespaceName, string ScreenGuid, IScreenDim ScreenDim, IEnumerable <IScreenItem> Items) { this.ScreenName = ScreenName; this.NamespaceName = NamespaceName; this.ScreenGuid = ScreenGuid; this.ScreenDim = new ScreenDimModel(ScreenDim); // create the ObservableCollection of item models from the list of items of // the ScreenDefn. this.Items = new ObservableCollection <IScreenItem>(); var jj = from a in Items select ScreenItemModel.Factory(a) as IScreenItem; this.LoadItems(jj); }
public static IScreenDim ToScreenDim( this XElement Elem, XNamespace Namespace) { IScreenDim dim = null; if (Elem != null) { dim = new ScreenDim(); dim.Height = Elem.Element(Namespace + "Height").IntOrDefault(0).Value; dim.Width = Elem.Element(Namespace + "Width").IntOrDefault(0).Value; } else { dim = new ScreenDim(24, 80); } return(dim); }
public static bool CompareEquals(this IScreenDim Value1, IScreenDim Value2) { if ((Value1 == null) && (Value2 == null)) { return(true); } else if ((Value1 == null) || (Value2 == null)) { return(false); } else if (Value1.Height != Value2.Height) { return(false); } else if (Value1.Width != Value2.Width) { return(false); } else { return(true); } }
public ScreenDimModel(IScreenDim Dim) { this.Height = Dim.Height; this.Width = Dim.Width; }
public static string ToText(this IScreenDim Dim) { return("Height:" + Dim.Height + " Width:" + Dim.Width); }