Exemple #1
0
        public IHttpActionResult PutMarquee(int id, Marquee marquee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != marquee.Id)
            {
                return(BadRequest());
            }

            db.Entry(marquee).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MarqueeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #2
0
        public async Task <IActionResult> PutMarquee(int id, Marquee marquee)
        {
            if (id != marquee.Id)
            {
                return(BadRequest());
            }

            _context.Entry(marquee).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MarqueeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #3
0
        public async Task <ActionResult <Marquee> > PostMarquee(Marquee marquee)
        {
            _context.Marquee.Add(marquee);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMarquee", new { id = marquee.Id }, marquee));
        }
Exemple #4
0
 private void buttonX2_Click(object sender, EventArgs e)
 {
     M.Stop();
     M.Dispose();
     M = null;
     Application.Exit();
 }
Exemple #5
0
        public TextDefil()
        {
            InitializeComponent();

            // Create timer to tick every 10ms
            _timer = new DispatcherTimer
            {
                Interval = TimeSpan.FromMilliseconds(500)
            };

            // Attach a Tick handler to do the scrolling
            _timer.Tick += delegate
            {
                // Flip direction if necessary
                if ((0 < Marquee.ViewportWidth) &&  // (NOOP if not visible yet)
                    ((Marquee.ScrollableWidth <= Marquee.HorizontalOffset) ||
                     (Marquee.HorizontalOffset <= 0)))
                {
                    _delta = -_delta;
                }

                // Adjust the horizontal offset
                Marquee.ScrollToHorizontalOffset(Marquee.HorizontalOffset + _delta);
            };

            // Start the timer
            _timer.Start();
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Marquee marquee = db.Marquees.Find(id);

            db.Marquees.Remove(marquee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 /// <summary>
 /// 跑马灯结束(本次所有文本显示结束)
 /// </summary>
 public void DestroyMarquee()
 {
     GameObject.Destroy(mMarqueeSc);
     GameObject.Destroy(mMarqueeSc.gameObject);
     mMarqueeSc         = null;
     mHasCreatedMarquee = false;
     mContentList.Clear();
 }
 public ActionResult Edit([Bind(Include = "Id,Location,Station")] Marquee marquee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(marquee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(marquee));
 }
Exemple #9
0
        public IHttpActionResult GetMarquee(int id)
        {
            Marquee marquee = db.Marquees.Find(id);

            if (marquee == null)
            {
                return(NotFound());
            }

            return(Ok(marquee));
        }
        public ActionResult Create([Bind(Include = "Id,Location,Station")] Marquee marquee)
        {
            if (ModelState.IsValid)
            {
                db.Marquees.Add(marquee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(marquee));
        }
Exemple #11
0
        public IHttpActionResult PostMarquee(Marquee marquee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Marquees.Add(marquee);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = marquee.Id }, marquee));
        }
Exemple #12
0
 public void ShowMarquee(string content)
 {
     if (!mHasCreatedMarquee)
     {
         mMarqueeSc = CreateMarquee(content);
         mMarqueeSc.InitMarquee(this);
         mHasCreatedMarquee = true;
     }
     mContentList.Add(content);
     if (!mMarqueeSc.IsShowing)
     {
         mMarqueeSc.StartMarquee();
     }
 }
        // GET: Marquees/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Marquee marquee = db.Marquees.Find(id);

            if (marquee == null)
            {
                return(HttpNotFound());
            }
            return(View(marquee));
        }
Exemple #14
0
        public IHttpActionResult DeleteMarquee(int id)
        {
            Marquee marquee = db.Marquees.Find(id);

            if (marquee == null)
            {
                return(NotFound());
            }

            db.Marquees.Remove(marquee);
            db.SaveChanges();

            return(Ok(marquee));
        }
Exemple #15
0
        public void MarqueeTest()
        {
            var canvas   = new Canvas(20, 10, '#');
            var graphics = new Graphics(canvas);

            var widget = new Marquee("demo");

            widget.Items = new string[] {
                "Four",
                "Five",
                "Nine"
            };

            widget.TextAlign = Align.Left;
            widget.Draw(graphics);

            Assert.Equal("┌──────────────────┐", canvas.Map[0]);
            Assert.Equal("│Four              │", canvas.Map[1]);
            Assert.Equal("│Five              │", canvas.Map[2]);
            Assert.Equal("│Nine              │", canvas.Map[3]);
            Assert.Equal("└──────────────────┘", canvas.Map[4]);
            Assert.Equal(5, canvas.Rows);

            canvas   = new Canvas(20, 10, '#');
            graphics = new Graphics(canvas);

            widget.TextAlign = Align.Center;
            widget.Draw(graphics);

            Assert.Equal("┌──────────────────┐", canvas.Map[0]);
            Assert.Equal("│       Four       │", canvas.Map[1]);
            Assert.Equal("│       Five       │", canvas.Map[2]);
            Assert.Equal("│       Nine       │", canvas.Map[3]);
            Assert.Equal("└──────────────────┘", canvas.Map[4]);
            Assert.Equal(5, canvas.Rows);

            canvas   = new Canvas(20, 10, '#');
            graphics = new Graphics(canvas);

            widget.TextAlign = Align.Right;
            widget.Draw(graphics);

            Assert.Equal("┌──────────────────┐", canvas.Map[0]);
            Assert.Equal("│              Four│", canvas.Map[1]);
            Assert.Equal("│              Five│", canvas.Map[2]);
            Assert.Equal("│              Nine│", canvas.Map[3]);
            Assert.Equal("└──────────────────┘", canvas.Map[4]);
            Assert.Equal(5, canvas.Rows);
        }
Exemple #16
0
    public static int constructor(IntPtr l)
    {
        int result;

        try
        {
            Marquee o = new Marquee();
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #17
0
        static void MarqueeSample()
        {
            var marquee = new Marquee("mar");

            marquee.Items = new string[] {
                "Hello World",
                "GoodBye World"
            };
            marquee.Margin.All      = 1;
            marquee.Padding.All     = 1;
            marquee.Border.Template = BorderTemplate.DOTTED;
            marquee.ForegroundColor = TWidgetColor.Blue;

            Player.Mount(marquee);

            Console.WriteLine("--END--");
        }
Exemple #18
0
    public static int get_SendTime(IntPtr l)
    {
        int result;

        try
        {
            Marquee marquee = (Marquee)LuaObject.checkSelf(l);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, marquee.SendTime);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #19
0
    public static int ToPBMarquee_s(IntPtr l)
    {
        int result;

        try
        {
            Marquee marquee;
            LuaObject.checkType <Marquee>(l, 1, out marquee);
            ProMarquee o = Marquee.ToPBMarquee(marquee);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #20
0
    public static int set_Title(IntPtr l)
    {
        int result;

        try
        {
            Marquee marquee = (Marquee)LuaObject.checkSelf(l);
            string  title;
            LuaObject.checkType(l, 2, out title);
            marquee.Title = title;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #21
0
    public static int set_Content(IntPtr l)
    {
        int result;

        try
        {
            Marquee marquee = (Marquee)LuaObject.checkSelf(l);
            string  content;
            LuaObject.checkType(l, 2, out content);
            marquee.Content = content;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #22
0
    public static int PBToMarquee_s(IntPtr l)
    {
        int result;

        try
        {
            ProMarquee pbMarquee;
            LuaObject.checkType <ProMarquee>(l, 1, out pbMarquee);
            Marquee o = Marquee.PBToMarquee(pbMarquee);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, o);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #23
0
    public static int set_SendTime(IntPtr l)
    {
        int result;

        try
        {
            Marquee  marquee = (Marquee)LuaObject.checkSelf(l);
            DateTime sendTime;
            LuaObject.checkValueType <DateTime>(l, 2, out sendTime);
            marquee.SendTime = sendTime;
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #24
0
        public void setMarquee()
        {
            string mt = "";

            using (WebClient wc = new WebClient())
            {
                try
                {
                    wc.Proxy       = null;
                    wc.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.NoCacheNoStore);
                    string dl = "http://p.ulse.net/marquee.php";
                    if (Account.currentAccount != null)
                    {
                        dl += "?n=" + Account.currentAccount.AccountName + "&p=" + Account.currentAccount.passHash;
                    }
                    mt = wc.DownloadString(dl);
                }
                catch (Exception) { }
            }
            mq = new Marquee(Game.game, new Rectangle(0, 120, Utils.getMX(1024), 35), mt, 150);
        }
Exemple #25
0
        public IntroWindow(BaseControl owner)
            : base(owner)
        {
            Font        = CtlCommon.SmFont;
            Width       = 590;
            Height      = 430;
            WindowStyle = new WindowStyles(WindowStyles.wsScreenCenter, WindowStyles.wsModal, WindowStyles.wsKeyPreview);
            Shifted     = false;
            BackDraw    = false;

            fMarquee = new Marquee(this);
            fMarquee.ActiveScroll = false;
            fMarquee.Font         = CtlCommon.SmFont;
            fMarquee.Left         = 10;
            fMarquee.Top          = 10;
            fMarquee.Width        = 570;
            fMarquee.Height       = 410;
            fMarquee.Visible      = true;
            fMarquee.OnMouseDown  = OnMarqueeMouseDown;
            fMarquee.TextColor    = Colors.Goldenrod;
        }
 void Skin_Initialized(object sender, EventArgs e)
 {
     uxSettings       = FindName("uxSettings") as Button;
     uxLeftTurn       = FindName("uxLeftTurn") as Blinker;
     uxRightTurn      = FindName("uxRightTurn") as Blinker;
     uxLowFuel        = FindName("uxLowFuel") as FrameworkElement;
     uxHazard         = FindName("uxHazard") as FrameworkElement;
     uxMalfunction    = FindName("uxMalfunction") as FrameworkElement;
     uxOpenDoor       = FindName("uxOpenDoor") as FrameworkElement;
     uxMessage        = FindName("uxMessage") as TextBlock;
     uxMessageMarquee = FindName("uxMessageMarquee") as Marquee;
     uxOdometer       = FindName("uxOdometer") as TextBlock;
     uxMPG            = FindName("uxMPG") as TextBlock;
     uxMPH            = FindName("uxMPH") as Slider;
     uxRPM            = FindName("uxRPM") as Slider;
     uxFuel           = FindName("uxFuel") as Slider;
     uxTemp           = FindName("uxTemp") as Slider;
     uxOil            = FindName("uxOil") as Slider;
     uxBattery        = FindName("uxBattery") as Slider;
     uxMPHLabel       = FindName("uxMPHLabel") as TextBlock;
     uxRPMLabel       = FindName("uxRPMLabel") as TextBlock;
 }
Exemple #27
0
        public Text(RegionOptions options) : base(options.Width, options.Height, options.Top, options.Left)
        {
            //NavigatedEventHandler handler = null;
            this._filePath        = options.Uri;
            this._direction       = options.direction ?? "left";
            this._backgroundImage = options.backgroundImage;
            this._backgroundColor = options.backgroundColor;
            //this._scaleFactor = options.ScaleFactor==0?3:options.ScaleFactor;
            //this._backgroundTop = options.BackgroundTop + "px";
            //this._backgroundLeft = options.BackgroundLeft + "px";
            //this._documentText = File.ReadAllText(_filePath);//options.text;
            //this._scrollSpeed = 50;//options.scrollSpeed;
            //this._headJavaScript = options.javaScript;
            //this._tempHtml = new TemporaryHtml();
            //this.GenerateHeadHtml();
            //this.GenerateBodyHtml();
            //this._webBrowser = new WebBrowser();
            //this._webBrowser.Height = options.Height;
            //this._webBrowser.Width = options.Width;
            //this._webBrowser.Margin = new Thickness(0.0, 0.0, 0.0, 0.0);
            //this._webBrowser.LoadCompleted += new LoadCompletedEventHandler(this.WebBrowserDocumentCompleted);
            //if (handler == null)
            //{
            //    handler =new NavigatedEventHandler((t,r)=>{
            //        this.HideScriptErrors(this._webBrowser, true);
            //    });
            //}
            //this._webBrowser.Navigated += handler;
            //this._webBrowser.Navigate(this._tempHtml.Path);
            //base.MediaCanvas.Children.Add(this._webBrowser);
            //Todo : Detect newlines and replace with tabs on horiz scroll
            var text = File.ReadAllText(_filePath).Replace("\n", " ").Replace("\r", " ") + "      ";

            // var text = "Welcome to this cool app Welcome to this cool app Welcome to this cool app Welcome to this cool app Welcome to this cool app ";
            //   text =
            //   "WELCOME TO THIS COOL APP WELCOME TO THIS COOL APP WELCOME TO THIS COOL APP WELCOME TO THIS COOL APP ";
            marquee = new Marquee();



            //    options.Height = options.Height/2;
            //   options.Width = options.Width/5;

            // Create the initial formatted text string.
            FormattedText formattedText = new FormattedText(
                text,
                CultureInfo.GetCultureInfo("en-us"),
                FlowDirection.LeftToRight,
                new Typeface("Arial"),
                options.Height,
                Brushes.Black);

            //// Set a maximum width and height. If the text overflows these values, an ellipsis "..." appears.
            //formattedText.MaxTextWidth = 300;
            //formattedText.MaxTextHeight = 240;

            marquee.MarqueeContent              = new TextBlock();
            marquee.Width                       = options.Width;
            marquee.Height                      = options.Height;
            marquee.MarqueeContent.Text         = text; //_marquee.MarqueeContent.ActualWidth.ToString();
            marquee.MarqueeContent.FontFamily   = new FontFamily("Arial");
            marquee.MarqueeContent.Height       = options.Height;
            marquee.MarqueeContent.FontSize     = options.Height;
            marquee.MarqueeContent.TextWrapping = TextWrapping.NoWrap;
            marquee.VerticalAlignment           = VerticalAlignment.Center;
            marquee.DesiredWidth                = options.Width;
            var dur = ((formattedText.Width / options.Height)) / 2; //1.2;

            //       (((options.Width)*options.Height) * text.Length)/
            //          211637
            ;
            marquee.Duration = new Duration(
                TimeSpan.FromSeconds(dur

                                     ));
            marquee.MarqueeContent.Foreground = System.Windows.Media.Brushes.Black;

            marquee.MarqueeContent.Background = System.Windows.Media.Brushes.LawnGreen;

            //     marquee.LeftToRight = true;
            //new SigMarquee()
            //      {Message = text, Font = new SigFont() {Size = options.Height}, Speed = 8, Interval=TimeSpan.FromSeconds(100)})
            //     {TextBanner = {TextWrapping = TextWrapping.NoWrap}, Height = options.Height, Width = options.Width};
            //marquee = new MarqueeText();
            //marquee.Background =System.Windows.Media.Brushes.Red;
            //marquee.MarqueeTimeInSeconds = options.Duration;
            //marquee.Foreground = System.Windows.Media.Brushes.Black;
            //marquee.MarqueeType = MarqueeType.RightToLeft; ;
            //marquee.MarqueeContent = File.ReadAllText(_filePath);
            base.MediaCanvas.Children.Add(this.marquee);
        }
Exemple #28
0
 public MarqueeMgr()
 {
     mHasCreatedMarquee = false;
     mMarqueeSc         = null;
     mContentList       = new List <string>();
 }
Exemple #29
0
 public void Save(Marquee obj)
 {
     dao.Save(obj);
 }
Exemple #30
0
 public void Delete(Marquee obj)
 {
     dao.Delete(obj);
 }