Ejemplo n.º 1
0
        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();
 }
Ejemplo n.º 3
0
 /// <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));
     }
 }
Ejemplo n.º 4
0
 public static bool GetIsNormalScreen(this IScreenDim Dim)
 {
     if (Dim == null)
     {
         return(false);
     }
     else
     {
         return((Dim.Height == 24) && (Dim.Width == 80));
     }
 }
Ejemplo n.º 5
0
        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>();
 }
Ejemplo n.º 7
0
 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;
     }
 }
Ejemplo n.º 8
0
 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);
     }
 }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
 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);
     }
 }
Ejemplo n.º 12
0
 public ScreenDimModel(IScreenDim Dim)
 {
     this.Height = Dim.Height;
     this.Width  = Dim.Width;
 }
Ejemplo n.º 13
0
 public static string ToText(this IScreenDim Dim)
 {
     return("Height:" + Dim.Height + " Width:" + Dim.Width);
 }