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;
 }
Ejemplo n.º 2
0
        void CargarModulo()
        {
            tileGroup2.Items.Clear();
            ListaModulos = oDatModulo.ConsultaModulos();

            foreach (var item in ListaModulos)
            {

                var Imagen = ResourceManager.GetObject(item.Logo);
                TileItemElement tileItemElement = new TileItemElement();
                TileItem tileItem = new TileItem();
                tileItem.Elements.Add(tileItemElement);
                tileItem.Id = 13;
                tileItem.Text = item.Nombre;
                tileItem.TextAlignment = DevExpress.XtraEditors.TileItemContentAlignment.BottomLeft;
                tileItem.BackgroundImage = (Image)Imagen;
                tileItem.BackgroundImageScaleMode = TileItemImageScaleMode.ZoomOutside;
                this.tileGroup2.Items.Add(tileItem);

                tileItem.ItemClick += new TileItemClickEventHandler(tileItem_ItemClick);

                Thread.Sleep(new TimeSpan(0, 0, 0, 0, 300));

            }
        }
Ejemplo n.º 3
0
 private void tileItemClick(TileItem item, TjItemEnum itemEnum)
 {
     if (mSelectedTjItems.Contains(itemEnum))
     {
         mSelectedTjItems.Remove(itemEnum);
     }
     else
     {
         mSelectedTjItems.Add(itemEnum);
     }
     initTileItem(item, mSelectedTjItems.Contains(itemEnum));
 }
Ejemplo n.º 4
0
 private TileItem CreateTileItem(TIS.Model.Internal.Document.DocNode node)
 {
     try
     {
         TileItem ti = new TileItem();
         ti.BackgroundImageAlignment = TileItemContentAlignment.MiddleCenter;
         ti.BackgroundImageScaleMode = TileItemImageScaleMode.ZoomInside;
         if (node.Document == null)
             ti.IsLarge = true;
         if (node.ImageIndex >= 0 && node.ImageIndex < iclExtraLarge.Images.Count)
             ti.BackgroundImage = iclExtraLarge.Images[node.ImageIndex];
         else
             if (node.Document != null)
             {
                 RegistryKey oHKCR = null;
                 RegistryKey oProgID = null;
                 RegistryKey oOpenCmd = null;
                 string StrProgID = null;
                 string StrExe = null;
                 try
                 {
                     oHKCR = Registry.ClassesRoot;
                     oProgID = oHKCR.OpenSubKey(node.Document.Name.Substring(node.Document.Name.LastIndexOf('.')));
                     StrProgID = oProgID.GetValue(null).ToString();
                     oProgID.Close();
                     oOpenCmd = oHKCR.OpenSubKey(StrProgID + @"\shell\open\command");
                     StrExe = oOpenCmd.GetValue(null).ToString();
                     oOpenCmd.Close();
                     int TempPos = StrExe.IndexOf(" %1");
                     if (TempPos > 0)
                     {
                         StrExe = StrExe.Substring(0, TempPos);
                     }
                     TempPos = StrExe.IndexOf("\"");
                     if (TempPos >= 0)
                     {
                         StrExe = StrExe.Substring(TempPos + 1, StrExe.IndexOf("\"", TempPos + 1) - 1);
                     }
                     ti.BackgroundImage = Icon.ExtractAssociatedIcon(StrExe).ToBitmap();
                 }
                 catch (Exception e) { }
             }
         ti.Text = node.Name;
         ti.Tag = node;
         return ti;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 5
0
 private void initTileItem(TileItem item, bool selected)
 {
     if (selected)
     {
         item.Elements[1].Text = "已选择";
         item.Checked = true;
     }
     else
     {
         item.Elements[1].Text = "点击选择";
         item.Checked = false; ;
     }
 }
Ejemplo n.º 6
0
 public void Insert(string maph)
 {
     var ph = BUS.getdata().Last<Model.Models.phonghoc>();
     Image img = Image.FromStream(new MemoryStream(ph.images));
     img.Tag = ph.maphong;
     TileItem item = new TileItem();
     item.ItemSize = TileItemSize.Wide;
     item.Image = img;
     item.Text = ph.maphong;
     item.ImageScaleMode = TileItemImageScaleMode.Stretch;
     tileControl1.Groups[0].Items.Insert(list.Count, item);
     list.Add(ph);
     imageSlider1.Images.Add(img);
 }
Ejemplo n.º 7
0
                public State()
                {
                    for (int i = 0; i < item.Length; i++)
                    {
                        item[i] = new byte[32];
                    }

                    for (int i = 0; i < tile.Length; i++)
                    {
                        tile[i] = new TileItem[34];
                        for (int j = 0; j < tile[i].Length; j++)
                        {
                            tile[i][j] = new TileItem();
                        }
                    }
                }
Ejemplo n.º 8
0
 private void CreateOverviewTileItem()
 {
     try
     {
         _overviewTileItem = new TileItem();
         _overviewTileItem.BackgroundImageAlignment = TileItemContentAlignment.MiddleCenter;
         _overviewTileItem.BackgroundImageScaleMode = TileItemImageScaleMode.ZoomInside;
         _overviewTileItem.IsLarge = true;
         _overviewTileItem.BackgroundImage = iclExtraLarge.Images[42];
         _overviewTileItem.Text = "Overzicht";
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 9
0
        private void AddAppItem(IApp app)
        {
            var tileItem2 = new TileItem
            {
                AllowGlyphSkinning = DefaultBoolean.True,
                ItemSize = TileItemSize.Wide,
                Id = app.Id,
                Tag = app
            };


            tileItem2.ItemClick += TileItem2_ItemClick;

            tileItem2.Elements.Add(new TileItemElement
            {
                Image = app.Image,
                ImageAlignment = TileItemContentAlignment.BottomRight,
                Text = app.Name
            });
            var group = AddAppGroup(app.AppGroup);

            group.Items.Add(tileItem2);
        }
Ejemplo n.º 10
0
        private void tileControl1_MouseMove(object sender, MouseEventArgs e)
        {
            try
            {
                if (IsDesignModel)
                {
                    return;
                }

                int scrollWidth = 0;

                if (((DevExpress.XtraEditors.ITileControl)tileControl1).ScrollBar.Visible)
                {
                    scrollWidth = ((DevExpress.XtraEditors.ITileControl)tileControl1).ScrollBar.Width;
                }

                Rectangle lockRang = new Rectangle(2, 2,
                                                   tileControl1.ClientSize.Width - scrollWidth - 2,
                                                   tileControl1.ClientSize.Height - 2);



                if (e.X <= lockRang.X ||
                    e.Y <= lockRang.Y ||
                    e.X >= lockRang.Width ||
                    e.Y >= lockRang.Height)
                {
                    OnViewerMouseLeave?.Invoke(sender, e);
                    System.Windows.Forms.Cursor.Clip = new Rectangle(0, 0, 0, 0);
                }
                else
                {
                    System.Windows.Forms.Cursor.Clip = tileControl1.RectangleToScreen(lockRang);
                }


                Rectangle itemRang;
                TileItem  ti = GetMouseItem(new Point(e.X, e.Y), out itemRang);

                if (ti != null)
                {
                    System.Windows.Forms.Cursor.Clip = new Rectangle(0, 0, 0, 0);

                    OnItemMouseEnter?.Invoke(ti);

                    Rectangle screenRang   = tileControl1.RectangleToScreen(lockRang);
                    Point     screenCursor = Cursor.Position;

                    //重新进行锁定
                    if (screenCursor.X > screenRang.X &&
                        screenCursor.Y > screenRang.Y &&
                        screenCursor.X < screenRang.Right &&
                        screenCursor.Y < screenRang.Bottom)
                    {
                        System.Windows.Forms.Cursor.Clip = tileControl1.RectangleToScreen(lockRang);
                    }
                }
                else
                {
                    OnItemMouseLeave?.Invoke(sender, e);
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.Cursor.Clip = new Rectangle(0, 0, 0, 0);
                MsgBox.ShowException(ex, this);
            }
        }
Ejemplo n.º 11
0
 public bool collectable(TileItem t)
 {
     return((t is ExtractedResource) && (t as ExtractedResource).type == type);
 }
Ejemplo n.º 12
0
 void newTile_ItemClick(object sender, TileItemEventArgs e)
 {
     TileItem Tile = (TileItem)sender;
     Tile_Click = (TileItem)sender;
     //doi mau khi click
     Tile.AppearanceItem.Normal.BackColor = Color.Black;
     for (int i = 0; i < tileControl1.Groups[0].Items.Count; i++)
     {
         if (!(Tile.Name.Equals(tileControl1.Groups[0].Items[i].Name)))
         {
             tileControl1.Groups[0].Items[i].AppearanceItem.Normal.BackColor = Color.White;
         }
     }
     itemName = Tile.Name;
 }
Ejemplo n.º 13
0
 public void LoadListTeam(string _seasonName)
 {
     Tile_Click = null;
     dtTeam = _busTeam.getTeamBySeasonName(_seasonName);
     byte[] logo;
     tileControl1.Groups.Clear();
     for (int i = 0; i < dtTeam.Rows.Count; i++)
     {
         logo = (byte[])(dtTeam.Rows[i]["Logo"]);
         MemoryStream memory = new MemoryStream(logo);
         AddTtem(Image.FromStream(memory), i);
     }
 }
Ejemplo n.º 14
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);
            
                
        }
Ejemplo n.º 15
0
 private TileItem GenerateAddImageItem()
 {
     TileItem itmAdd = new TileItem();
     TileItemElement tileItemElement = new TileItemElement();
     tileItemElement.Text = "เพิ่มรูปภาพ";
     tileItemElement.TextAlignment = TileItemContentAlignment.MiddleCenter;
     itmAdd.Elements.Add(tileItemElement);
     itmAdd.BackgroundImageScaleMode = TileItemImageScaleMode.Stretch;
     itmAdd.Id = 99;
     itmAdd.ItemSize = TileItemSize.Medium;
     itmAdd.Name = "AddImage";
     itmAdd.AppearanceItem.Normal.ForeColor = Color.DarkGray;
     return itmAdd;
 }
Ejemplo n.º 16
0
        public TileItem AddImage(TileImageInfo imgInfo)
        {
            TileItem AddImageToTile(System.Drawing.Image img)
            {
                TileItem ti = new TileItem();

                ti.Image          = img;
                ti.ImageScaleMode = TileItemImageScaleMode.Stretch;
                ti.ItemSize       = TileItemSize.Large;
                ti.Text           = "";
                ti.Tag            = imgInfo;

                TileItemElement tie = new TileItemElement();

                tie.Image          = imageList1.Images[0];
                tie.ImageSize      = new Size(32, 32);
                tie.ImageAlignment = TileItemContentAlignment.TopRight;
                tie.Text           = "";

                ti.Elements.Add(tie);

                if (imgInfo.IsKeyImage)
                {
                    TileItemElement tieKey = new TileItemElement();

                    tieKey.Image          = imageList2.Images[1];
                    tieKey.Image.Tag      = "lock";
                    tieKey.ImageSize      = new Size(16, 16);
                    tieKey.ImageAlignment = TileItemContentAlignment.TopLeft;
                    tieKey.Text           = "";

                    ti.Elements.Add(tieKey);
                }

                TileItemElement tieOrder = new TileItemElement();

                tieOrder.TextAlignment = TileItemContentAlignment.BottomLeft;
                tieOrder.Text          = imgInfo.Order;


                ti.Elements.Add(tieOrder);

                if (tileControl1.Groups.Count <= 0)
                {
                    TileGroup tg = new TileGroup();
                    tg.Text = "";

                    tileControl1.Groups.Add(tg);
                }


                if (tileControl1.Groups[0].Items.Count >= _imgViewCount)
                {
                    tileControl1.Groups[0].Items.RemoveAt(0);
                }

                tileControl1.Groups[0].Items.Insert(0, ti);
                //tileControl1.Groups[0].Items.Add(ti);

                return(ti);
            }

            if (this.InvokeRequired)//如果是在非创建控件的线程访问,即InvokeRequired=true
            {
                DelegateAddImage addImgProcess = new DelegateAddImage(AddImage);
                return(this.Invoke(addImgProcess, new object[] { imgInfo }) as TileItem);
            }
            else
            {
                System.Drawing.Image img = null;
                //视频音频类型媒体加载判断处理
                if (imgInfo.MediaType == "视频")
                {
                    img = imageList3.Images[0];
                }
                else if (imgInfo.MediaType == "音频")
                {
                    img = imageList3.Images[1];
                }
                else
                {
                    img = ImageEx.LoadFile(imgInfo.File);
                }

                return(AddImageToTile(img));
            }
        }
Ejemplo n.º 17
0
 public bool dropoffable(TileItem t)
 {
     return((t is Storage) && (t as Storage).type == type);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 判断当前格子是否可用于建设命令
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected override bool CheckAvailable(TileItem item)
 {
     return(item.HaveGroundwork);
 }
Ejemplo n.º 19
0
        void LoadMenu()
        {
            con.open();

            DataTable pram = con.execReturnDataTable("SELECT m.MenuID,t.Content FROM MEN_Menu m left join tblMD_Message t on t.MessageID= m.MenuID  WHERE m.IsVisible= 'True' and ParentMenuID='Mnu' and t.Language='VN' order by m.Priority");
            tblMenu = con.execReturnDataTable("SELECT m.MenuID,t.Content as Text, LOWER(dbo.fn_RemoveToneMark(t.Content)) as Content, m.ParentMenuID FROM MEN_Menu m left join tblMD_Message t on t.MessageID= m.MenuID WHERE m.IsVisible= 'True'  and t.Language='VN'");
            con.close();
            foreach (DataRow item in pram.Rows)
            {
                TileGroup t = new TileGroup { Name = item["MenuID"].ToString(), Text = item["Content"].ToString() };
                DataRow[] rows = tblMenu.Select("ParentMenuID = '" + t.Name + "'");
                foreach (DataRow i in rows)
                {
                    TileItem ti = new TileItem { Name = i["MenuID"].ToString(), Text = i["Text"].ToString() };
                   // ti.ItemClick += ti_ItemClick;
                    t.Items.Add(ti);

                }
                lstGroup.Add(t);
                tileControl1.Groups.Add(t);
            }
        }
Ejemplo n.º 20
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;
         }
 }
Ejemplo n.º 21
0
 void LoadMenu()
 {
     tblMenu = UIMessage.DBEngine.execReturnDataTable("sp_Menu_Load",
             "@LanguageID", UIMessage.languageID, CommonConst.A_LoginID, UIMessage.userID);
     foreach (DataRow item in tblMenu.Select("ParentMenuID = 'Mnu'"))
     {
         TileGroup t = new TileGroup { Name = item["MenuID"].ToString(), Text = item["Name"].ToString() };
         DataRow[] rows = tblMenu.Select("ParentMenuID = '" + t.Name + "'");
         foreach (DataRow i in rows)
         {
             if (i["ClassName"] == DBNull.Value || i["ClassName"].ToString().Equals("OK"))
                 continue;
             TileItem ti = new TileItem { Name = i["MenuID"].ToString(), Text = i["Name"].ToString() };
             ti.Tag = i;
             ti.ItemClick += ti_ItemClick;
             t.Items.Add(ti);
         }
         lstGroup.Add(t);
         tileControl1.Groups.Add(t);
     }
 }
Ejemplo n.º 22
0
        private async void bandedGridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try {
                BandedGridView bandedGridView = (BandedGridView)sender;
                _PRODUCT_ROW_SELECTED = bandedGridView.GetFocusedDataRow();
                _PRODUCT_PROPERTIES = new DataTable();
                _PRODUCT_PROPERTIES = _TABLE_PRODUCT.Clone();
                _PRODUCT_PROPERTIES.Rows.Add(_PRODUCT_ROW_SELECTED.ItemArray);
                vGridControl1.DataSource = _PRODUCT_PROPERTIES;
                vGridControl1.Enabled = true;

                tileGroup1.Items.Clear();
                if ((bool)_PRODUCT_ROW_SELECTED["hasCoverImage"])
                {
                    //http://src.powerdd.com/img/product/88888888/D1400010/1.jpg
                    //api-test.powerdd.com/img/remax/product/88888888/D1400010/300/300/1.jpg
                    //https://src.remaxthailand.co.th/img/product/D1501073/1.jpg
                    _STREAM_IMAGE_URL = "https://src.remaxthailand.co.th/img/product/" + _PRODUCT_ROW_SELECTED["sku"].ToString() + "/" + _PRODUCT_ROW_SELECTED["image"].ToString().Split(',')[0];
                    TileItem itmImg = new TileItem();
                    TileItemElement tileItemElement1 = new TileItemElement();
                    tileItemElement1.Text = "กำลังโหลดรูปภาพ";
                    itmImg.Elements.Add(tileItemElement1);
                    itmImg.BackgroundImageScaleMode = TileItemImageScaleMode.Stretch;
                    itmImg.Id = 0;
                    itmImg.ItemSize = TileItemSize.Medium;
                    itmImg.Name = "CoverImage";
                    itmImg.AppearanceItem.Normal.ForeColor = Color.DarkGray;
                    itmImg.Checked = true;
                    tileGroup1.Items.Add(itmImg);
                    /*bwLoadImage.CancelAsync();
                    while (bwLoadImage.IsBusy)
                    {
                        Application.DoEvents();
                    }
                    bwLoadImage.RunWorkerAsync();*/

                    //https://img.remaxthailand.co.th/100x100/product/D1600089/1.jpg
                    /*tileGroup1.Items[0].BackgroundImage = await DownloadImage("https://src.remaxthailand.co.th/img/product/" +
                        _PRODUCT_ROW_SELECTED["sku"].ToString() + "/" + _PRODUCT_ROW_SELECTED["image"].ToString().Split(',')[0]);*/
                    tileGroup1.Items[0].BackgroundImage = await DownloadImage("https://img.remaxthailand.co.th/300x300/product/" +
                        _PRODUCT_ROW_SELECTED["sku"].ToString() + "/" + _PRODUCT_ROW_SELECTED["image"].ToString().Split(',')[0]);
                    tileGroup1.Items[0].Elements[0].Text = "ภาพหลัก";

                    Console.WriteLine("https://src.remaxthailand.co.th/img/product/" +
                        _PRODUCT_ROW_SELECTED["sku"].ToString() + "/" + _PRODUCT_ROW_SELECTED["image"].ToString().Split(',')[0]);

                    //tileGroup1.Items.Add(GenerateAddImageItem());

                }
                else
                {
                    //tileGroup1.Items.Add(GenerateAddImageItem());
                }

                /*int idx = 1;
                string[] image = _PRODUCT_ROW_SELECTED["image"].ToString().Split(',');
                for(int i=1; i< image.Length; i++)
                {
                    if (image[i] != image[0] && image[i].Substring(0,1).ToLower() != "d")
                    {
                        try {
                            TileItem itmImg = new TileItem();
                            TileItemElement tileItemElement1 = new TileItemElement();
                            tileItemElement1.Text = "ภาพที่ " + idx; //"กำลังโหลดรูปภาพ";
                            itmImg.Elements.Add(tileItemElement1);
                            itmImg.BackgroundImageScaleMode = TileItemImageScaleMode.Stretch;
                            itmImg.Id = idx;
                            itmImg.ItemSize = TileItemSize.Medium;
                            itmImg.Name = "Image" + idx;
                            itmImg.AppearanceItem.Normal.ForeColor = Color.DarkGray;
                            tileGroup1.Items.Add(itmImg);

                            try
                            {
                                tileGroup1.Items[idx].BackgroundImage = await DownloadImage("https://src.remaxthailand.co.th/img/product/" + "/" +
                                    _PRODUCT_ROW_SELECTED["sku"].ToString() + "/" + image[i]);
                            }
                            catch { }
                        }
                        catch
                        {

                        }
                        //tileGroup1.Items[idx].Elements[0].Text = "ภาพที่ " + idx;

                        //tileGroup1.Items.Add(GenerateAddImageItem());
                        idx++;
                    }
                }*/


            }
            catch
            {
                vGridControl1.DataSource = null;
                vGridControl1.Enabled = false;
            }
        }
Ejemplo n.º 23
0
        void RefreshMenu(DataRow[] rows)
        {
            tileControl1.Groups.Clear();
            TileGroup g = new TileGroup();
            if (rows != null && rows.Count()!=0)
            {
                tileControl1.Groups.Add(g);
                foreach (DataRow i in rows)
                {
                    TileItem ti = new TileItem { Name = i["MenuID"].ToString(), Text = i["Name"].ToString() };
                   ti.ItemClick += ti_ItemClick;
                   ti.Tag = i;
                    g.Items.Add(ti);

                }
                tileControl1.SelectedItem = g.Items[0];
                g.Items[0].AppearanceItem.Selected.BackColor = Color.Red;
                g.Items[0].AppearanceItem.Selected.BackColor2 = Color.Orange;
                g.Items[0].AppearanceItem.Selected.BorderColor = Color.White;
            }
        }
Ejemplo n.º 24
0
        protected override void ONCREATE()
        {
            list = BUS.getdata();
            TileGroup group = new TileGroup();

            foreach (var i in list)
            {
                //process, convert byte[] from database to Image
                Image img = Image.FromStream(new MemoryStream(i.images));
                img.Tag = i.maphong;
                //Create tileitem and information
                TileItem item = new TileItem();
                item.ItemSize = TileItemSize.Wide;
                item.Image = img;
                item.Text = i.maphong;
                item.ImageScaleMode = TileItemImageScaleMode.Stretch;
                imageSlider1.Images.Add(img);
                item.ItemClick += (o, e) =>
                {
                    int index = group.Items.IndexOf(e.Item);
                    imageSlider1.SetCurrentImageIndex(index);
                    Global.ID = list[index].maphong;
                };
                item.ItemDoubleClick += (o, e) =>
                {
                    this.mainlayout.Controls.Clear();
                    AddControl<UCRoomSwitch>(mainlayout);
                    radio.SelectedIndex = 1;
                    (new CustomItem.Navigation.TransitionChild(this.mainlayout)).Start();
                    //this.GoTo<UCRoomSwitch>();
                };

                imageSlider1.MouseClick += (o, e) =>
                {

                    int index = imageSlider1.GetCurrentImageIndex();
                    tileControl1.SelectedItem = group.Items[index];
                    Global.ID = list[index].maphong;
                };

                group.Items.Add(item);
            }
            tileControl1.Groups.Add(group);
            if (group.Items.Count > 0)
            {
                tileControl1.SelectedItem = group.Items[0];
                Global.ID = list[0].maphong;
            }
        }
Ejemplo n.º 25
0
 public bool findBaddie(TileItem t)
 {
     return((t is TileUnit) && !(t as TileUnit).isFriendly());
 }
 void CrearMenuPadre()
 {
     tileGroup2.Items.Clear();
     ListaModulos = oListaModulos;// oMisModulos.ConsultaModulosUsuario();
     foreach (var item in ListaModulos)
     {
         var Imagen = ResourceManager.GetObject(item.Logo);
         TileItemElement tileItemElement = new TileItemElement();
         TileItem tileItem = new TileItem();
         tileItem.Elements.Add(tileItemElement);
         tileItem.Id = 13;
         tileItem.Text = item.Nombre;
         tileItem.BackgroundImage = (Image)Imagen;
         tileItem.BackgroundImageScaleMode = TileItemImageScaleMode.Stretch;
         this.tileGroup2.Items.Add(tileItem);
         tileItem.ItemClick += new TileItemClickEventHandler(tileItem_ItemClick);
         Thread.Sleep(new TimeSpan(0, 0, 0, 0, 300));
     }
 }
Ejemplo n.º 27
0
        private void UpdateTileItem(ProjectInfo projectInfo)
        {
            TileItem item = (TileItem)GetTileItem(projectInfo);

            InititalizeFrames(item, projectInfo);
        }