public void AddTtem(Image i, int index)
 {
     TileItem newTile = new TileItem();
     //First Frame - Image only
     TileItemFrame logoDXFrame = new TileItemFrame();
     TileItemElement logoEl = new TileItemElement();
     logoEl.Image = i;                                                                       //dien logo doi bong
     logoEl.ImageScaleMode = TileItemImageScaleMode.Stretch;
     logoDXFrame.Elements.Add(logoEl);
     logoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
     //Second Frame - Text only
     TileItemFrame mottoDXFrame = new TileItemFrame();
     TileItemElement mottoEl = new TileItemElement();
     mottoEl.Text = "<Size=+2><Color=Sienna><b>" + (dtTeam.Rows[index]["Name"]).ToString() + "</b></Color></Size>"; //dien ten doi bong
     mottoEl.TextAlignment = TileItemContentAlignment.MiddleCenter;
     mottoDXFrame.Elements.Add(mottoEl);
     mottoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
     //Global Tile Item Settings
     newTile.Frames.Add(logoDXFrame);
     newTile.Frames.Add(mottoDXFrame);
     newTile.Appearance.BackColor = System.Drawing.Color.WhiteSmoke;
     //newTile.Appearance.BackColor2 = System.Drawing.Color.SandyBrown;
     newTile.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal;
     newTile.Appearance.BorderColor = System.Drawing.Color.Bisque;
     //newTile.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
     newTile.FrameAnimationInterval = 2500;
     newTile.ItemSize = TileItemSize.Medium;
        // newTile.AppearanceItem.Pressed.BackColor = Color.Black;
     tileControl1.Groups.Add(new TileGroup());
     tileControl1.Groups[0].Items.Add(newTile);
     newTile.StartAnimation();
     newTile.Name = (dtTeam.Rows[index]["TeamID"]).ToString();
     newTile.ItemClick += newTile_ItemClick;
     newTile.ItemDoubleClick += newTile_ItemDoubleClick;
 }
        private void contentGenerate_Click(object sender, EventArgs e)
        {
            TileItem newTile = new TileItem();
            //First Frame - Image only
            TileItemFrame   logoDXFrame = new TileItemFrame();
            TileItemElement logoEl      = new TileItemElement();

            logoEl.Image = global::WinTileItemCodeCreating.Properties.Resources.DXv2Logo_small; logoEl.ImageAlignment = TileItemContentAlignment.MiddleCenter;
            logoDXFrame.Elements.Add(logoEl);
            logoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
            //Second Frame - Text only
            TileItemFrame   mottoDXFrame = new TileItemFrame();
            TileItemElement mottoEl      = new TileItemElement();

            mottoEl.Text          = "<Size=+2><Color=Sienna><b>Let's see what develops.</b></Color></Size>";
            mottoEl.TextAlignment = TileItemContentAlignment.MiddleCenter;
            mottoDXFrame.Elements.Add(mottoEl);
            mottoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
            //Global Tile Item Settings
            newTile.Frames.Add(logoDXFrame);
            newTile.Frames.Add(mottoDXFrame);
            newTile.Appearance.BackColor    = System.Drawing.Color.Bisque;
            newTile.Appearance.BackColor2   = System.Drawing.Color.SandyBrown;
            newTile.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal;
            newTile.Appearance.BorderColor  = System.Drawing.Color.Bisque;
            newTile.AllowHtmlText           = DevExpress.Utils.DefaultBoolean.True;
            newTile.FrameAnimationInterval  = 2500;
            newTile.IsLarge = true;
            tileControl1.Groups.Add(new TileGroup());
            tileControl1.Groups[0].Items.Add(newTile);
            newTile.StartAnimation();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 创建天气Tile控件(该接口不准确,停用)
        /// </summary>
        /// <param name="str"></param>
        private void CreateWeatherTile2(string str)
        {
            var t = new Tile();

            //t.Click += new TileClickEventHandler(moreTile_Click);
            t.Group = "热门推荐";

            tileContainer.Items.Add(t);

            try
            {
                dynamic obj = Newtonsoft.Json.JsonConvert.DeserializeObject(str);

                //frame #1
                TileItemFrame frameOne = new TileItemFrame();
                frameOne.Appearance.Font = new System.Drawing.Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);

                TileItemElement elemHigh = new TileItemElement();
                var             low      = obj.weatherinfo.temp1.ToString();
                var             high     = obj.weatherinfo.temp2.ToString();
                elemHigh.Text          = string.Format("{0} ~ {1}", low, high);
                elemHigh.TextAlignment = TileItemContentAlignment.TopLeft;
                frameOne.Elements.Add(elemHigh);

                TileItemElement elemtype = new TileItemElement();
                elemtype.Text = obj.weatherinfo.weather.ToString();
                elemtype.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 18.0f, System.Drawing.GraphicsUnit.Point);
                elemtype.TextAlignment          = TileItemContentAlignment.MiddleCenter;
                elemtype.Image = Utils.ImageFrom(string.Format("http://www.weather.com.cn/m/i/weatherpic/29x20/{0}", obj.weatherinfo.img1.ToString()));
                elemtype.ImageOptions.ImageAlignment = TileItemContentAlignment.TopRight;
                frameOne.Elements.Add(elemtype);

                TileItemElement elemCity = new TileItemElement();
                elemCity.Text          = obj.weatherinfo.city.ToString();
                elemCity.TextAlignment = TileItemContentAlignment.BottomLeft;
                frameOne.Elements.Add(elemCity);


                TileItemElement elemDate = new TileItemElement();
                elemDate.Text          = string.Format("{0} {1}", DateTime.Today.ToString("M月d日"), DateUtils.DayOfWeek(DateTime.Today));
                elemDate.TextAlignment = TileItemContentAlignment.BottomRight;
                frameOne.Elements.Add(elemDate);

                frameOne.Interval  = 5000;
                frameOne.Animation = TileItemContentAnimationType.ScrollDown;

                t.Frames.Add(frameOne);
            }
            catch (Exception)
            {
                TileItemFrame tileFrameTmp = new TileItemFrame();
                tileFrameTmp.Elements.Add(new TileItemElement()
                {
                    Text = "天气获取失败", TextAlignment = TileItemContentAlignment.MiddleCenter
                });
                tileFrameTmp.Appearance.Font = new Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);
                t.Frames.Add(tileFrameTmp);
                //throw;
            }
        }
Exemplo n.º 4
0
        private void InititalizeFrames(TileItem item, ProjectInfo info)
        {
            item.Frames.Clear();

            for (int i = 1; i <= 4; i++)
            {
                TileItemFrame frame = new TileItemFrame();
                frame.Animation = GetRandomAnimationType();
                frame.Interval  = GetRandomAnimationInterval();
                TileItemElement elemText  = CreateBottomTextElement(info.Name);
                TileItemElement elemCount = CreateFileCountElement(info.FileCount);
                TileItemElement elemImage = new TileItemElement();

                elemImage.ImageScaleMode = TileItemImageScaleMode.ZoomOutside;
                elemImage.Image          = GetProjectThumb(info, i);

                frame.Elements.Add(elemText);
                frame.Elements.Add(elemCount);
                frame.Elements.Add(elemImage);

                item.Frames.Add(frame);
            }
            item.ResetSuperTip();
            if (!string.IsNullOrEmpty(info.Description))
            {
                var tooltip = new DevExpress.Utils.SuperToolTip();
                tooltip.Items.Add(info.Description);
                item.SuperTip = tooltip;
            }
        }
Exemplo n.º 5
0
        private void CrateTileElement(TileItemElement element, Tile tile, TileItemContentAnimationType animationType = TileItemContentAnimationType.ScrollDown)
        {
            TileItemFrame dxFrame = new TileItemFrame();

            dxFrame.Elements.Add(element);
            dxFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
            dxFrame.Animation = animationType;
            tile.Frames.Add(dxFrame);
        }
Exemplo n.º 6
0
        //
        //Tile Time
        void setTile()
        {
            frDate = new TileItemFrame();
            itDate = new TileItemElement();
            itDate.TextAlignment = TileItemContentAlignment.MiddleCenter;
            frDate.Elements.Add(itDate);
            frDate.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;

            frTime = new TileItemFrame();
            itTime = new TileItemElement();
            itTime.TextAlignment = TileItemContentAlignment.MiddleCenter;
            frTime.Elements.Add(itTime);
            frTime.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
            tileTime.Frames.Add(frDate);
            tileTime.Frames.Add(frTime);
        }
Exemplo n.º 7
0
        private TileItem CreateTile(IMenuItem menuItem)
        {
            string caption = string.Format("{0} {1}", menuItem.Caption,
                                           menuItem.Plugin.Shortcut != null
                    ? string.Format("[{0}]", menuItem.Plugin.Shortcut)
                    : string.Empty);
            //Text Frame
            var textFrame   = new TileItemFrame();
            var textElement = new TileItemElement
            {
                Text           = string.Format("<Size=+1><Color=White><b>{0}</b></Color></Size>", caption),
                Image          = _menuItemImageHandler.GetImage(menuItem),
                ImageAlignment = TileItemContentAlignment.TopLeft,
                TextAlignment  = TileItemContentAlignment.BottomCenter
            };

            textFrame.Elements.Add(textElement);
            textFrame.Elements[0].AnimateTransition = DefaultBoolean.True;
            textFrame.UseImage               = true;
            textFrame.UseBackgroundImage     = true;
            textFrame.UseText                = true;
            textFrame.AnimateBackgroundImage = false;
            textFrame.AnimateImage           = false;
            textFrame.AnimateText            = false;

            //Create new tile
            var tile = new TileItem {
                Name = menuItem.Caption, Tag = menuItem
            };

            tile.Frames.Add(textFrame);
            tile.Appearance.ForeColor              = Color.Gray;
            tile.Appearance.BackColor              = Color.White;
            tile.Appearance.BackColor2             = Color.Gray;
            tile.Appearance.GradientMode           = LinearGradientMode.ForwardDiagonal;
            tile.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
            tile.ImageAlignment         = TileItemContentAlignment.MiddleCenter;
            tile.AllowHtmlText          = DefaultBoolean.True;
            tile.FrameAnimationInterval = 6000;

            if (TileClickEventHandler != null)
            {
                tile.ItemClick += TileClickEventHandler;
            }

            return(tile);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 创建实时热搜榜tile控件
        /// </summary>
        private async void CreateHotSearch()
        {
            var tile = new Tile();

            tile.Properties.ItemSize = TileItemSize.Large;
            tile.Group  = "热门推荐";
            tile.Click += HotSearchClick;
            tileContainer.Items.Add(tile);

            await Task.Run(() =>
            {
                var dt   = Spider.GetHotTable();
                tile.Tag = dt;//利用tag字段保存数据表
                for (int i = 0; i < dt.Rows.Count && i < 10; i++)
                {
                    TileItemFrame tileFrame = new TileItemFrame();
                    tileFrame.Interval      = 3000;

                    TileItemElement elemTitle        = new TileItemElement();
                    elemTitle.Text                   = dt.Rows[i][0].ToString();
                    elemTitle.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 15.0f, System.Drawing.GraphicsUnit.Point);
                    elemTitle.TextAlignment          = TileItemContentAlignment.MiddleCenter;
                    tileFrame.Elements.Add(elemTitle);

                    TileItemElement elemCount = new TileItemElement();
                    elemCount.Text            = string.Format("热度:{0}", dt.Rows[i][1]);
                    //elemTitle.Appearance.Normal.Font=new
                    elemCount.TextAlignment = TileItemContentAlignment.BottomRight;
                    tileFrame.Elements.Add(elemCount);

                    TileItemElement elemType = new TileItemElement();
                    elemType.Text            = "微博实时热搜榜";
                    //elemType.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);
                    elemType.TextAlignment = TileItemContentAlignment.BottomLeft;
                    tileFrame.Elements.Add(elemType);

                    TileItemElement elemIndex        = new TileItemElement();
                    elemIndex.Text                   = string.Format("No.{0}", i + 1);
                    elemIndex.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 13.0f, System.Drawing.GraphicsUnit.Point);
                    elemIndex.TextAlignment          = TileItemContentAlignment.TopLeft;
                    tileFrame.Elements.Add(elemIndex);

                    tile.Frames.Add(tileFrame);
                }
            });
        }
Exemplo n.º 9
0
        void windowsUIView_QueryControl(object sender, QueryControlEventArgs e)
        {
            BaseModule module = e.Document.Tag is BaseModule ? (BaseModule)e.Document.Tag :
                                Activator.CreateInstance(typeof(frmMain).Assembly.GetType(e.Document.ControlTypeName)) as BaseModule;

            module.InitModule(barManager1, windowsUIView);
            BaseTile tile = null;

            if (windowsUIView.Tiles.TryGetValue(e.Document, out tile))
            {
                TileItemFrame frame = tile.CurrentFrame;
                object        data  = current ?? ((frame != null) ? frame.Tag : null);
                module.ShowModule(data);
            }
            e.Document.Tag = module;
            e.Control      = module;
        }
Exemplo n.º 10
0
        void CreateAnimation(Tile tile)
        {
            TileItem newTile = new TileItem();

            //First Frame - Image only
            if (tile.Name == "开始收银")
            {
                TileItemFrame   logoDXFrame = new TileItemFrame();
                TileItemElement logoEl      = new TileItemElement();
                logoEl.Image          = ((Image)(resources.GetObject(tile.Name)));
                logoEl.ImageScaleMode = TileItemImageScaleMode.Stretch;
                logoEl.ImageAlignment = TileItemContentAlignment.MiddleCenter;
                logoDXFrame.Elements.Add(logoEl);
                logoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
                logoDXFrame.Animation = TileItemContentAnimationType.SegmentedFade;
                tile.Frames.Add(logoDXFrame);
                //Second Frame - Text only
                TileItemFrame   mottoDXFrame = new TileItemFrame();
                TileItemElement mottoEl      = new TileItemElement();
                mottoEl.Text          = "<Size=+24><Color=Sienna><b>葡萄科技</b></Color></Size>";
                mottoEl.TextAlignment = TileItemContentAlignment.MiddleCenter;
                mottoDXFrame.Elements.Add(mottoEl);
                mottoDXFrame.Animation = TileItemContentAnimationType.RandomSegmentedFade;
                mottoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True;
                //Global Tile Item Settings
                tile.Frames.Add(mottoDXFrame);
                tile.Properties.AllowHtmlDraw          = DevExpress.Utils.DefaultBoolean.True;
                tile.Properties.FrameAnimationInterval = 3000;
                tileContainer.AllowAnimation(tile, true);
            }
            else if (tile.Name == "销售查询")
            {
                CrateTileElement(new TileItemElement
                {
                    Image          = ((Image)(resources.GetObject(tile.Name))),
                    ImageScaleMode = TileItemImageScaleMode.Stretch,
                    ImageAlignment = TileItemContentAlignment.MiddleCenter
                }, tile);
                CrateTileElement(new TileItemElement
                {
                    Image          = ((Image)(resources.GetObject(tile.Name))),
                    ImageScaleMode = TileItemImageScaleMode.Stretch,
                    ImageAlignment = TileItemContentAlignment.MiddleCenter
                }, tile, TileItemContentAnimationType.RandomSegmentedFade);
            }
        }
Exemplo n.º 11
0
        void windowsUIView_TileClick(object sender, TileClickEventArgs e)
        {
            Tile tile = e.Tile as Tile;

            if (tile != null && tile.Document != null)
            {
                BaseModule module = tile.Document.Control as BaseModule;
                if (module != null)
                {
                    TileItemFrame frame = tile.CurrentFrame;
                    object        data  = (frame != null) ? frame.Tag : null;
                    module.ShowModule(data);
                }
                if (tile.ActivationTarget == page)
                {
                    page.Document = tile.Document;
                    page.Caption  = tile.Elements[0].Text;
                }
            }
        }
Exemplo n.º 12
0
        public static void InitZillowTile(ITileItem tile)
        {
            TileItemFrame info = new TileItemFrame();

            info.AnimateImage = true;
            info.AnimateText  = true;
            info.UseImage     = true;
            info.UseText      = true;
            info.Image        = global::DevExpress.RealtorWorld.Win.Properties.Resources.zillow_logo;
            info.Text         = string.Empty;
            tile.Frames.Add(info);
            info              = new TileItemFrame();
            info.AnimateText  = true;
            info.AnimateImage = true;
            info.Image        = null;
            info.Text         = "<size=+2>Your <b>Edge</b> in <b>Real Estate</b>";
            info.UseImage     = true;
            info.UseText      = true;
            tile.Frames.Add(info);
        }
Exemplo n.º 13
0
        public static void InitAgentsTile(ITileItem tile, int size)
        {
            tile.Properties.FrameAnimationInterval   = 5100;
            tile.Properties.BackgroundImageAlignment = TileItemContentAlignment.MiddleRight;
            tile.Properties.BackgroundImageScaleMode = TileItemImageScaleMode.NoScale;

            foreach (Agent agent in DataHelper.Agents)
            {
                TileItemFrame info = new TileItemFrame();
                info.AnimateBackgroundImage = true;
                info.UseBackgroundImage     = true;
                info.BackgroundImage        = GetScaleImage(agent.Photo, 90);

                info.AnimateText = true;
                info.UseText     = true;
                info.Text        = string.Format("<size=+4>{0} {1}</size><br>{2}", agent.FirstName, agent.LastName, agent.Phone);
                info.Tag         = agent;
                tile.Frames.Add(info);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 创建实时话题榜Tile控件
        /// </summary>
        private async void CreateHotTopic()
        {
            var tile = new Tile();

            tile.Group  = "热门推荐";
            tile.Click += HotTopicClick;
            tileContainer.Items.Add(tile);

            await Task.Run(() =>
            {
                var hotTopic = Spider.GetTopicList();
                tile.Tag     = hotTopic;
                for (int i = 0; i < hotTopic.Count && i < 15; i++)
                {
                    TileItemFrame tileFrame = new TileItemFrame();
                    tileFrame.Interval      = 5000;

                    TileItemElement elemTitle        = new TileItemElement();
                    elemTitle.Text                   = hotTopic[i];
                    elemTitle.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 15.0f, System.Drawing.GraphicsUnit.Point);
                    elemTitle.TextAlignment          = TileItemContentAlignment.MiddleCenter;
                    tileFrame.Elements.Add(elemTitle);

                    TileItemElement elemType = new TileItemElement();
                    elemType.Text            = "微博实时话题榜";
                    //elemType.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);
                    elemType.TextAlignment = TileItemContentAlignment.BottomLeft;
                    tileFrame.Elements.Add(elemType);

                    TileItemElement elemIndex        = new TileItemElement();
                    elemIndex.Text                   = string.Format("No.{0}", i + 1);
                    elemIndex.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 13.0f, System.Drawing.GraphicsUnit.Point);
                    elemIndex.TextAlignment          = TileItemContentAlignment.TopLeft;
                    tileFrame.Elements.Add(elemIndex);

                    tile.Frames.Add(tileFrame);
                }
            });
        }
Exemplo n.º 15
0
        public static void InitListingsTile(ITileItem tile)
        {
            bool animateText = true;

            foreach (Home home in DataHelper.Homes)
            {
                animateText = true;
                foreach (Image photo in home.Photos)
                {
                    TileItemFrame info = new TileItemFrame();
                    info.AnimateBackgroundImage = true;
                    info.UseBackgroundImage     = true;
                    info.BackgroundImage        = photo;
                    info.AnimateText            = animateText;
                    info.UseText = true;
                    info.Text2   = string.Format("<backcolor=108,189,69> {0} Beds   <br> {1} Baths  ", home.BedsString, home.BathsString);
                    info.Text3   = string.Format("<backcolor=108,189,69><size=+3> {0} ", home.PriceString);
                    info.Tag     = home;
                    animateText  = false;
                    tile.Frames.Add(info);
                }
            }
        }
Exemplo n.º 16
0
        void CreateTile(string name,string id,int tiletype)
        {
            TileItem newTile = new TileItem();
            //The first frame - Image only 
            TileItemFrame logoDXFrame = new TileItemFrame();
            logoDXFrame.UseImage = true;
            logoDXFrame.UseText = true;
            logoDXFrame.AnimateImage = true;
            logoDXFrame.AnimateText = true;
            var logoEl = new TileItemElement();
            if (id == "0")
                logoEl.Image = Properties.Resources.logout_icon;
            if(id=="1")
                logoEl.Image = Properties.Resources.packing;
            if (id == "2")
                logoEl.Image = Properties.Resources.shopping_trolley;
            if (id == "3")
                logoEl.Image = Properties.Resources.inventory;
            if (id == "4")
                logoEl.Image = Properties.Resources.skills_icon;
            logoEl.Text = "name";
            logoEl.ImageAlignment = TileItemContentAlignment.MiddleCenter;

            logoDXFrame.Elements.Add(logoEl);
            TileItemFrame mottoDXFrame = new TileItemFrame();
            TileItemElement mottoEl = new TileItemElement();
            mottoEl.Text = "<Size=+3><Color=white><b>Let's see what develops.</b></Color></Size>";
            mottoDXFrame.Elements.Add(mottoEl);
            mottoDXFrame.UseImage = true;
            mottoDXFrame.UseText = true;
            mottoDXFrame.AnimateImage = true;
            mottoDXFrame.AnimateText = true;
            //Global Tile Item Settings 
            newTile.Frames.Add(logoDXFrame);
            newTile.Frames.Add(mottoDXFrame);
            //newTile.Appearance.BackColor = System.Drawing.Color.Gray;
            //newTile.Appearance.BackColor2 = System.Drawing.Color.SandyBrown;
            //newTile.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal;
            //newTile.Appearance.BorderColor = System.Drawing.Color.Bisque;
            newTile.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            newTile.ImageAlignment = TileItemContentAlignment.MiddleCenter;
            newTile.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
            newTile.TextAlignment = TileItemContentAlignment.MiddleCenter;
            newTile.FrameAnimationInterval = 2000;
            newTile.IsLarge = true;
            if(tiletype==1)
                tileControl1.Groups[0].Items.Add(newTile);
            if (tiletype == 2)
                tileControl2.Groups[0].Items.Add(newTile);
            
                
        }
Exemplo n.º 17
0
        /// <summary>
        /// 创建天气Tile控件
        /// </summary>
        /// <param name="str"></param>
        private void CreateWeatherTile(string str)
        {
            var t = new Tile();

            //t.Click += new TileClickEventHandler(moreTile_Click);
            t.Group = "热门推荐";

            tileContainer.Items.Add(t);

            try
            {
                dynamic obj = Newtonsoft.Json.JsonConvert.DeserializeObject(str);

                //frame #1
                TileItemFrame frameOne = new TileItemFrame();
                frameOne.Appearance.Font = new System.Drawing.Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);

                TileItemElement elemHigh = new TileItemElement();
                var             low      = obj.data.forecast[0].low.ToString();
                var             high     = obj.data.forecast[0].high.ToString();
                low                    = System.Text.RegularExpressions.Regex.Replace(low, @"[^\d|\.]", string.Empty);
                high                   = System.Text.RegularExpressions.Regex.Replace(high, @"[^\d|\.]", string.Empty);
                elemHigh.Text          = string.Format("{0}℃ ~ {1}℃", low, high);
                elemHigh.TextAlignment = TileItemContentAlignment.TopLeft;
                frameOne.Elements.Add(elemHigh);

                TileItemElement elemtype = new TileItemElement();
                elemtype.Text = obj.data.forecast[0].type;
                elemtype.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 18.0f, System.Drawing.GraphicsUnit.Point);
                elemtype.TextAlignment          = TileItemContentAlignment.MiddleCenter;
                frameOne.Elements.Add(elemtype);

                TileItemElement elemCity = new TileItemElement();
                elemCity.Text          = obj.cityInfo.city;
                elemCity.TextAlignment = TileItemContentAlignment.BottomLeft;
                frameOne.Elements.Add(elemCity);

                TileItemElement elemFx = new TileItemElement();
                elemFx.Text          = string.Format("{0} {1}", obj.data.forecast[0].fx, obj.data.forecast[0].fl);
                elemFx.TextAlignment = TileItemContentAlignment.TopRight;
                frameOne.Elements.Add(elemFx);

                TileItemElement elemNotice = new TileItemElement();
                elemNotice.Text          = obj.data.forecast[0].notice;
                elemNotice.TextAlignment = TileItemContentAlignment.BottomRight;
                frameOne.Elements.Add(elemNotice);

                TileItemElement elemYmd = new TileItemElement();
                elemFx.Text          = string.Format("{0} {1}", Convert.ToDateTime(obj.data.forecast[0].ymd).ToString("M月d日"), obj.data.forecast[0].week);
                elemFx.TextAlignment = TileItemContentAlignment.TopRight;
                frameOne.Elements.Add(elemFx);
                // aaa.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 18.0f, System.Drawing.GraphicsUnit.Point);

                frameOne.Interval  = 5000;
                frameOne.Animation = TileItemContentAnimationType.ScrollDown;

                //frame #2
                TileItemFrame frameTwo = new TileItemFrame();
                frameTwo.Appearance.Font = new System.Drawing.Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);

                TileItemElement elemShidu = new TileItemElement();
                elemShidu.Text          = string.Format("最近更新 : {0}", obj.cityInfo.updateTime);
                elemShidu.TextAlignment = TileItemContentAlignment.MiddleRight;
                frameTwo.Elements.Add(elemShidu);

                TileItemElement elemPM25 = new TileItemElement();
                elemPM25.Text          = string.Format("PM2.5: {0}", obj.data.pm25);
                elemPM25.TextAlignment = TileItemContentAlignment.TopLeft;
                frameTwo.Elements.Add(elemPM25);

                TileItemElement elemQuality = new TileItemElement();
                elemQuality.Text          = string.Format("空气质量: {0}", obj.data.quality);
                elemQuality.TextAlignment = TileItemContentAlignment.TopRight;
                frameTwo.Elements.Add(elemQuality);

                TileItemElement elemWendu = new TileItemElement();
                elemWendu.Text = string.Format("温度: {0}℃", obj.data.wendu);
                elemWendu.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 18.0f, System.Drawing.GraphicsUnit.Point);
                elemWendu.TextAlignment          = TileItemContentAlignment.MiddleLeft;
                frameTwo.Elements.Add(elemWendu);

                TileItemElement elemGanmao = new TileItemElement();
                elemGanmao.Text          = obj.data.ganmao;
                elemGanmao.TextAlignment = TileItemContentAlignment.BottomLeft;
                frameTwo.Elements.Add(elemGanmao);

                frameTwo.Interval  = 4000;
                frameTwo.Animation = TileItemContentAnimationType.Default;

                t.Frames.Add(frameOne);
                t.Frames.Add(frameTwo);
            }
            catch (Exception)
            {
                TileItemFrame tileFrameTmp = new TileItemFrame();
                tileFrameTmp.Elements.Add(new TileItemElement()
                {
                    Text = "天气获取失败", TextAlignment = TileItemContentAlignment.MiddleCenter
                });
                tileFrameTmp.Appearance.Font = new Font("微软雅黑", 12.0f, System.Drawing.GraphicsUnit.Point);
                t.Frames.Add(tileFrameTmp);
                //throw;
            }
        }
Exemplo n.º 18
0
 private void NewTile(string tilecaption,int tileid,bool mtype,bool islarge)
 {
         var newTile = new TileItem();
         
         newTile.ItemClick += clickhandler;
         newTile.Name = tileid.ToString();
         newTile.Tag = tileid;
         newTile.IsLarge = islarge;
         newTile.Text = tilecaption;
         var logoDXFrame = new TileItemFrame();
         logoDXFrame.UseImage = true;
         logoDXFrame.UseText = true;
         logoDXFrame.AnimateImage = true;
         logoDXFrame.AnimateText = true;
         var logoEl = new TileItemElement();
         logoDXFrame.Elements.Add(logoEl);
         if (!mtype)
         {
             tileControl2.Groups[0].Items.Add(newTile);
             tileControl2.ScrollMode = TileControlScrollMode.ScrollBar;
         }
         else
         {
             tileControl2.Groups[1].Items.Add(newTile);
             tileControl2.ScrollMode = TileControlScrollMode.ScrollBar;
         }
 }
Exemplo n.º 19
0
        public void CreateTile(DataRow Menu)
        {
            string element = Menu[CommonConst.NAME].ToString();
            _Tile = new Tile();
            _Doc = new Document();
            _Element = new TileItemElement() { Text = element, TextAlignment = TileItemContentAlignment.BottomLeft };

            ((ISupportInitialize)(this._MetroUI)).BeginInit();
            ((ISupportInitialize)(this._Tile)).BeginInit();
            ((ISupportInitialize)(this._Doc)).BeginInit();
            //Tim ve nha
            if (dtMenu.Select(string.Format("MenuID = '{0}'", Menu["MenuID"]))[0]["ParentMenuID"] != DBNull.Value)
            {
                foreach (TileContainer tc in _MetroUI.ContentContainers)
                {
                    if (tc.Caption.Equals(dtMenu.Select(string.Format("MenuID = '{0}'", Menu["MenuID"]))[0]["ParentMenuID"].ToString()) && Dash(tc.Caption) == false)
                    {
                        tc.Items.Add(_Tile);
                    }
                }
            }
            // xac dinh con
            if (dtMenu.Select(string.Format("ParentMenuID = '{0}'", Menu["MenuID"])).Length > 0 && Dash(Menu["MenuID"].ToString()) == false)
            {
                foreach (TileContainer tc in _MetroUI.ContentContainers)
                {
                    if (tc.Caption.Equals(Menu["MenuID"].ToString()) && Dash(tc.Caption) == false)
                    {
                        _Tile.ActivationTarget = tc;
                    }
                }
            }
            _MetroUI.Documents.Add(_Doc);
            _MetroUI.Tiles.Add(_Tile);
            _MetroUI.Documents.Add(_Doc);

            _Doc.ControlName = Menu["ClassName"].ToString();
            _Doc.ControlTypeName = Menu["AssemblyName"].ToString();
            _Doc.Caption = element;

            _Tile.Document = _Doc;
            _Tile.Elements.Add(_Element);
            _Tile.Properties.IsLarge = DevExpress.Utils.DefaultBoolean.False;
            _Tile.Properties.FrameAnimationInterval = ran.Next(3000, 8000);

            if (dtMenu.Select(string.Format("ParentMenuID = '{0}'", Menu["MenuID"])).Length > 0 && Dash(Menu["MenuID"].ToString()) == false)
            {
                foreach (DataRow dr in dtMenu.Select(string.Format("ParentMenuID = '{0}'", Menu["MenuID"])))
                {

                    TileItemElement el = new TileItemElement() { Text = dr["Name"].ToString() };
                    frame = new TileItemFrame();
                    frame.Elements.Add(el);
                    frame.Elements.Add(_Element);
                    _Tile.Frames.Add(frame);
                }
            }
            ((ISupportInitialize)(this._Tile)).EndInit();
            ((ISupportInitialize)(this._Doc)).EndInit();
            ((ISupportInitialize)(this._MetroUI)).EndInit();
        }
Exemplo n.º 20
0
        private void loadData()
        {
            tileXBJC.Frames.Clear();
            tileWXZT.Frames.Clear();

            mStations = stationDao.QueryForList(null).Where(p => p.sStyle == 1).ToList();
            mSatList = satDao.QueryForList(null);

            if (mWxzt != null)
            {
                mWxzt.bindData();
            }

            this.tileSBZT.Elements[1].Text = String.Format("设备连接数{0}台", mStations.Count);

            for (int i = 0; i < mStations.Count; i++)
            {
                var mStation = mStations[i];
                IList<DEVICE_STATUS_CLEAN> list = DEVICE_STATUS_CLEANDao.QueryTopForList(mStations[i].sCoorName, 1, new DEVICE_STATUS_CLEAN() { Style = 2 });
                foreach (var status in list)
                {
                    status.Dx = status.X * 1000;
                    status.Dy = status.Y * 1000;
                    status.Dh = status.Height * 1000;
                    if (Math.Abs(status.Dx) > 4 || Math.Abs(status.Dx) < 0.1)
                    {
                        status.Dx = 0;
                    }
                    if (Math.Abs(status.Dy) > 4 || Math.Abs(status.Dy) < 0.1)
                    {
                        status.Dy = 0;
                    }
                    if (Math.Abs(status.Dh) > 4 || Math.Abs(status.Dh) < 0.1)
                    {
                        status.Dh = 0;
                    }
                }
                mXbjcDic[mStation.sComment] = list;
            }

            for (int i = 0; i < mStations.Count; i++)
            {
                //形变监测
                var mStation = mStations[i];
                double dX = 0, dY = 0, dH = 0;
                var mStatusList = mXbjcDic[mStation.sComment];
                if (mStatusList.Count > 0)
                {
                    var mStatus = mStatusList[0];
                    dX = mStatus.Dx;
                    dY = mStatus.Dy;
                    dH = mStatus.Dh;
                }
                var frame = new TileItemFrame();
                frame.Tag = i;
                foreach (TileItemElement element in tileXBJC.Elements)
                {
                    frame.Elements.Add(element.Clone() as TileItemElement);
                }
                frame.Interval = 5000;
                if (dX == 0 && dH == 0)
                {
                    frame.Elements[1].Text = string.Format("{0}:未变化", mStation.sComment);
                }
                else
                {
                    frame.Elements[1].Text = string.Format("{0}:水平偏移:{1:0.0}mm  沉降:{2:0.0}mm", mStation.sComment, dX, dH);
                    var font = frame.Elements[1].Appearance.Normal.Font;
                    frame.Elements[1].Appearance.Normal.Font = new Font(font.FontFamily, font.Size - 4);
                }
                tileXBJC.Frames.Add(frame);

                //卫星状态
                frame = new TileItemFrame();
                frame.Tag = i;
                foreach (TileItemElement element in tileWXZT.Elements)
                {
                    frame.Elements.Add(element.Clone() as TileItemElement);
                }
                frame.Interval = 5000;
                frame.Elements[1].Text = string.Format("{0}:GPS:{1}  GLO:{2}  BD:{3}", mStation.sComment,
                    mSatList.Where(p => p.sId == mStation.sId && p.sPrn < 30).Count(),
                    mSatList.Where(p => p.sId == mStation.sId && p.sPrn < 60 && p.sPrn > 30).Count(),
                    mSatList.Where(p => p.sId == mStation.sId && p.sPrn > 60).Count());
                tileWXZT.Frames.Add(frame);
            }
        }
Exemplo n.º 21
0
        private void loadData()
        {
            tileXBJC.Frames.Clear();
            tileWXZT.Frames.Clear();

            mStations = stationDao.QueryForList(null).Where(p => p.sStyle == 1).ToList();
            mSatList  = satDao.QueryForList(null);

            if (mWxzt != null)
            {
                mWxzt.bindData();
            }

            this.tileSBZT.Elements[1].Text = String.Format("设备连接数{0}台", mStations.Count);

            for (int i = 0; i < mStations.Count; i++)
            {
                var mStation = mStations[i];
                IList <DEVICE_STATUS_CLEAN> list = DEVICE_STATUS_CLEANDao.QueryTopForList(mStations[i].sCoorName, 1, new DEVICE_STATUS_CLEAN()
                {
                    Style = 2
                });
                foreach (var status in list)
                {
                    status.Dx = status.X * 1000;
                    status.Dy = status.Y * 1000;
                    status.Dh = status.Height * 1000;
                    if (Math.Abs(status.Dx) > 4 || Math.Abs(status.Dx) < 0.1)
                    {
                        status.Dx = 0;
                    }
                    if (Math.Abs(status.Dy) > 4 || Math.Abs(status.Dy) < 0.1)
                    {
                        status.Dy = 0;
                    }
                    if (Math.Abs(status.Dh) > 4 || Math.Abs(status.Dh) < 0.1)
                    {
                        status.Dh = 0;
                    }
                }
                mXbjcDic[mStation.sComment] = list;
            }

            for (int i = 0; i < mStations.Count; i++)
            {
                //形变监测
                var    mStation = mStations[i];
                double dX = 0, dY = 0, dH = 0;
                var    mStatusList = mXbjcDic[mStation.sComment];
                if (mStatusList.Count > 0)
                {
                    var mStatus = mStatusList[0];
                    dX = mStatus.Dx;
                    dY = mStatus.Dy;
                    dH = mStatus.Dh;
                }
                var frame = new TileItemFrame();
                frame.Tag = i;
                foreach (TileItemElement element in tileXBJC.Elements)
                {
                    frame.Elements.Add(element.Clone() as TileItemElement);
                }
                frame.Interval = 5000;
                if (dX == 0 && dH == 0)
                {
                    frame.Elements[1].Text = string.Format("{0}:未变化", mStation.sComment);
                }
                else
                {
                    frame.Elements[1].Text = string.Format("{0}:水平偏移:{1:0.0}mm  沉降:{2:0.0}mm", mStation.sComment, dX, dH);
                    var font = frame.Elements[1].Appearance.Normal.Font;
                    frame.Elements[1].Appearance.Normal.Font = new Font(font.FontFamily, font.Size - 4);
                }
                tileXBJC.Frames.Add(frame);

                //卫星状态
                frame     = new TileItemFrame();
                frame.Tag = i;
                foreach (TileItemElement element in tileWXZT.Elements)
                {
                    frame.Elements.Add(element.Clone() as TileItemElement);
                }
                frame.Interval         = 5000;
                frame.Elements[1].Text = string.Format("{0}:GPS:{1}  GLO:{2}  BD:{3}", mStation.sComment,
                                                       mSatList.Where(p => p.sId == mStation.sId && p.sPrn < 30).Count(),
                                                       mSatList.Where(p => p.sId == mStation.sId && p.sPrn < 60 && p.sPrn > 30).Count(),
                                                       mSatList.Where(p => p.sId == mStation.sId && p.sPrn > 60).Count());
                tileWXZT.Frames.Add(frame);
            }
        }
Exemplo n.º 22
0
        public void CreateTile(DataRow Menu)
        {
            string element = Menu[CommonConst.NAME].ToString();

            _Tile    = new Tile();
            _Doc     = new Document();
            _Element = new TileItemElement()
            {
                Text = element, TextAlignment = TileItemContentAlignment.BottomLeft
            };

            ((ISupportInitialize)(this._MetroUI)).BeginInit();
            ((ISupportInitialize)(this._Tile)).BeginInit();
            ((ISupportInitialize)(this._Doc)).BeginInit();
            //Tim ve nha
            if (dtMenu.Select(string.Format("MenuID = '{0}'", Menu["MenuID"]))[0]["ParentMenuID"] != DBNull.Value)
            {
                foreach (TileContainer tc in _MetroUI.ContentContainers)
                {
                    if (tc.Caption.Equals(dtMenu.Select(string.Format("MenuID = '{0}'", Menu["MenuID"]))[0]["ParentMenuID"].ToString()) && Dash(tc.Caption) == false)
                    {
                        tc.Items.Add(_Tile);
                    }
                }
            }
            // xac dinh con
            if (dtMenu.Select(string.Format("ParentMenuID = '{0}'", Menu["MenuID"])).Length > 0 && Dash(Menu["MenuID"].ToString()) == false)
            {
                foreach (TileContainer tc in _MetroUI.ContentContainers)
                {
                    if (tc.Caption.Equals(Menu["MenuID"].ToString()) && Dash(tc.Caption) == false)
                    {
                        _Tile.ActivationTarget = tc;
                    }
                }
            }
            _MetroUI.Documents.Add(_Doc);
            _MetroUI.Tiles.Add(_Tile);
            _MetroUI.Documents.Add(_Doc);



            _Doc.ControlName     = Menu["ClassName"].ToString();
            _Doc.ControlTypeName = Menu["AssemblyName"].ToString();
            _Doc.Caption         = element;

            _Tile.Document = _Doc;
            _Tile.Elements.Add(_Element);
            _Tile.Properties.IsLarge = DevExpress.Utils.DefaultBoolean.False;
            _Tile.Properties.FrameAnimationInterval = ran.Next(3000, 8000);

            if (dtMenu.Select(string.Format("ParentMenuID = '{0}'", Menu["MenuID"])).Length > 0 && Dash(Menu["MenuID"].ToString()) == false)
            {
                foreach (DataRow dr in dtMenu.Select(string.Format("ParentMenuID = '{0}'", Menu["MenuID"])))
                {
                    TileItemElement el = new TileItemElement()
                    {
                        Text = dr["Name"].ToString()
                    };
                    frame = new TileItemFrame();
                    frame.Elements.Add(el);
                    frame.Elements.Add(_Element);
                    _Tile.Frames.Add(frame);
                }
            }
            ((ISupportInitialize)(this._Tile)).EndInit();
            ((ISupportInitialize)(this._Doc)).EndInit();
            ((ISupportInitialize)(this._MetroUI)).EndInit();
        }
Exemplo n.º 23
0
        public static Tile CreateAnimatedEduTile(edu eo, bool isArchive = false)
        {
            var eoTile = CreateTile(TileItemSize.Wide, 0);
            eoTile.Tag = TagHelper.GetTag(TagHelper.TagType.Tile, eo, isArchive ? "archive" : "");
            
            var frame1 = new TileItemFrame();
            frame1.Elements.Add(new TileItemElement()
            {
                Text = eo.number_sysname,
                TextAlignment = TileItemContentAlignment.BottomLeft
            });
            frame1.Elements[0].Appearance.Assign(AppearanceMid);

            var frame2 = new TileItemFrame();
            frame2.Elements.Add(new TileItemElement()
            {
                TextAlignment = TileItemContentAlignment.BottomLeft
            });
            frame2.Elements[0].Appearance.Assign(AppearanceText);

            eoTile.Frames.Add(frame1);
            eoTile.Frames.Add(frame2);
            eoTile.Properties.ContentAnimation = TileItemContentAnimationType.ScrollLeft;
            eoTile.Properties.FrameAnimationInterval = 3500;
            return eoTile;
        }