Пример #1
0
        public void updateStrategyItemCaption(int index, string cpation, string description)
        {
            GalleryItem item = this.galleryItemGroup.Items[index];

            item.Caption     = cpation;
            item.Description = description;
        }
Пример #2
0
        //Khởi tạo gallery màu
        void initColor()
        {
            gddColor.BeginUpdate();
            //add web color vô gallery thường và gallery drop down
            foreach (Color color in DevExpress.XtraEditors.Popup.ColorListBoxViewInfo.WebColors)
            {
                if (color == Color.Transparent)
                {
                    continue;
                }

                GalleryItem item = new GalleryItem();
                item.Caption = color.Name;
                item.Tag     = color;
                item.Hint    = color.Name;

                gddColor.Gallery.Groups[0].Items.Add(item);
                galColor.Gallery.Groups[0].Items.Add(item);
            }
            //add system color vô gallery drop down
            foreach (Color color in DevExpress.XtraEditors.Popup.ColorListBoxViewInfo.SystemColors)
            {
                GalleryItem item = new GalleryItem();
                item.Caption = color.Name;
                item.Tag     = color;
                gddColor.Gallery.Groups[1].Items.Add(item);
            }
            gddColor.EndUpdate();
        }
Пример #3
0
        private GalleryItem MostRecentTemplate(List <GalleryItem> galleryItems)
        {
            if (galleryItems == null || galleryItems.Count == 0)
            {
                return(null);
            }

            if (galleryItems.Count == 1)
            {
                return(galleryItems[0]);
            }

            GalleryItem mostRecent = galleryItems[0];

            foreach (var galleryItem in galleryItems)
            {
                // if CompareTo is greater then the present galleryItem is a higher version
                string galleryItemVersion = galleryItem.Version == null ? "0.0.0.0" : galleryItem.Version.Replace("-preview", string.Empty);
                string mostRecentVersion  = mostRecent.Version == null ? "0.0.0.0" : mostRecent.Version.Replace("-preview", string.Empty);
                galleryItemVersion = galleryItemVersion.Replace("-placeholder", string.Empty);
                mostRecentVersion  = mostRecentVersion.Replace("-placeholder", string.Empty);
                if ((new Version(galleryItemVersion)).CompareTo(new Version(mostRecentVersion)) > 0)
                {
                    mostRecent = galleryItem;
                }
            }

            return(mostRecent);
        }
Пример #4
0
        private void galleryControl1_Gallery_ItemClick(object sender, GalleryItemClickEventArgs e)
        {
            var    gc_item = new GalleryItem();
            string id      = e.Item.Value.ToString();
            string t       = db.BANs.Where(m => m.MaBan == id).Select(m => m.TrangThai).FirstOrDefault();

            if (t == "Còn Trống")
            {
                var list = db.BANs.Where(m => m.MaBan == id).Select(m => new { m.MaBan, m.TenBan, m.KHUVUC.TenKhuVuc, m.MoTa }).ToList();
                gridDSBan.DataSource = list;
                gridDSBan.Show();
                gridDSBan2.Hide();
                loadBanTrong();
            }
            else
            {
                var list = db.GOIMONs.Where(m => m.HOADON.MaBan == id).Select(m => new { m.MaHoaDon, m.HOADON.BAN.TenBan, m.HOADON.BAN.KHUVUC.TenKhuVuc, m.THUCDON.TenThucDon, m.SoLuong, m.THUCDON.DonGia, m.ThanhTien }).ToList();
                gridDSBan2.DataSource = list;
                gridDSBan2.Show();
                gridDSBan.Hide();
                loadBanCoKhach();
            }
            //bool is_status = Convert.ToBoolean(int.Parse(t));
            //string status = (is_status) ? "0" : "1";
            //BAN b = db.BANs.Find(id);
            //b.TrangThai = status;
            //gc_item.ImageOptions.Image = (is_status) ? imageList1.Images[0] : imageList1.Images[1];

            //gc_item.Caption = e.Item.Caption;
            //gc_item.Value = e.Item.Value;
            //e.Item.Assign(gc_item);
        }
Пример #5
0
        /// <summary>
        /// Handles the MouseMove event of the Finance control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseEventArgs"/> instance containing the event data.</param>
        private void Finance_MouseMove(object sender, MouseEventArgs e)
        {
            GalleryGroup ga = sender as GalleryGroup;
            GalleryItem  gi = (GalleryItem)ga.SelectionStartItem;

            gi.ToolTip = gi.Name.ToString();
        }
Пример #6
0
        private void InitStrategyGalleryItemList()
        {
            this.galleryItemGroup = this.strategyRibbonGalleryBarItem.Gallery.Groups[0];
            List <string> fileList = this.controller.getStrategyXMLFileList();

            if (fileList.Count > 0)
            {
                List <AnalysisStrategy> strategyList = this.controller.XMLDeserializeAnalysisStrategy();
                foreach (AnalysisStrategy strategy in strategyList)
                {
                    GalleryItem galleryItem1 = new GalleryItem();
                    galleryItem1.Caption     = strategy.StrategyName;
                    galleryItem1.Description = strategy.StrategyDescription;
                    galleryItem1.Hint        = "Right Click To Manage This Strategy";
                    this.galleryItemGroup.Items.Add(galleryItem1);
                }
            }
            else
            {
                GalleryItem galleryItem1 = new GalleryItem();
                galleryItem1.Caption     = "Default";
                galleryItem1.Description = "Default Setting";
                galleryItem1.Hint        = "Right Click To Manage This Strategy";
                this.galleryItemGroup.Items.Add(galleryItem1);
            }
        }
Пример #7
0
        private void galleryControl_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            Point         point   = galleryControl.PointToClient(Control.MousePosition);
            RibbonHitInfo hitInfo = galleryControl.CalcHitInfo(point);

            if (hitInfo.InGalleryItem || hitInfo.HitTest == RibbonHitTest.GalleryImage)
            {
                item = hitInfo.GalleryItem;
                var list = db.GOIMONs.Where(m => m.HOADON.MaBan == item.Value.ToString()).ToList();
                if (list.Count > 0)
                {
                    popupMenu1.ShowPopup(barManager1, new Point(MousePosition.X, MousePosition.Y));
                    btnTinhTien.Enabled = true;
                    btnInHoaDon.Enabled = true;
                }
                else
                {
                    popupMenu3.ShowPopup(barManager1, new Point(MousePosition.X, MousePosition.Y));
                    btnTinhTien.Enabled = false;
                    btnInHoaDon.Enabled = false;
                }
            }
            else
            {
                popupMenu1.HidePopup();
                popupMenu2.ShowPopup(barManager1, new Point(MousePosition.X, MousePosition.Y));
            }
        }
 private void simpleButtonLuuGiaoDien_Click(object sender, EventArgs e)
 {
     Global.local_setting.ApplicationSkinName = GiaoDien;
     Global.local_setting.Save();
     _item = galleryControlGiaoDien.Gallery.GetItemByCaption(GiaoDien);
     XtraMessageBox.Show("Đã lưu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
 }
        public void loadData(int ms)
        {
            maso = ms;
            foreach (HinhBD i in dc.HinhBDs.Where(x => x.bdsid == ms))
            {
                //Border border = new Border();
                //SolidColorBrush solid = new SolidColorBrush();
                //solid.Color = Color.FromArgb(0, 238, 238, 238);
                //border.Background =solid;
                //border.BorderThickness = new Thickness(2);

                GalleryItem a     = new GalleryItem();
                Image       image = new Image();
                image.SetSize(new Size(250, 250));
                if (i.hinh == null || i.hinh.Length <= 5)
                {
                    dc.HinhBDs.DeleteOnSubmit(i);
                    dc.SubmitChanges();
                    continue;
                }
                byte[]       byteBLOBData = i.hinh.ToArray();
                MemoryStream stmBLOBData  = new MemoryStream(byteBLOBData);
                image.Source = ImageHelper.CreateImageFromStream(stmBLOBData);
                a.Caption    = image;
                a.Tag        = i.hinhid;
                group1.Items.Add(a);
            }
        }
Пример #10
0
        private void btnMoBan_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var    gc_item = new GalleryItem();
            string id      = item.Value.ToString();

            TaoHoaDon();
            cboKhachHang.EditValue = "KH0000";
            var maban = item.Value;
            var giobd = Convert.ToDateTime(dateNgayThang.EditValue).ToString("yyyy-MM-dd") + " " + txt_giobd.Text;

            Data.RunCMD($@"insert into tbl_hoadon(mahoadon, maban, ngayban, nguoilap, giobd, sokhach, makh, nguoitd, thoigian) values ('{lblMaHD.Text}','{maban}','{Convert.ToDateTime(dateNgayThang.EditValue).ToString("yyyy-MM-dd")}','TRẦN THỊ NGỌC DIỄM','{giobd}','{Convert.ToInt16(txtSoKhach.Text)}','{cboKhachHang.EditValue}','{Data._strtendangnhap.ToUpper()}','{DateTime.Now}')");


            string is_status = Convert.ToString(Data.GetData($"select sudung from view_ban2 where maban='{id}'").ToString());
            string status    = (is_status == "True") ? "False" : "True";
            //Data.RunCMD($"update tbl_ban set sudung = '{status}' where maban='{id}'");

            // gc_item.ImageOptions.Image = (is_status == "True") ? imageList1.Images[0] : imageList1.Images[1];
            string url = Data.BASE_URL_ICON + Data.GetData($@"select hinh from view_ban2 where maban='{id}'");

            gc_item.ImageOptions.Image = (is_status == "True") ? Image.FromFile(url) : Data.MakeGrayscale((Bitmap)Image.FromFile(url));

            gc_item.Caption = item.Caption;
            gc_item.Value   = item.Value;
            item.Assign(gc_item);


            XtraMessageBox.Show("Đã mở bàn " + item.Caption + " thành công.", "Cảnh Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Пример #11
0
        public ActionResult Edit([Bind(Include = "Id, Tag, Photo")] GalleryItem galleryItem)
        {
            if (!ModelState.IsValid)
            {
                return(View(galleryItem));
            }

            var galleryFromDb = _db.GalleryItems.Find(galleryItem.Id);

            if (galleryItem.Photo != null)
            {
                if (!galleryItem.Photo.IsImage())
                {
                    ModelState.AddModelError("Photo", "Selected file is not image.");
                    return(View(galleryItem));
                }

                Remove(galleryFromDb.Image);

                galleryFromDb.Image = galleryItem.Photo.Save("gallery");
            }

            galleryFromDb.Tag = galleryItem.Tag;
            _db.SaveChanges();

            return(RedirectToAction(nameof(Index)));
        }
Пример #12
0
        public void loadGalleryPhong()
        {
            dt = QLThuePhong.getAll();
            galleryControl1.Gallery.Groups[0].Items.Clear();
            Bitmap image;

            foreach (DataRow dr in dt.Rows)
            {
                int tinhTrang = Int32.Parse(dr["TinhTrangPhong"].ToString());
                if (tinhTrang == 1)
                {
                    image = new Bitmap(Properties.Resources.close);
                }
                else if (tinhTrang == 0)
                {
                    image = new Bitmap(Properties.Resources.checkInRom);
                }
                else
                {
                    image = new Bitmap(Properties.Resources.open);
                }

                GalleryItem item = new GalleryItem(image, dr["TenPhong"].ToString(), dr["MoTaPhong"].ToString() == "" ? "Ghi Chú" : dr["MoTaPhong"].ToString());
                item.Tag = dr["MaPhong"].ToString() + "_" + dr["TinhTrangPhong"].ToString().Trim();
                galleryControl1.Gallery.Groups[0].Items.Add(item);
            }
        }
Пример #13
0
        private void popupMenu1_BeforePopup(object sender, CancelEventArgs e)
        {
            (sender as DevExpress.XtraBars.PopupMenu).ItemLinks[0].Item.Enabled = true;
            (sender as DevExpress.XtraBars.PopupMenu).ItemLinks[1].Item.Enabled = false;

            Point         point   = galleryControl1.PointToClient(Control.MousePosition);
            RibbonHitInfo hitInfo = galleryControl1.CalcHitInfo(point);

            if (hitInfo.InGalleryItem || hitInfo.HitTest == RibbonHitTest.GalleryImage)
            {
                item = hitInfo.GalleryItem;
            }

            if (item != null)
            {
                var             menulist = data.S_Menu(Convert.ToInt32(item.Value)).ToList();
                RibbonPageGroup grp      = Ribbon.Pages[1].Groups[0];

                foreach (BarItemLink lnk in grp.ItemLinks)
                {
                    if (lnk.Item.Name == menulist.FirstOrDefault().FormAdi)
                    {
                        (sender as DevExpress.XtraBars.PopupMenu).ItemLinks[0].Item.Enabled = false;
                        (sender as DevExpress.XtraBars.PopupMenu).ItemLinks[1].Item.Enabled = true;
                    }
                }
            }
        }
Пример #14
0
        GalleryDropDown CreateMarginsGallery()
        {
            GalleryDropDown res    = CreateListBoxGallery();
            GalleryItem     normal = new GalleryItem();

            normal.Image       = Properties.Resources.PageMarginsNormal;
            normal.Caption     = Properties.Resources.MarginsNormal;
            normal.Description = Properties.Resources.MarginsNormalDescription;
            normal.Tag         = new Padding(25, 25, 25, 25);
            GalleryItem narrow = new GalleryItem();

            narrow.Image       = Properties.Resources.PageMarginsNarrow;
            narrow.Caption     = Properties.Resources.MarginsNarrow;
            narrow.Description = Properties.Resources.MarginsNarrowDescription;
            narrow.Tag         = new Padding(12, 12, 12, 12);
            GalleryItem moderate = new GalleryItem();

            moderate.Image       = Properties.Resources.PageMarginsModerate;
            moderate.Caption     = Properties.Resources.MarginsModerate;
            moderate.Description = Properties.Resources.MarginsModerateDescription;
            moderate.Tag         = new Padding(19, 25, 19, 25);
            GalleryItem wide = new GalleryItem();

            wide.Image       = Properties.Resources.PageMarginsWide;
            wide.Caption     = Properties.Resources.MarginsWide;
            wide.Description = Properties.Resources.MarginsWideDescription;
            wide.Tag         = new Padding(50, 25, 50, 25);
            res.Gallery.Groups[0].Items.Add(normal);
            res.Gallery.Groups[0].Items.Add(narrow);
            res.Gallery.Groups[0].Items.Add(moderate);
            res.Gallery.Groups[0].Items.Add(wide);
            res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnMarginsGalleryItemCheckedChanged);
            normal.Checked = true;
            return(res);
        }
Пример #15
0
        private void SampleGallery_DrawItem(object sender, GalleryDrawItemEventArgs e)
        {
            GalleryItem galleryItem = (GalleryItem)e.Item;
            Image       image       = ApplySaturationToImage(galleryItem.Image, _CurrentSaturation);

            e.PaintScaledAndCenteredImage(image, e.ContentBounds, ImageEffect.None, e.Graphics);

            if (_CurrentSaturation == CustomSaturationValue)
            {
                int informationRectangleHeight = TextRenderer.MeasureText(galleryItem.TooltipText, Font).Height + 4;

                Rectangle backgroundRectangle = e.ContentBounds;
                backgroundRectangle.Y      = backgroundRectangle.Bottom - informationRectangleHeight;
                backgroundRectangle.Height = informationRectangleHeight;

                using (Brush b = new SolidBrush(Color.FromArgb(128, Color.White)))
                {
                    e.Graphics.FillRectangle(b, backgroundRectangle);
                }

                Rectangle textRectangle = e.RelativeContentBounds;
                textRectangle.Y      = textRectangle.Bottom - informationRectangleHeight;
                textRectangle.Height = informationRectangleHeight;

                TextRenderer.DrawText(
                    e.Graphics,
                    galleryItem.TooltipText,
                    Font,
                    textRectangle,
                    SystemColors.ControlText,
                    TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);
            }
        }
Пример #16
0
        public async Task <IActionResult> Edit(long id, [Bind("Title,Description,Position,Photo,Video,Meta1,GalleryId,IsPublished,Id,CreateDate,CreatedBy,UpdateDate,UpdatedBy,AppTenantId")] GalleryItem galleryItem, string categoriesHidden)
        {
            if (id != galleryItem.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    galleryItem.UpdatedBy   = User.Identity.Name ?? "username";
                    galleryItem.UpdateDate  = DateTime.Now;
                    galleryItem.AppTenantId = tenant.AppTenantId;
                    _context.Update(galleryItem);
                    _context.SaveChanges();
                    UpdateGalleryItemGalleryItemCategories(galleryItem.Id, categoriesHidden);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GalleryItemExists(galleryItem.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["GalleryId"] = new SelectList(_context.Galleries.ToList(), "Id", "Name", galleryItem.GalleryId);
            return(View(galleryItem));
        }
Пример #17
0
 static void gallery_Drop(object sender, DragEventArgs e)
 {
     e.Handled = true;
     if (dragableItem != null)
     {
         HitTestResult res = VisualTreeHelper.HitTest((GalleryControl)sender, e.GetPosition((GalleryControl)sender));
         if (res.VisualHit == null)
         {
             return;
         }
         GalleryItemControl target = LayoutHelper.FindParentObject <GalleryItemControl>(res.VisualHit);
         if (target != null && target.Item != dragableItem)
         {
             GalleryItemCollection targetCollection = target.Item.Group.Items;
             GalleryItemCollection sourceCollection = dragableItem.Group.Items;
             int targetIndex = targetCollection.IndexOf(target.Item);
             if (targetCollection == sourceCollection)
             {
                 targetCollection.Move(originalIndex, targetIndex);
             }
             else
             {
                 sourceCollection.Remove(dragableItem);
                 targetCollection.Insert(targetIndex, dragableItem);
             }
             dragableItem = null;
         }
     }
 }
        private void slideViewer_BeforeCurrentSlideLoading(object sender, EventArgs e)
        {
            GalleryItem item = GetNextItem((GalleryItem)slideViewer.Tag);

            slideViewer.Tag = item;
            slideViewer.NextSlideImageSource = ((PhotoInfo)item.Caption).Source;
        }
Пример #19
0
        /// <summary>
        /// Handles the MouseClick event of the galleryGroup control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param>
        private void galleryGroup_MouseClick(object sender, MouseButtonEventArgs e)
        {
            GalleryItem item = this.galleryGroup.SelectionStartItem as GalleryItem;

            if (item != null)
            {
                this.ImageSourceContent = this.Resources[item.Name.ToString()] as ImageSource;
                Image img = new Image();
                img.Source = this.ImageSourceContent;

                imgCanvas.Height = 100;
                imgCanvas.Width  = 100;

                stOuter.Height = 100;
                stOuter.Width  = 100;

                imgBorder.Height = 100;
                imgBorder.Width  = 100;

                imgBrush.Visual = img;
                imgBorder.Fill  = imgBrush;

                sliderHeight.Value = 100;
                sliderWidth.Value  = 100;
                LoadXAML();
            }
        }
Пример #20
0
        private void GridViewer_ClickItemEvent(GalleryItem item)
        {
            var page = new PictureDetailViewPage();

            NavigationHelper.NavigationPush(page);
            page.ApplyItem(CurrentGallery, item);
        }
Пример #21
0
    private void InitializeGalleryItem(GameObject item, int index)
    {
        GalleryItem galleryItem = item.GetComponent <GalleryItem>();

        galleryItem.Initialize(flickrDataContainer.GetPhotoData(index), index);
        galleryItemsContainer.AddGaleryItemToList(galleryItem);
    }
Пример #22
0
        GalleryDropDown CreatePrintersGallery()
        {
            GalleryDropDown res            = CreateListBoxGallery();
            PrinterSettings ps             = new PrinterSettings();
            GalleryItem     defaultPrinter = null;

            try {
                foreach (string str in PrinterSettings.InstalledPrinters)
                {
                    GalleryItem item = new GalleryItem();
                    item.Image   = Properties.Resources.PrintDirectLarge;
                    item.Caption = str;
                    res.Gallery.Groups[0].Items.Add(item);
                    ps.PrinterName = str;
                    if (ps.IsDefaultPrinter)
                    {
                        defaultPrinter = item;
                    }
                }
            } catch { }
            res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnPrinterGalleryItemCheckedChanged);
            if (defaultPrinter != null)
            {
                defaultPrinter.Checked = true;
            }
            return(res);
        }
Пример #23
0
        private void Gallery_ItemClick2(object sender, GalleryItemClickEventArgs e)
        {
            for (int i = 0; i < count_group_gallery; i++)
            {
                foreach (GalleryItem item in galleryControl1.Gallery.Groups[i].Items)
                {
                    item.Checked = false;
                }
            }
            var gc_item = new GalleryItem();

            gc_item.Checked            = true;
            gc_item.Caption            = e.Item.Caption;
            gc_item.ImageOptions.Image = e.Item.ImageOptions.Image;
            gc_item.Value = e.Item.Value;
            e.Item.Assign(gc_item);

            MaBan = e.Item.Value.ToString();

            var ds = new DataSet();

            ds = Data.LoadData($@"select * from view_hoadon where maban='{e.Item.Value.ToString()}' and dathanhtoan='0'");
            if (ds.Tables[0].Rows.Count <= 0)
            {
                return;
            }
        }
Пример #24
0
        private string GetGallery(List <string> content)
        {
            string        result = string.Empty;
            List <string> header = new List <string>();

            List <GalleryItem> gallery = new List <GalleryItem>();

            foreach (string line in content)
            {
                var data = line.Split(SPLIT);

                if (content.IndexOf(line) == 0)
                {
                    header = data.ToList();
                    continue;
                }

                GalleryItem item = new GalleryItem
                {
                    Image = data[header.IndexOf(nameof(GalleryItem.Image))],
                    Text  = data[header.IndexOf(nameof(GalleryItem.Text))]
                };
                gallery.Add(item);
            }
            result = JsonSerializeObject(gallery);
            return(result);
        }
Пример #25
0
        private void Gallery_ItemClick2(object sender, GalleryItemClickEventArgs e)
        {
            for (int i = 0; i < count_group_gallery; i++)
            {
                foreach (GalleryItem item in galleryControl1.Gallery.Groups[i].Items)
                {
                    item.Checked = false;
                }
            }
            var gc_item = new GalleryItem();

            gc_item.Checked            = true;
            gc_item.Caption            = e.Item.Caption;
            gc_item.ImageOptions.Image = e.Item.ImageOptions.Image;
            gc_item.Value = e.Item.Value;
            e.Item.Assign(gc_item);

            //string id = e.Item.Value.ToString();
            //Data._strMaBan = id;
            var ds = new DataSet();

            ds = Data.LoadData($@"select * from view_hoadon where maban='{e.Item.Value.ToString()}' and dathanhtoan='0'");
            if (ds.Tables[0].Rows.Count <= 0)
            {
                lblMaHD.Text = "";
                return;
            }
            lblMaHD.Text = ds.Tables[0].Rows[0]["mahoadon"].ToString();

            txt_giobd.EditValue    = Convert.ToDateTime(ds.Tables[0].Rows[0]["giobd"]).ToString("HH:mm");
            cboKhachHang.EditValue = ds.Tables[0].Rows[0]["makh"].ToString();
            groupBox1.Text         = ds.Tables[0].Rows[0]["khuvuc"].ToString().ToUpper() + " - " + ds.Tables[0].Rows[0]["tenban"].ToString();
        }
Пример #26
0
        public void UpdateItem(IGalleryDelegate delegato, GalleryItem item)
        {
            _delegate = delegato;
            _item     = item;

            Tag = item;

            Panel.Background = null;
            Texture.Source   = null;

            if (item == null)
            {
                return;
            }

            var data  = item.GetFile();
            var thumb = item.GetThumbnail();

            Panel.Constraint = item.Constraint;
            Panel.InvalidateMeasure();

            if (thumb != null && (item.IsVideo || (item.IsPhoto && !data.Local.IsDownloadingCompleted)))
            {
                UpdateThumbnail(item, thumb);
            }

            UpdateFile(item, data);
        }
Пример #27
0
        private void btnThanhToan_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var tenban = Data.GetData($@"select tenban from tbl_ban where maban={item.Value}");
            var dgr    = XtraMessageBox.Show($@"Bạn có muốn thanh toán hóa đơn {lblMaHD.Text} cho bàn {tenban} này không?", "Xác Nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dgr != DialogResult.Yes)
            {
                return;
            }
            double phidichvu = Convert.ToDouble(txtPhiDichVu.Text);
            var    giokt     = Convert.ToDateTime(dateNgayThang.EditValue).ToString("yyyy-MM-dd") + " " + txt_giokt.Text;

            Data.RunCMD($@"update tbl_hoadon set dathanhtoan='1', phidichvu='{phidichvu}', giokt='{giokt}' where mahoadon='{lblMaHD.Text}'");
            Data.RunCMD($@"update tbl_ban set sudung='False' where maban='{item.Value}'");
            //LoadBan();
            var    gc_item = new GalleryItem();
            string url     = Data.BASE_URL_ICON + Data.GetData($@"select hinh from view_ban2 where maban='{item.Value}'");

            gc_item.ImageOptions.Image = Data.MakeGrayscale((Bitmap)Image.FromFile(url));
            gc_item.Caption            = item.Caption;
            gc_item.Value   = item.Value;
            gc_item.Checked = true;
            item.Assign(gc_item);

            lblMaHD.Text = "";
        }
Пример #28
0
        /// <summary>
        /// The generate picture gallery.
        /// </summary>
        private static void GeneratePictureGallery()
        {
            bool changed = false;

            for (int index = 0; index < MovieDatabase.Count; index++)
            {
                MovieModel movie = MovieDatabase[index];
                if (!inGallery.Contains(movie.MovieUniqueId))
                {
                    if (movie.SmallPoster != null)
                    {
                        var galleryItem = new GalleryItem(movie.SmallPoster, movie.Title, string.Empty)
                        {
                            Tag = movie.MovieUniqueId
                        };

                        if (!galleryGroup.Items.Contains(galleryItem))
                        {
                            galleryGroup.Items.Add(galleryItem);
                            inGallery.Add(movie.MovieUniqueId);

                            changed = true;
                        }
                    }
                }
            }

            if (changed)
            {
                GalleryChanged(null, null);
            }
        }
Пример #29
0
        void FillImages()
        {
            SimpleButton imageButton = new SimpleButton();

            foreach (SkinContainer cnt in SkinManager.Default.Skins)
            {
                imageButton.LookAndFeel.SetSkinStyle(cnt.SkinName);
                GalleryItem gItem      = new GalleryItem();
                int         groupIndex = 0;
                if (cnt.SkinName.IndexOf("Office") > -1)
                {
                    groupIndex = 1;
                }
                else if (!cnt.IsEmbedded)
                {
                    groupIndex = 2;
                }
                ribbonGallerySkins.Gallery.Groups[groupIndex].Items.Add(gItem);
                gItem.Caption = cnt.SkinName;

                gItem.Image      = GetSkinImage(imageButton, 32, 17, 2);
                gItem.HoverImage = GetSkinImage(imageButton, 70, 36, 5);
                gItem.Caption    = cnt.SkinName;
            }
        }
Пример #30
0
        /// <summary>
        /// Galleryitemdisplays the specified index.
        /// </summary>
        /// <param name="index">The index.</param>
        public void galleryitemdisplay(int index)
        {
            mycanvas.Visibility = Visibility.Visible;

            if (gallerygroup != null)
            {
                GalleryItem gi = (GalleryItem)gallerygroup.Items[index];
                mycanvas.Width       = window1.ActualWidth - 170;
                mycanvas.Height      = window1.ActualHeight - 200;
                canvas_border.Width  = mycanvas.Width + 10;
                canvas_border.Height = mycanvas.Height + 10;

                RectangleImage.Width  = mycanvas.Width - 330;
                RectangleImage.Height = mycanvas.Height - 120;

                RectangleImage.Source  = this.Resources[gi.Name.ToString()] as ImageSource;
                canvastxt.Text         = gi.Name.ToString();
                canvasclose.Visibility = Visibility.Visible;

                RectangleImage.Height = sliderimageSize.Value;
                RectangleImage.Width  = sliderimageSize.Value;
            }
            else
            {
                mycanvas.Visibility = Visibility.Collapsed;
            }
        }
 public async void CoverDropped(object sender, object args)
 {
     var e = (DragEventArgs)args;
     var def = e.GetDeferral();
     var imageId = await e.DataView.GetTextAsync();
     CoverImage = AlbumImages.FirstOrDefault(i => i.Id == imageId) ?? AlbumImages[0];
 }
        private void Play(Grid parent, GalleryItem item, File file)
        {
            try
            {
                if (!file.Local.IsDownloadingCompleted)
                {
                    return;
                }

                if (_surface != null && _mediaPlayerElement != null)
                {
                    _surface.Children.Remove(_mediaPlayerElement);
                    _surface = null;
                }

                if (_mediaPlayer == null)
                {
                    _mediaPlayer = new MediaPlayer();
                    _mediaPlayer.SourceChanged += OnSourceChanged;
                    _mediaPlayer.PlaybackSession.PlaybackStateChanged += OnPlaybackStateChanged;
                    _mediaPlayerElement.SetMediaPlayer(_mediaPlayer);
                }

                var dpi = DisplayInformation.GetForCurrentView().LogicalDpi / 96.0f;
                _mediaPlayer.SetSurfaceSize(new Size(parent.ActualWidth * dpi, parent.ActualHeight * dpi));

                _mediaPlayer.Source           = MediaSource.CreateFromUri(new Uri("file:///" + file.Local.Path));
                _mediaPlayer.IsLoopingEnabled = item.IsLoop;
                _mediaPlayer.Play();

                _surface = parent;
                _surface.Children.Add(_mediaPlayerElement);
            }
            catch { }
        }
    protected override void OnClick(GalleryItem item)
    {
      var mapview = MapView.Active;
      if (mapview == null)
        return;

      TimeBkmGalleryItem galleryItem = item as TimeBkmGalleryItem;    
      mapview.ZoomToAsync(galleryItem.Bookmark);
    }
        public PictureControl(GalleryItem item, Point location)
        {
            InitializeComponent();

              Width = item.Image.Width + ((Width - ClientSize.Width) / 2) + 8;
              Height = item.Image.Height + (Height - ClientSize.Height - 2 * ((Width - ClientSize.Width) / 2)) + 11;
              pictureBoxCover.Image = item.Image;
              Location = location;
              Text = string.Format("{0}x{1}", item.Image.Width, item.Image.Height);
              Show();
        }
 protected override void ValidateUiElement(GalleryItem uiElement)
 {
     if (uiElement == null)
         throw new ArgumentException("uiElement.Tag cannot null. It must contain a DynamicCommandEventLink.");
     if (uiElement.Tag is DynamicCommandEventLink)
     {
         if (String.IsNullOrEmpty((uiElement.Tag as DynamicCommandEventLink).EventTopicName))
             throw new ArgumentException("uiElement.Tag EventTopicName cannot be empty. It must contain the Event to be fired.");
     }
     else
         throw new ArgumentException("uiElement.Tag must be a DynamicCommandEventLink and must contain the Event to be fired.");
 }
 public void RemoveImages(object sender, object args)
 {
     var count = CurrentSelection.Count;
     for (int i = 0; i < count; i++)
     {
         AlbumImages.Remove(CurrentSelection[0]);
     }
     if (CurrentSelection.Count != 0)
         CurrentSelection.Clear();
     var cover = AlbumImages.FirstOrDefault(i => i.Id == CoverImage.Id);
     if (cover == null)
         CoverImage = AlbumImages[0];
 }
Пример #37
0
        private GalleryItemGroup AddItemGroup(string caption, List<Image> domImages)
        {
            var galleryGroup = new GalleryItemGroup() { };
            galleryGroup.Caption = caption;

            var paths = domImages.Select(i => i.LocalPath).ToList();

            foreach (var path in paths)
            {
                var galleryItem = new GalleryItem();
                galleryItem.Image = ImageLiberator.ImageFromFile(path, this);

                galleryGroup.Items.Add(galleryItem);
            }

            return galleryGroup;
        }
Пример #38
0
        void Populate()
        {
            Gallery.Groups.Clear();
            var group = new GalleryItemGroup { Caption = "ShomreiTorahConfig" };

            foreach (var element in Config.GetElement("Databases").Elements()) {
                var connector = new DBConnector(element);
                var item = new GalleryItem {
                    Image = Properties.Resources.SmallDB,
                    Caption = element.Name.LocalName,
                    SuperTip = Utilities.CreateSuperTip(title: connector.Factory.GetType().ToString(), body: connector.ConnectionString),
                    Tag = connector
                };
                group.Items.Add(item);
            }
            Gallery.Groups.Add(group);
            SelectedItem = group.Items[0];
        }
Пример #39
0
        public PictureControl(GalleryItem item, Point location)
        {
            // Activates double buffering
              this.SetStyle(ControlStyles.DoubleBuffer |
             ControlStyles.OptimizedDoubleBuffer |
             ControlStyles.UserPaint |
             ControlStyles.AllPaintingInWmPaint, true);
              this.UpdateStyles();

              InitializeComponent();

              Width = item.Image.Width + ((Width - ClientSize.Width) / 2) + 8;
              Height = item.Image.Height + (Height - ClientSize.Height - 2 * ((Width - ClientSize.Width) / 2)) + 11;
              pictureBoxCover.Image = item.Image;
              Location = location;
              Text = string.Format("{0}x{1}", item.Image.Width, item.Image.Height);
              Show();
        }
Пример #40
0
 GalleryDropDown CreateCollateGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     GalleryItem collated = new GalleryItem();
     collated.Image = Properties.Resources.MultiplePagesLarge;
     collated.Caption = Properties.Resources.Collated;
     collated.Description = Properties.Resources.CollatedDescription;
     collated.Tag = true;
     GalleryItem uncollated = new GalleryItem();
     uncollated.Image = Properties.Resources.MultiplePagesLarge;
     uncollated.Caption = Properties.Resources.Uncollated;
     uncollated.Description = Properties.Resources.UncollatedDescription;
     uncollated.Tag = false;
     res.Gallery.Groups[0].Items.Add(collated);
     res.Gallery.Groups[0].Items.Add(uncollated);
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnCollateGalleryItemCheckedChanged);
     collated.Checked = true;
     return res;
 }
Пример #41
0
        void FillImages()
        {
            SimpleButton imageButton = new SimpleButton();
            foreach(SkinContainer cnt in SkinManager.Default.Skins) {
                imageButton.LookAndFeel.SetSkinStyle(cnt.SkinName);
                GalleryItem gItem = new GalleryItem();
                int groupIndex = 0;
                if(cnt.SkinName.IndexOf("Office") > -1)
                    groupIndex = 1;
                else if(!cnt.IsEmbedded)
                    groupIndex = 2;
                ribbonGallerySkins.Gallery.Groups[groupIndex].Items.Add(gItem);
                gItem.Caption = cnt.SkinName;

                gItem.Image = GetSkinImage(imageButton, 32, 17, 2);
                gItem.HoverImage = GetSkinImage(imageButton, 70, 36, 5);
                gItem.Caption = cnt.SkinName;
            }
        }
Пример #42
0
        public static void CreateGallery(RibbonGalleryBarItem ribbonGalleryBarItemThemes)
        {
            if (_ribbonGalleryBarItemThemes == null) _ribbonGalleryBarItemThemes = ribbonGalleryBarItemThemes;
            var imageButton = new SimpleButton();
            foreach (SkinContainer cnt in SkinManager.Default.Skins)
            {
                imageButton.LookAndFeel.SetSkinStyle(cnt.SkinName);
                var gItem = new GalleryItem();
                int groupIndex = 0;
                ribbonGalleryBarItemThemes.Gallery.Groups[groupIndex].Items.Add(gItem);
                gItem.Caption = cnt.SkinName;

                gItem.Image = GetSkinImage(imageButton, 17, 17, 2);
                gItem.HoverImage = GetSkinImage(imageButton, 41, 41, 5);
                gItem.Caption = cnt.SkinName;
                gItem.Hint = cnt.SkinName;
            }
            ribbonGalleryBarItemThemes.Gallery.InitDropDownGallery += Gallery_InitDropDownGallery;

            ribbonGalleryBarItemThemes.Gallery.ItemClick += Gallery_ItemClick;
        }
Пример #43
0
        public void AddFace(Damany.PortraitCapturer.DAL.DTO.Portrait p)
        {
            var item = new GalleryItem();
            item.Image = p.ImageCopy;
            item.Hint = p.CaptureTime.ToString();
            item.Tag = p;

            _galleryGroup.Items.Add(item);
        }
Пример #44
0
        /// <summary>
        /// The generate picture gallery.
        /// </summary>
        private static void GeneratePictureGallery()
        {
            bool changed = false;

            for (int index = 0; index < MovieDatabase.Count; index++)
            {
                MovieModel movie = MovieDatabase[index];
                if (!inGallery.Contains(movie.MovieUniqueId))
                {
                    if (movie.SmallPoster != null)
                    {
                        var galleryItem = new GalleryItem(movie.SmallPoster, movie.Title, string.Empty)
                            { Tag = movie.MovieUniqueId };

                        if (!galleryGroup.Items.Contains(galleryItem))
                        {
                            galleryGroup.Items.Add(galleryItem);
                            inGallery.Add(movie.MovieUniqueId);

                            changed = true;
                        }
                    }
                }
            }

            if (changed)
            {
                GalleryChanged(null, null);
            }
        }
Пример #45
0
        void CompareFaces(object result)
        {
            var collections = ((ICollection[])result)[0];

            var targetFs = new FaceProcessingWrapper.FaceSpecification();
            _faceComparer.CalcFeature(OpenCvSharp.IplImage.FromBitmap((Bitmap)this.targetPic.Image), targetFs);

            this.RunInUIThread(() =>
            {
                repositoryItemProgressBar1.Maximum = collections.Count;
                this.ClearFaceList();
            });

            int count = 0;
            foreach (Damany.PortraitCapturer.DAL.DTO.Portrait face in collections)
            {
                _cts.Token.ThrowIfCancellationRequested();

                var curPortrait = face;
                var curFaceImg = curPortrait.ImageCopy;
                var clone = AForge.Imaging.Image.Clone((Bitmap) curFaceImg);
                this.currentPic.RunInUIThread(() =>
                                                  {
                                                      this.currentPic.Image = (Image)clone;
                                                      currentPic.Refresh();
                                                  });

                var curFs = new FaceProcessingWrapper.FaceSpecification();
                var clone2 = AForge.Imaging.Image.Clone((Bitmap)curFaceImg);
                var suc = _faceComparer.CalcFeature(OpenCvSharp.IplImage.FromBitmap((Bitmap)clone2), curFs);
                ((IDisposable)clone2).Dispose();
                if (suc)
                {
                    var sim = _faceComparer.CmpFace(targetFs, curFs);
                    if (sim > Interlocked.Read(ref _currentAccuracy))
                    {
                        var clone3 = AForge.Imaging.Image.Clone((Bitmap)curFaceImg);
                        this.galleryControl1.RunInUIThread(() =>
                        {
                            var item = new GalleryItem((Image)clone3,
                                curPortrait.CaptureTime.ToShortDateString(),
                                curPortrait.CaptureTime.ToShortTimeString());
                            item.Hint = curPortrait.CaptureTime.ToString();
                            this.galleryControl1.Gallery.Groups[0].Items.Add(item);
                        });
                    }
                }

                var c = ++count;
                this.RunInUIThread(() =>
                                       {
                                           progressBar.EditValue = c;
                                           var msg = string.Format("已比对: {0}, 待比对: {1}", c, collections.Count - c);
                                           counter.Caption = msg;
                                       });
            }
        }
Пример #46
0
 GalleryDropDown CreateOrientationGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     GalleryItem portraitItem = new GalleryItem();
     portraitItem.Image = Properties.Resources.PageOrientationPortrait;
     portraitItem.Caption = Properties.Resources.PortraitOrientation;
     GalleryItem landscapeItem = new GalleryItem();
     landscapeItem.Image = Properties.Resources.PageOrientationLandscape;
     landscapeItem.Caption = Properties.Resources.LandscapeOrientation;
     res.Gallery.Groups[0].Items.Add(portraitItem);
     res.Gallery.Groups[0].Items.Add(landscapeItem);
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnOrientationGalleryItemCheckedChanged);
     portraitItem.Checked = true;
     return res;
 }
Пример #47
0
 GalleryDropDown CreateMarginsGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     GalleryItem normal = new GalleryItem();
     normal.Image = Properties.Resources.PageMarginsNormal;
     normal.Caption = Properties.Resources.MarginsNormal;
     normal.Description = Properties.Resources.MarginsNormalDescription;
     normal.Tag = new Padding(25, 25, 25, 25);
     GalleryItem narrow = new GalleryItem();
     narrow.Image = Properties.Resources.PageMarginsNarrow;
     narrow.Caption = Properties.Resources.MarginsNarrow;
     narrow.Description = Properties.Resources.MarginsNarrowDescription;
     narrow.Tag = new Padding(12, 12, 12, 12);
     GalleryItem moderate = new GalleryItem();
     moderate.Image = Properties.Resources.PageMarginsModerate;
     moderate.Caption = Properties.Resources.MarginsModerate;
     moderate.Description = Properties.Resources.MarginsModerateDescription;
     moderate.Tag = new Padding(19, 25, 19, 25);
     GalleryItem wide = new GalleryItem();
     wide.Image = Properties.Resources.PageMarginsWide;
     wide.Caption = Properties.Resources.MarginsWide;
     wide.Description = Properties.Resources.MarginsWideDescription;
     wide.Tag = new Padding(50, 25, 50, 25);
     res.Gallery.Groups[0].Items.Add(normal);
     res.Gallery.Groups[0].Items.Add(narrow);
     res.Gallery.Groups[0].Items.Add(moderate);
     res.Gallery.Groups[0].Items.Add(wide);
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnMarginsGalleryItemCheckedChanged);
     normal.Checked = true;
     return res;
 }
Пример #48
0
        private void UpdatePageGallery()
        {
            this.galleryControl1.Gallery.BeginUpdate();
            this.galleryControl1.Gallery.Groups.Clear();

            var gq = from Damany.PortraitCapturer.DAL.DTO.Portrait item in portraits
                     group item by item.CaptureTime.Date.AddHours(item.CaptureTime.Hour) into g
                     orderby g.Key ascending
                     select g;

            foreach (var group in gq)
            {
                var gg = new GalleryItemGroup();
                gg.Caption = group.Key.ToString("yyyy年MM月dd日 HH:00") + " - " + group.Key.AddHours(1).ToString("yyyy年MM月dd日 HH:00");

                foreach (var item in group)
                {
                    var gi = new GalleryItem(item.Thumbnail, item.CaptureTime.ToShortTimeString(), null);
                    gi.Hint = item.CaptureTime.ToString();
                    gi.Tag = item;
                    gg.Items.Add(gi);
                }

                this.galleryControl1.Gallery.Groups.Add(gg);
            }

            galleryControl1.Gallery.EndUpdate();
        }
Пример #49
0
 GalleryDropDown CreatePrintersGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     PrinterSettings ps = new PrinterSettings();
     GalleryItem defaultPrinter = null;
     try {
         foreach(string str in PrinterSettings.InstalledPrinters) {
             GalleryItem item = new GalleryItem();
             item.Image = Properties.Resources.PrintDirectLarge;
             item.Caption = str;
             res.Gallery.Groups[0].Items.Add(item);
             ps.PrinterName = str;
             if(ps.IsDefaultPrinter)
                 defaultPrinter = item;
         }
     } catch { }
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnPrinterGalleryItemCheckedChanged);
     if(defaultPrinter != null)
         defaultPrinter.Checked = true;
     return res;
 }
Пример #50
0
        /// <summary>
        /// Setup the colour selection gallery
        /// </summary>
        void SetupSkinGallery()
        {
            SimpleButton imageButton = new SimpleButton();
            foreach (SkinContainer cnt in SkinManager.Default.Skins)
            {
                imageButton.LookAndFeel.SetSkinStyle(cnt.SkinName);
                GalleryItem gItem = new GalleryItem();

                int groupIndex = 1;
                if (cnt.SkinName.IndexOf("Office") > -1)
                    groupIndex = 0;

                galleryColours.Gallery.Groups[groupIndex].Items.Add(gItem);
                gItem.Caption = cnt.SkinName;

                gItem.Image = GetSkinImage(imageButton, 32, 17, 2);
                gItem.HoverImage = GetSkinImage(imageButton, 70, 36, 5);
                gItem.Caption = cnt.SkinName;
                gItem.Hint = cnt.SkinName;
                galleryColours.Gallery.Groups[1].Visible = true;
            }
        }
Пример #51
0
        private void galleryPicture_HoveredItemChanged(object sender, GalleryHoveredItemChangedEventArgs e)
        {
            if (sender == null)
              {
            return;
              }

              if (e.NewValue != null)
              {
            _displayedGalleryItem = (GalleryItem)e.NewValue;
            if (picControl != null && picControl.Text != "")
            {
              picControl.Close();
            }
            picControl = new PictureControl((GalleryItem)e.NewValue, (sender as Gallery).PopupOwnerBounds.Location);
              }
              else
              {
            if (e.OldValue != null && e.OldValue == _displayedGalleryItem)
            {
              return;
            }
            if (picControl != null)
            {
              picControl.Close();
            }
              }
        }
Пример #52
0
        private void btnImageUpload_Click(object sender, EventArgs e)
        {
            try
            {
                List<HinhAnh> listHinhAnh = new List<HinhAnh>();
                OpenFileDialog open = new OpenFileDialog();
                open.Filter = "Hình ảnh(*.png,*.bmp,*.jpg,*.jpeg)|*.png;*.bmp;*.jpg;*.jpeg";
                open.Title = "My Image Browser";
                open.Multiselect = true;

                if (open.ShowDialog() == DialogResult.OK)
                {
                    List<FileInfo> listFileInfoDaCo = new List<FileInfo>();
                    List<HinhAnh> listHinhAnhDaCo = new List<HinhAnh>();
                    List<FileInfo> listHinhAnhSeUpload = new List<FileInfo>();
                    Boolean coUploadHinhAnhDaCo = false;
                    //listHinhAnh = HinhAnh.getAll();

                    foreach (string file in open.FileNames)
                    {
                        FileInfo fileinfo = new FileInfo(file);
                        string ImageNameNoExtension = Path.GetFileNameWithoutExtension(fileinfo.Name);
                        //HinhAnh hinhanhcheck = listHinhAnh.Where(h => h.path == (fileinfo.Name.ToString() + ".JPEG")).FirstOrDefault();
                        HinhAnh hinhanhcheck = HinhAnh.getQuery().Where(h => h.path == (fileinfo.Name.ToString() + ".JPEG")).FirstOrDefault();
                        if (hinhanhcheck == null)
                        {
                            listHinhAnhSeUpload.Add(fileinfo);
                        }
                        else
                        {
                            listFileInfoDaCo.Add(fileinfo);
                            listHinhAnhDaCo.Add(hinhanhcheck);
                        }
                    }
                    if (listFileInfoDaCo.Count > 0)
                    {
                        if (XtraMessageBox.Show(String.Format("Có {0} ảnh đã có trên Host, bạn có muốn dùng ảnh cũ?", listFileInfoDaCo.Count), "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                        {
                            coUploadHinhAnhDaCo = false;
                            foreach (HinhAnh hinhanh in listHinhAnhDaCo)
                            {
                                HinhAnh hinhanhADD = new HinhAnh();
                                hinhanhADD.path = hinhanh.path;
                                listTemp.Add(hinhanhADD);

                                GalleryItem it = new GalleryItem();
                                it.Image = (Image)hinhanh.IMAGE;
                                it.Tag = hinhanh.path;
                                galleryControlImage.Gallery.Groups[0].Items.Add(it);
                            }
                        }
                        else
                        {
                            coUploadHinhAnhDaCo = true;
                        }
                    }
                    splashScreenManager.ShowWaitForm();
                    foreach (FileInfo fileinfo in listHinhAnhSeUpload)
                    {
                        UploadHinhAnh(fileinfo, false);
                    }
                    splashScreenManager.CloseWaitForm();
                    if (coUploadHinhAnhDaCo)
                    {
                        foreach (FileInfo fileinfo in listFileInfoDaCo)
                        {
                            UploadHinhAnh(fileinfo, true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(this.Name + "->btnImageUpload_Click: " + ex.Message);
            }
        }
Пример #53
0
 private void UploadHinhAnh(FileInfo fileinfo, Boolean coDoiTenHinhAnh)
 {
     bool open = false;
     try
     {
         string fPath = fileinfo.ToString();
         string file_name = fileinfo.Name.ToString();
         if (coDoiTenHinhAnh)
         {
             //file_name = StringHelper.RandomName(15);
             MyForm.frmDoiTenHinh frm = new MyForm.frmDoiTenHinh(fileinfo.Name.ToString());
             if (frm.ShowDialog().Equals(DialogResult.No))
             {
                 return;
             }
             else
             {
                 file_name = frm.name;
                 open = true;
                 splashScreenManager.ShowWaitForm();
             }
         }
         HinhAnh hinhanh = new HinhAnh();
         hinhanh.FILE_NAME = file_name;
         hinhanh.IMAGE = (Bitmap)Bitmap.FromFile(fPath);
         switch (comboBoxEdit1.SelectedIndex)
         {
             case 0:
                 hinhanh.MAX_SIZE = GIUNGUYEN;
                 break;
             case 1:
                 hinhanh.MAX_SIZE = LON;
                 break;
             case 2:
                 hinhanh.MAX_SIZE = VUA;
                 break;
             case 3:
                 hinhanh.MAX_SIZE = NHO;
                 break;
             default:
                 hinhanh.MAX_SIZE = GIUNGUYEN;
                 break;
         }
         if (hinhanh.upload() > 0)
         {
             listTemp.Add(hinhanh);
             GalleryItem it = new GalleryItem();
             it.Image = (Image)hinhanh.IMAGE;
             it.Tag = hinhanh.path;
             galleryControlImage.Gallery.Groups[0].Items.Add(it);
         }
         if(open)
             splashScreenManager.CloseWaitForm();
     }
     catch (Exception ex)
     {
         Debug.WriteLine(this.Name + "->UploadHinhAnh: " + ex.Message);
     }
 }
Пример #54
0
 private void LoadHinhAnh(List<HinhAnh> list)
 {
     try
     {
         galleryControlImage.Gallery.Groups[0].Items.Clear();
         foreach (HinhAnh hinhanh in list)
         {
             GalleryItem it = new GalleryItem();
             it.Image = (Image)hinhanh.getImage();
             it.Tag = hinhanh.path;
             galleryControlImage.Gallery.Groups[0].Items.Add(it);
         }
     }
     catch (Exception)
     {
         XtraMessageBox.Show("Có lỗi trong khi load ảnh!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private GalleryItem AddGalleryItem(Image img)
 {
     var item = new GalleryItem(img, null, null);
     galleryControl1.Gallery.Groups[0].Items.Add(item);
     return item;
 }
Пример #56
0
 GalleryDropDown CreateDuplexGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     GalleryItem oneSided = new GalleryItem();
     oneSided.Image = Properties.Resources.MultiplePagesLarge;
     oneSided.Caption = Properties.Resources.OneSide;
     oneSided.Description = Properties.Resources.OneSideDescription;
     oneSided.Tag = false;
     GalleryItem twoSided = new GalleryItem();
     twoSided.Image = Properties.Resources.MultiplePagesLarge;
     twoSided.Caption = Properties.Resources.TwoSide;
     twoSided.Description = Properties.Resources.TwoSideDescription;
     twoSided.Tag = false;
     res.Gallery.Groups[0].Items.Add(oneSided);
     res.Gallery.Groups[0].Items.Add(twoSided);
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnDuplexGalleryItemCheckedChanged);
     oneSided.Checked = true;
     return res;
 }
Пример #57
0
 /// <summary>
 ///   Get the Coverart out of the selected TRack item and fill the Ribbon Gallery
 /// </summary>
 public void SetGalleryItem()
 {
     Image img = null;
       ClearGallery();
       try
       {
     TrackData track = TracksGridView.SelectedTrack;
     ApplicationCommands.SaveAsThumb.Enabled = false;
     if (track.Pictures.Count > 0)
     {
       img = track.Pictures[0].Data;
       if (img != null)
       {
     GalleryItem galleryItem = new GalleryItem(img, "", "");
     galleryPicture.Items.Add(galleryItem);
     ApplicationCommands.SaveAsThumb.Enabled = true;
       }
     }
       }
       catch (Exception) { }
 }
Пример #58
0
 GalleryDropDown CreatePrintStyleGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     res.Gallery.ItemCheckMode = ItemCheckMode.SingleRadio;
     memoStyle = new GalleryItem();
     memoStyle.Image = Properties.Resources.MemoStyle;
     memoStyle.Caption = Properties.Resources.MemoStyleString;
     tableStyle = new GalleryItem();
     tableStyle.Image = Properties.Resources.TableStyle;
     tableStyle.Caption = Properties.Resources.TableStyleString;
     res.Gallery.Groups[0].Items.Add(memoStyle);
     res.Gallery.Groups[0].Items.Add(tableStyle);
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnPrintStyleGalleryItemCheckedChanged);
     memoStyle.Checked = true;
     return res;
 }
Пример #59
0
 GalleryDropDown CreatePageSizeGallery()
 {
     GalleryDropDown res = CreateListBoxGallery();
     GalleryItem letter = new GalleryItem();
     letter.Image = Properties.Resources.PaperKind_Letter;
     letter.Caption = Properties.Resources.PaperKindLetter;
     letter.Description = Properties.Resources.PaperKindLetterDescription;
     letter.Tag = PaperKind.Letter;
     GalleryItem tabloid = new GalleryItem();
     tabloid.Image = Properties.Resources.PaperKind_Tabloid;
     tabloid.Caption = Properties.Resources.PaperKindTabloid;
     tabloid.Description = Properties.Resources.PaperKindTabloidDescription;
     tabloid.Tag = PaperKind.Tabloid;
     GalleryItem legal = new GalleryItem();
     legal.Image = Properties.Resources.PaperKind_Legal;
     legal.Caption = Properties.Resources.PaperKindLegal;
     legal.Description = Properties.Resources.PaperKindLegalDescription;
     legal.Tag = PaperKind.Legal;
     GalleryItem executive = new GalleryItem();
     executive.Image = Properties.Resources.PaperKind_Executive;
     executive.Caption = Properties.Resources.PaperKindExecutive;
     executive.Description = Properties.Resources.PaperKindExecutiveDescription;
     executive.Tag = PaperKind.Executive;
     GalleryItem a3 = new GalleryItem();
     a3.Image = Properties.Resources.PaperKind_A3;
     a3.Caption = Properties.Resources.PaperKindA3;
     a3.Description = Properties.Resources.PaperKindA3Description;
     a3.Tag = PaperKind.A3;
     GalleryItem a4 = new GalleryItem();
     a4.Image = Properties.Resources.PaperKind_A4;
     a4.Caption = Properties.Resources.PaperKindA4;
     a4.Description = Properties.Resources.PaperKindA4Description;
     a4.Tag = PaperKind.A4;
     GalleryItem a5 = new GalleryItem();
     a5.Image = Properties.Resources.PaperKind_A5;
     a5.Caption = Properties.Resources.PaperKindA5;
     a5.Description = Properties.Resources.PaperKindA5Description;
     a5.Tag = PaperKind.A5;
     GalleryItem a6 = new GalleryItem();
     a6.Image = Properties.Resources.PaperKind_A6;
     a6.Caption = Properties.Resources.PaperKindA6;
     a6.Description = Properties.Resources.PaperKindA6Description;
     a6.Tag = PaperKind.A6;
     res.Gallery.Groups[0].Items.Add(letter);
     res.Gallery.Groups[0].Items.Add(tabloid);
     res.Gallery.Groups[0].Items.Add(legal);
     res.Gallery.Groups[0].Items.Add(executive);
     res.Gallery.Groups[0].Items.Add(a3);
     res.Gallery.Groups[0].Items.Add(a4);
     res.Gallery.Groups[0].Items.Add(a5);
     res.Gallery.Groups[0].Items.Add(a6);
     res.Gallery.ItemCheckedChanged += new GalleryItemEventHandler(OnPaperSizeGalleryItemCheckedChanged);
     a4.Checked = true;
     return res;
 }
 //bool Changed = false;
 public ucGiaoDienvaNgonNgu()
 {
     InitializeComponent();
     DevExpress.XtraBars.Helpers.SkinHelper.InitSkinGallery(galleryControlGiaoDien, true);
     _item = galleryControlGiaoDien.Gallery.GetItemByCaption(GiaoDien);
 }