Exemple #1
0
        public override void Initialize()
        {
            ClassName = "slideshow";
            img = RootContext.CreateWidget<Image>();
            img.Id = "CurrentImage";
            nextImg = RootContext.CreateWidget<Image>();
            nextImg.SetClientElementStyle("display", "'none'");

            if (dataSource != null)
            {
                img.Url = dataSource[index].Url;
                img.InvokeClientMethod("FadeShow", "2000");
            }

            back = RootContext.CreateWidget<ImageButton>();
            forward = RootContext.CreateWidget<ImageButton>();
            back.Url = ThemeManager.Instance.RequestClientPath( "/Images/Back.png" );
            forward.Url = ThemeManager.Instance.RequestClientPath( "/Images/Forward.png" );
            back.OnClick += new EventHandler<ClickEventArgs>(back_OnClick);
            forward.OnClick += new EventHandler<ClickEventArgs>(forward_OnClick);
            //forward.SetClientElementStyle("float", "'right'");
            Add(img, nextImg, back, forward);
            TimerCallback tc = new TimerCallback(delegate(object o)
            {
                try
                {
                    rollImage();
                }
                catch { }
            });
            picTimer = new Timer(tc, null, interval, interval);
        }