Example #1
0
        public frmRoute(ScreenDimension win, CurrentDayRoute cdr)
        {
            Cdr = cdr;
            InitializeComponent();

            this.Text = win.WinTitle;
            this.Top = win.TopInt;
            this.Left = win.LeftInt;
            this.Height = win.HeightInt;
            this.Width = win.WidthInt;
            this.Tag = cdr.CDRRouteID;
            this.Name = cdr.CDRRouteID;

            lblDriverName.Text = cdr.CDRDriverLastName;
            txtDriverMessage.Text = cdr.CDRDriverMessage;
            {
                tooltipDriverMessage.AutoPopDelay = 5000;
                tooltipDriverMessage.InitialDelay = 1000;
                tooltipDriverMessage.ReshowDelay = 500;
                tooltipDriverMessage.ShowAlways = true;
                tooltipDriverMessage.IsBalloon = true;
                tooltipDriverMessage.SetToolTip(txtDriverMessage, cdr.CDRDriverMessage);
            }
        }
Example #2
0
        /// <summary>
        /// one of these should go away
        /// move to BLL and springify
        /// this one does not use XMLReader (i hope)
        /// </summary>
        public static void LoadScreenListFromXml()
#if true        
        {
            XmlReaderSettings settings = new XmlReaderSettings();
            XmlReader reader = default(XmlReader);
            settings.ConformanceLevel = ConformanceLevel.Fragment;
            settings.IgnoreWhitespace = true;
            settings.IgnoreComments = true;

            ////see Nunit test pp 99 
            ////this is what it used to be
            //// you have to test for scr.xml
            //// don't build for testing at the expense of needed functionality
            try
            {
                reader = XmlReader.Create(@"scr.xml");
            }
            catch
            {
                var sb = new StringBuilder();
                sb.AppendLine("The scr.xml file is missing or faulty");
                sb.AppendLine("Please create it ");
                sb.AppendLine(" by saving Screen Positions");
                MessageBox.Show(sb.ToString());
                return;
            }
            while (reader.Read())
            {
                switch (reader.Name)
                {
                    case "":
                        continue;
                    case "xml":
                        continue;
                    case "Screens":
                        continue;
                    case "Items":
                        continue;
                    case "Item":

                        var sd = new ScreenDimension();
                        var cvt = new System.ComponentModel.Int32Converter();

                        sd.WinTitle = reader.GetAttribute("Title");
                        sd.TopInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Top"));
                        sd.LeftInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Left"));
                        sd.WidthInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Width"));
                        sd.HeightInt = (int)cvt.ConvertFromString(
                                reader.GetAttribute("Height"));

                        ScreenList.Add(sd);
                        continue;
                    default:
                        break;
                }
            }
            reader.Close();

        }