public VideoQueryForm() { InitializeComponent(); PopulateSearchScope(); setListViewColumns(); rand = new Random((int)DateTime.Now.Ticks); var now = DateTime.Now; this.timeTO.EditValue = now; this.timeFrom.EditValue = now.AddDays(-1); var videoNavigator = new NullNavigator(); this.controlNavigator1.NavigatableControl = videoNavigator; videoGrid.DataSource = _videos; //licenseplatesGrid.DataSource = _licensePlates; faceGalleryControl.Gallery.ItemCheckedChanged += Gallery_ItemCheckedChanged; _galleryGroup = new GalleryItemGroup(); faceGalleryControl.Gallery.Groups.Add(_galleryGroup); }
public static void InitializeGallery(GalleryControlGallery gallery, StorageVolumeInfoCollection volumes, AllowMedia allowMediaDelegate) { gallery.Groups.Clear(); gallery.ShowGroupCaption = false; gallery.ShowItemText = true; gallery.ItemImageLocation = DevExpress.Utils.Locations.Left; gallery.FixedImageSize = false; gallery.AllowHoverImages = false; gallery.StretchItems = true; GalleryItemGroup group = new GalleryItemGroup(); gallery.Groups.Add(group); foreach (StorageVolumeInfo volume in volumes) { if (allowMediaDelegate != null && !allowMediaDelegate(volume)) { continue; } GalleryItem item = CreateItem(volume); item.Enabled = allowMediaDelegate == null ? true : allowMediaDelegate(volume); item.Image = FileSystemImageCache.Cache.GetImage(volume.HintName, IconSizeType.Medium, new Size(32, 32)); group.Items.Add(item); } }
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(); }
private void ReLoadImageFilesToGallery() { try { string currentImagePath = buttonEditGalleryImagePath.Text + "\\"; //ConfigManager.GetAppConfig("WorkPathImage"); DirectoryInfo theFolder = new DirectoryInfo(currentImagePath); List <FileInfo> fileList = new List <FileInfo>(); foreach (string searchStr in searchStrs) { fileList.AddRange(theFolder.GetFiles(searchStr)); } GalleryItemGroup group = _galleryControl.Gallery.Groups[0]; group.Items.Clear(); foreach (FileInfo fileInfo in fileList) { System.Drawing.Image image = System.Drawing.Image.FromFile(fileInfo.FullName); GalleryItem item = new GalleryItem(image, fileInfo.Name, ""); item.Tag = fileInfo.FullName; group.Items.Add(item); } } catch (System.Exception ex) { _logger.Error("Error occurred in LoadImageFilesToGallery:" + ex.Message); } }
public void CustomerUpdate(decimal custno, string custname, string register) { #region Get group GalleryItemGroup group = null; if (galleryCust.Gallery.Groups.Count > 0) { group = galleryCust.Gallery.Groups[0]; } else { group = new GalleryItemGroup(); galleryCust.Gallery.Groups.Add(group); } #endregion #region Check item is exists GalleryItem item = null; for (int i = 0; i < group.Items.Count; i++) { item = group.Items[i]; if (item.Tag != null) { decimal d = Static.ToDecimal(item.Tag); if (custno == d) { item.Caption = custname; item.Description = register; return; } } } #endregion }
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); } }
public void CustomerDel(decimal custno) { #region Get group GalleryItemGroup group = null; if (galleryCust.Gallery.Groups.Count > 0) { group = galleryCust.Gallery.Groups[0]; } else { group = new GalleryItemGroup(); } #endregion #region Check item is exists for (int i = 0; i < group.Items.Count; i++) { GalleryItem item = group.Items[0]; if (item.Tag != null) { decimal d = Static.ToDecimal(item.Tag); if (custno == d) { group.Items.Remove(item); } } } #endregion }
private void BindFilterFile() { CriteriaOperator currentCriteria = _viewContext.GetFilter(_gridFilter); var viewItems = GetListFilterItems(); var items = viewItems.OrderBy(i => i.Order).ToList(); GalleryItemGroup itemGroup = new GalleryItemGroup(); foreach (var item in items) { GalleryItem galleryItem = new FilterGalleryItem(item); galleryItem.Caption = item.DisplayName; galleryItem.Image = WinFormsResourceService.GetBitmap("tag"); galleryItem.HoverImage = galleryItem.Image; string filterString = item.FilterString; bool isCrietiaEqual = IsCriteriaOperatorEquals(currentCriteria, CriteriaOperator.TryParse(filterString)); galleryItem.Checked = isCrietiaEqual; itemGroup.Items.Add(galleryItem); } if (!itemGroup.Items.Cast <GalleryItem>().Any(i => i.Checked) && itemGroup.Items.Count > 0) { itemGroup.Items.Cast <GalleryItem>().Last().Checked = true; } this.Gallery.Groups.Clear(); this.Gallery.Groups.Add(itemGroup); }
private void UpdateSuggestedKeywordsGallery() { this.gcSuggestedKeywords.Gallery.BeginUpdate(); try { this.gcSuggestedKeywords.Gallery.Groups.Clear(); foreach (TokenEditToken token in this.teAssignedKeywords.Properties.SelectedItems) { DmTag tag = (DmTag)token.Value; GalleryItemGroup group = null; IEnumerable <DmTagNodeReversed> suggestedTags = Model.GetSuggestedTags(tag); foreach (DmTagNodeReversed suggested in suggestedTags) { if (File.ContainsTag(suggested.Tag)) { continue; } if (group == null) { group = new GalleryItemGroup(); group.Caption = tag.Value; group.Tag = tag; gcSuggestedKeywords.Gallery.Groups.Add(group); } GalleryItem item = new GalleryItem() { Caption = suggested.Tag.Value, Tag = suggested.Tag }; group.Items.Add(item); } } } finally { this.gcSuggestedKeywords.Gallery.EndUpdate(); } }
internal static void Add(WorkItem workItem) { RibbonPage ribbonPage = new RibbonPage(ExtensionSiteNames.RibbonLookAndFeel); workItem.UIExtensionSites[ExtensionSiteNames.Ribbon].Add <RibbonPage>(ribbonPage); workItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonLookAndFeel, ribbonPage); RibbonPageGroup ribbonGroup = new RibbonPageGroup(ExtensionSiteNames.RibbonSkins); workItem.UIExtensionSites[ExtensionSiteNames.RibbonLookAndFeel].Add <RibbonPageGroup>(ribbonGroup); workItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonSkins, ribbonGroup); // Next create the Gallery within the Ribbon Group RibbonGalleryBarItem ribbonGallery = new RibbonGalleryBarItem(); ribbonGallery.Caption = ExtensionSiteNames.RibbonSkinGallery; ribbonGallery.Gallery.AllowHoverImages = true; ribbonGallery.Gallery.ColumnCount = 3; //ribbonGallery.Gallery.DistanceBetweenItems = 1; ribbonGallery.Gallery.ImageSize = new Size(imageWidth, imageHeight); ribbonGallery.Gallery.HoverImageSize = new Size(hoverWidth, hoverHeight); workItem.UIExtensionSites[ExtensionSiteNames.RibbonSkins].Add <BarItem>(ribbonGallery); // Pass the WorkItem which added the command into the RibbonGalleryUIAdapter. This allows the command to be fired. workItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonSkinGallery, new RibbonGalleryDynamicUIAdapter(ribbonGallery, workItem)); // Then create the group within the gallery GalleryItemGroup galleryGroup = new GalleryItemGroup(); galleryGroup.Caption = ExtensionSiteNames.RibbonSkinGalleryGroup; workItem.UIExtensionSites[ExtensionSiteNames.RibbonSkinGallery].Add <GalleryItemGroup>(galleryGroup); workItem.UIExtensionSites.RegisterSite(ExtensionSiteNames.RibbonSkinGalleryGroup, new RibbonGalleryGroupDynamicUIAdapter(galleryGroup)); AddAllMenuItems(workItem); }
private void MainClassManager_Load(object sender, EventArgs e) { // mainGallery.Dock = DockStyle.Fill; SchoolclassServices ss = new SchoolclassServices(); string ClassName = ""; GalleryItemGroup group1 = new GalleryItemGroup();; Image img = null; foreach (Student user in usersList) { ClassName = ss.GetClassName(Convert.ToInt32(user.SClass)); if (group1.Caption != ClassName) { group1 = new GalleryItemGroup(); mainGallery.Gallery.Groups.Add(group1); } group1.Caption = ClassName; img = Image.FromFile(GetDataDir() + ClassName + "\\" + user.SPicture); group1.Items.Add(new GalleryItem(img, user.SName, "")); } mainGallery.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside; mainGallery.Gallery.ImageSize = new Size(120, 90); mainGallery.Gallery.ShowItemText = true; mainGallery.Gallery.Groups.Add(group1); }
private void BindFilterFile() { CriteriaOperator currentCriteria = _view.Context.GetFilter(_gridFilter); var viewItems = GetListFilterItems(); IEnumerable <ListFilterItem> items = viewItems.OrderBy(i => i.Order).ToList(); GalleryItemGroup itemGroup = new GalleryItemGroup(); foreach (ListFilterItem item in items) { GalleryItem galleryItem = new GalleryItem(); galleryItem.Caption = item.FilterName + " "; galleryItem.Image = (Image)Properties.Resources.ResourceManager.GetObject("tag"); galleryItem.HoverImage = galleryItem.Image; string filterString = item.FilterString; bool isCrietiaEqual = IsCriteriaOperatorEquals(currentCriteria, CriteriaOperator.TryParse(filterString)); galleryItem.Checked = isCrietiaEqual; galleryItem.Tag = item.FilterString + "¹" + item.Name; itemGroup.Items.Add(galleryItem); } if (!itemGroup.Items.Cast <GalleryItem>().Any(i => i.Checked) && itemGroup.Items.Count > 0) { itemGroup.Items.Cast <GalleryItem>().Last().Checked = true; } this.Gallery.Groups.Clear(); this.GalleryDropDown.Gallery.Groups.Clear(); this.Gallery.Groups.Add(itemGroup); this.GalleryDropDown.Gallery.Groups.AddRange(new[] { itemGroup }); }
/// <summary> /// 绑定数据显示 /// </summary> /// <param name="fileName">文件名,如果查询则传入</param> private void BindData(string fileName = "") { //根据条件进行过滤 var items = loader.Search(this.lstCollection.ToList(), this.lstCategory.ToList(), this.lstSize.ToList(), fileName); //对图标展示进行分类展示 galleryControl1.Gallery.Groups.Clear(); foreach (string key in items.Keys) { var display = StringUtil.ToProperCase(key.Replace("%20", " ")); GalleryItemGroup group = new GalleryItemGroup() { Caption = display }; galleryControl1.Gallery.Groups.Add(group); foreach (GalleryItem item in items[key]) { item.ItemClick += (s, e) => { //选择处理 ProcessIconSelected(item.ImageOptions.Image, item.Description); }; } group.Items.AddRange(items[key].ToArray()); } }
void InitFont(GalleryItemGroup groupDropDown, GalleryItemGroup galleryGroup) { FontFamily[] fonts = FontFamily.Families; for (int i = 0; i < fonts.Length; i++) { if (!FontFamily.Families[i].IsStyleAvailable(FontStyle.Regular)) { continue; } string fontName = fonts[i].Name; GalleryItem item = new GalleryItem(); item.Caption = fontName; item.Image = GetFontImage(32, 28, fontName, 12); item.HoverImage = item.Image; item.Description = fontName; item.Hint = fontName; try { item.Tag = new Font(fontName, 9); if (DevExpress.Utils.ControlUtils.IsSymbolFont((Font)item.Tag)) { item.Tag = new Font(DevExpress.Utils.AppearanceObject.DefaultFont.FontFamily, 9); item.Description += " (Symbol Font)"; } } catch { continue; } groupDropDown.Items.Add(item); galleryGroup.Items.Add(item); } }
/// <summary> /// Retorna o tema default caso algo errado => Office 2013 Light Gray /// </summary> /// <param name="group"></param>Grupo do tema /// <param name="indexGroup"></param> /// <returns></returns> private static void PrintSkins(GalleryItemGroup group, TypeSkinTheme indexGroup) { foreach (GalleryItem item in group.Items) { //Esse eh o skin que eu preciso salvar string skin = item.Caption; Console.WriteLine(skin); } }
private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { GalleryItemGroup menuItem = dependencyObject as GalleryItemGroup; if (menuItem != null) { GalleryItemSelectedCommandBehavior behavior = GetOrCreateBehavior(menuItem); behavior.CommandParameter = e.NewValue; } }
private GalleryItemGroup CreateAlbumGroup(AlbumData albumData) { GalleryItemGroup group = new GalleryItemGroup(); group.Tag = albumData; group.Caption = albumData.Name; group.CaptionAlignment = GalleryItemGroupCaptionAlignment.Stretch; // group.CaptionControl = CreateAlbumGroupCaptionControl(albumData); return(group); }
public void LoadValue(CatShow catShow) { if (catShow == null) { return; } var gc = galleryControl1; gc.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside; gc.Gallery.ImageSize = new Size(120, 90); gc.Gallery.ShowItemText = true; gc.Gallery.Groups.Clear(); foreach (var cse in catShow.CatEvents) { var group = new GalleryItemGroup { CaptionControl = new CatShowGroupCaptionControl { CaptionText = cse.EventName } }; group.CaptionAlignment = GalleryItemGroupCaptionAlignment.Stretch; group.CaptionControlSize = new Size(20, 20); foreach (var sec in cse.EventSections) { var item = new GalleryItem { // Caption = sec.EventSectionName, Image = Image.FromFile("c:\\images\\ford.jpg") Caption = sec.EventSectionName, Image = ImageLoader.Instance.GetImageInfo("ford").Image }; group.Items.Add(item); } gc.Gallery.Groups.Add(group); } var i = 1; foreach (GalleryItemGroup g in gc.Gallery.Groups) { g.Items.Add(new GalleryItem { Caption = $"caption {i}" }); i++; } // gc.Refresh(); //var sz = new Size //{ // Height = galleryControl1.Gallery.GalleryControl.Height, // Width = galleryControl1.Gallery.GalleryControl.Width //}; //galleryControl1.MinimumSize = sz; gc.Refresh(); }
public Form1() { InitializeComponent(); GalleryItemGroup Group = new GalleryItemGroup(); Group.Items.Add(new DevExpress.XtraBars.Ribbon.GalleryItem(GetImage("1.jpg"), "1", "1")); Group.Items.Add(new DevExpress.XtraBars.Ribbon.GalleryItem(GetImage("2.jpg"), "2", "2")); Group.Items.Add(new DevExpress.XtraBars.Ribbon.GalleryItem(GetImage("3.jpg"), "3", "3")); myGalleryControl1.Gallery.Groups.Add(Group); myGalleryControl1.Gallery.ImageSize = new Size(100, 100); myGalleryControl1.KeyboardSelectedItemChanged += new MyGalleryControl.KeyboardSelectedItemChangedHandler(myGalleryControl1_KeyboardSelectedItemChanged); }
private static GalleryItemSelectedCommandBehavior GetOrCreateBehavior(GalleryItemGroup menuItem) { GalleryItemSelectedCommandBehavior behavior = menuItem.GetValue(SelectedCommandBehaviorProperty) as GalleryItemSelectedCommandBehavior; if (behavior == null) { behavior = new GalleryItemSelectedCommandBehavior(menuItem); menuItem.SetValue(SelectedCommandBehaviorProperty, behavior); } return(behavior); }
/// <summary> /// Initializes static members of the <see cref="MovieDBFactory"/> class. /// </summary> static MovieDBFactory() { MovieDatabase = new BindingList<MovieModel>(); currentMovie = new MovieModel(); galleryGroup = new GalleryItemGroup(); multiSelectedMovies = new BindingList<MovieModel>(); inGallery = new BindingList<string>(); multiSelectedMovies.ListChanged += MultiSelectedMovies_ListChanged; MovieDatabase.ListChanged += MovieDB_ListChanged; }
/// <summary> /// Initializes static members of the <see cref="MovieDBFactory"/> class. /// </summary> static MovieDBFactory() { MovieDatabase = new BindingList <MovieModel>(); currentMovie = new MovieModel(); galleryGroup = new GalleryItemGroup(); multiSelectedMovies = new BindingList <MovieModel>(); inGallery = new BindingList <string>(); multiSelectedMovies.ListChanged += MultiSelectedMovies_ListChanged; MovieDatabase.ListChanged += MovieDB_ListChanged; }
private static void OnDataSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GalleryItemGroup galleryItemGroup = d as GalleryItemGroup; if (e.NewValue == null) { return; } //Clear any existing items that were owned by this if (galleryItemGroup.ItemKeys.Count > 0) { foreach (var key in galleryItemGroup.ItemKeys) { if (galleryItemGroup.GalleryTool.Items.ContainsKey(key)) { galleryItemGroup.GalleryTool.Items.Remove(galleryItemGroup.GalleryTool.Items[key]); } } } galleryItemGroup.ItemKeys.Clear(); //Get the image converter that will provide image paths var imageConverter = galleryItemGroup.GetValue(GalleryItemGroupProperties.ImageConverterProperty) as IValueConverter; foreach (var item in (IEnumerable)e.NewValue) { var galleryItem = new GalleryItem { Key = item.ToString(), Text = item.ToString(), }; if (imageConverter != null) { galleryItem.Image = new BitmapImage(new Uri((string)imageConverter.Convert(item, typeof(string), null, null), UriKind.RelativeOrAbsolute)); } galleryItemGroup.GalleryTool.Items.Add(galleryItem); galleryItemGroup.ItemKeys.Add(item.ToString()); } //Check if GalleryToolProperties.SelectedItemKey was set var selectedItem = galleryItemGroup.GalleryTool.GetValue(GalleryToolProperties.SelectedItemKeyProperty); { if (selectedItem != null) { galleryItemGroup.GalleryTool.SetValue(GalleryToolProperties.SelectedItemKeyProperty, null); galleryItemGroup.GalleryTool.SetValue(GalleryToolProperties.SelectedItemKeyProperty, selectedItem); } } }
private void ProcessAlbum(AlbumData albumData, bool showEditButtons) { GalleryItemGroup group = CreateAlbumGroup(albumData); //AlbumGroupCaptionControl control = (AlbumGroupCaptionControl)group.CaptionControl; //if (!showEditButtons) // control.HideEditButtons(); mainGallery.Gallery.Groups.Add(group); foreach (PathData pData in albumData.Files) { group.Items.Add(CreatePhotoGalleryItem(pData.Path)); } }
void InitStrategyGalleryDropDown() { this.galleryItemGroup = this.strategyRibbonGalleryBarItem.Gallery.Groups[0]; this.checkedStrategyGalleryItem = this.galleryItemGroup.Items[0]; this.checkedStrategyItemindex = 0; this.galleryDropDown1.Gallery.Groups.Add(new GalleryItemGroup(galleryItemGroup)); this.dropdownItemGroup = this.galleryDropDown1.Gallery.Groups[0]; this.checkedDropDwonItem = this.dropdownItemGroup.Items[0]; // this.checkedDropDwonItem.Checked = true; this.galleryDropDown1.Name = "galleryDropDown1"; this.galleryDropDown1.Ribbon = this.ribbonControl; }
/// <summary> /// 增加一副图片到Gallery /// </summary> /// <param name="fullImageName">全路径名</param> /// <param name="fileName">文件名</param> public void AddImageToGallery(string fullImageName, string fileName) { try { GalleryItemGroup group = _galleryControl.Gallery.Groups[0]; System.Drawing.Image image = System.Drawing.Image.FromFile(fullImageName); GalleryItem item = new GalleryItem(image, fileName, ""); item.Tag = fullImageName; group.Items.Add(item); } catch (System.Exception ex) { _logger.Error(ex.Message); } }
public void LoadBan() { var provider = new Sqlite(); DataTable table_group = new DataTable(); DataTable table_item = new DataTable(); table_group = provider.ExecuteQuery($@"SELECT DISTINCT c.khuvuc from tbl_ban a LEFT JOIN (SELECT DISTINCT maban from tbl_hoadon where ngayban>='{Convert.ToDateTime(dateTuNgay.EditValue).ToString("yyyy-MM-dd")}' and ngayban<='{Convert.ToDateTime(dateDenNgay.EditValue).ToString("yyyy-MM-dd")}' and huyhoadon=0) b on b.maban=a.maban INNER JOIN tbl_khuvuc c on c.makhuvuc=a.makhuvuc"); table_item = provider.ExecuteQuery($@"SELECT a.maban, a.tenban, c.khuvuc, c.hinh, CASE when b.maban is null then 'False' ELSE 'True' END as sudung from tbl_ban a LEFT JOIN (SELECT DISTINCT maban from tbl_hoadon where ngayban>='{Convert.ToDateTime(dateTuNgay.EditValue).ToString("yyyy-MM-dd")}' and ngayban<='{Convert.ToDateTime(dateDenNgay.EditValue).ToString("yyyy-MM-dd")}' and huyhoadon=0) b on b.maban=a.maban INNER JOIN tbl_khuvuc c on c.makhuvuc=a.makhuvuc"); count_group_gallery = table_group.Rows.Count; galleryControl1.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside; galleryControl1.Gallery.ImageSize = new Size(64, 64); galleryControl1.Gallery.ShowItemText = true; galleryControl1.Gallery.ShowGroupCaption = true; foreach (DataRow group in table_group.Rows) { var galleryItem = new GalleryItemGroup(); galleryItem.Caption = group["khuvuc"] as string; foreach (DataRow item in table_item.Rows) { if (group["khuvuc"].ToString().Equals(item["khuvuc"].ToString())) { var gc_item = new GalleryItem(); gc_item.AppearanceCaption.Normal.Font = new Font("Tahoma", 12, FontStyle.Regular); gc_item.AppearanceCaption.Hovered.Font = new Font("Tahoma", 12, FontStyle.Regular); gc_item.AppearanceCaption.Pressed.Font = new Font("Tahoma", 12, FontStyle.Regular); string url = Data.BASE_URL_ICON + item["hinh"]; if (item["sudung"].ToString() == "True") { gc_item.ImageOptions.Image = Image.FromFile(url); } else { gc_item.ImageOptions.Image = Data.MakeGrayscale((Bitmap)Image.FromFile(url)); } gc_item.Caption = item["tenban"].ToString(); gc_item.Value = item["maban"].ToString(); galleryItem.Items.Add(gc_item); } } galleryControl1.Gallery.Groups.Add(galleryItem); } }
public void LoadBan() { var provider = new Sqlite(); var table_group = provider.ExecuteQuery($@"SELECT DISTINCT khuvuc from view_ban a LEFT JOIN (SELECT maban from tbl_hoadon where dathanhtoan=0) b on b.maban=a.maban where b.maban>0 and a.maban NOT IN ('{Data._strMaBan}')"); var table_item = provider.ExecuteQuery($@"SELECT DISTINCT a.maban, tenban, khuvuc, hinh, CASE when b.maban>0 THEN 'True' ELSE 'False' END as sudung from view_ban a LEFT JOIN (SELECT maban from tbl_hoadon where dathanhtoan=0) b on b.maban=a.maban where b.maban>0 and a.maban NOT IN ('{Data._strMaBan}')"); count_group_gallery = table_group.Rows.Count; galleryControl1.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside; galleryControl1.Gallery.ImageSize = new Size(64, 64); galleryControl1.Gallery.ShowItemText = true; galleryControl1.Gallery.ShowGroupCaption = true; foreach (DataRow group in table_group.Rows) { var galleryItem = new GalleryItemGroup(); galleryItem.Caption = group["khuvuc"] as string; // galleryItem.CaptionAlignment = GalleryItemGroupCaptionAlignment.Center; foreach (DataRow item in table_item.Rows) { if (group["khuvuc"].ToString().Equals(item["khuvuc"].ToString())) { var gc_item = new GalleryItem(); gc_item.AppearanceCaption.Normal.Font = new Font("Tahoma", 12, FontStyle.Regular); gc_item.AppearanceCaption.Hovered.Font = new Font("Tahoma", 12, FontStyle.Regular); gc_item.AppearanceCaption.Pressed.Font = new Font("Tahoma", 12, FontStyle.Regular); string url = Data.BASE_URL_ICON + item["hinh"]; if (item["sudung"].ToString() == "True") { gc_item.ImageOptions.Image = Image.FromFile(url); } else { gc_item.ImageOptions.Image = Data.MakeGrayscale((Bitmap)Image.FromFile(url)); } gc_item.Caption = item["tenban"].ToString(); gc_item.Value = item["maban"].ToString(); galleryItem.Items.Add(gc_item); } } galleryControl1.Gallery.Groups.Add(galleryItem); } }
private static void OnGroupKeysChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { GalleryItemGroup galleryItemGroup = d as GalleryItemGroup; if (e.NewValue == null) { return; } galleryItemGroup.ItemKeys.Clear(); foreach (var item in (IEnumerable)e.NewValue) { galleryItemGroup.ItemKeys.Add(item.ToString()); } }
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; }
/// <summary> /// Initializes static members of the <see cref="MovieDBFactory"/> class. /// </summary> static MovieDBFactory() { MovieDatabase = new BindingList <MovieModel>(); HiddenMovieDatabase = new BindingList <MovieModel>(); DuplicatedMoviesDatabase = new BindingList <MovieModel>(); currentMovie = new MovieModel(); galleryGroup = new GalleryItemGroup(); multiSelectedMovies = new BindingList <MovieModel>(); TempScraperGroup = string.Empty; inGallery = new BindingList <string>(); MovieDatabase.ListChanged += MovieDatabase_ListChanged; multiSelectedMovies.ListChanged += MultiSelectedMovies_ListChanged; MovieDatabase.ListChanged += MovieDB_ListChanged; }
static void Gallery_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { clickPoint = e.GetPosition((GalleryControl)sender); HitTestResult res = VisualTreeHelper.HitTest((GalleryControl)sender, clickPoint); if (res.VisualHit == null) { return; } gic = LayoutHelper.FindParentObject <GalleryItemControl>(res.VisualHit); if (gic != null) { dragableItem = gic.Item; container = dragableItem.Group; originalIndex = container.Items.IndexOf(dragableItem); } }
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]; }
public VideoQueryForm() { InitializeComponent(); PopulateSearchScope(); setListViewColumns(); rand = new Random((int)DateTime.Now.Ticks); var now = DateTime.Now; this.timeTO.EditValue = now; this.timeFrom.EditValue = now.AddDays(-1); var videoNavigator = new NullNavigator(); this.controlNavigator1.NavigatableControl = videoNavigator; videoGrid.DataSource = _videos; //licenseplatesGrid.DataSource = _licensePlates; faceGalleryControl.Gallery.ItemCheckedChanged += Gallery_ItemCheckedChanged; _galleryGroup = new GalleryItemGroup(); faceGalleryControl.Gallery.Groups.Add(_galleryGroup); }
void InitFont(GalleryItemGroup groupDropDown , GalleryItemGroup galleryGroup) { FontFamily[] fonts = FontFamily.Families; for (int i = 0 ; i < fonts.Length ; i++) { string fontName = fonts[i].Name; GalleryItem item = new GalleryItem(); item.Caption = fontName; item.Image = GetFontImage(32 , 28 , fontName , 12); item.HoverImage = item.Image; item.Description = fontName; item.Hint = fontName; try { item.Tag = new Font(fontName , 9); if (DevExpress.Utils.ControlUtils.IsSymbolFont((Font)item.Tag)) { item.Tag = new Font(DevExpress.Utils.AppearanceObject.DefaultFont.FontFamily , 9); item.Description += " (Symbol Font)"; } } catch { continue; } groupDropDown.Items.Add(item); galleryGroup.Items.Add(item); } }
/// <summary> /// Initializes static members of the <see cref="TvDBFactory"/> class. /// </summary> static TvDBFactory() { tvDatabase = new SortedList<string, Series>(); CurrentSeries = new Series(); CurrentSeason = new Season(); CurrentEpisode = new Episode(); galleryGroup = new GalleryItemGroup(); masterSeriesNameList = new BindingList<MasterSeriesListModel>(); currentSelectedSeries = new List<Series>(); currentSelectedSeason = new List<Season>(); currentSelectedEpisode = new List<Episode>(); }
private void InitToolsGallery(GalleryItemGroup groupDropDown) { string[] toolNames = { "Resource Browser", "Resource Packer" }; int[] toolImageIdx = { 9, 17 }; for (int i = 0; i < toolImageIdx.Length; i++) { GalleryItem item = new GalleryItem(); item.Caption = toolNames[i]; //item.Description = moduleNames[i]; item.Image = ribbonLargeImageCollection.Images[toolImageIdx[i]]; item.Hint = toolNames[i]; item.HoverImage = item.Image; groupDropDown.Items.Add(item); } }
private void InitModuleGallery(GalleryItemGroup groupDropDown) { string[] names = m_framework.GetModuleNames(); foreach (string name in names) { IModule m = m_framework.GetModuleInterface(name); GalleryItem item = new GalleryItem(); item.Tag = m; item.Caption = m.ModuleCaption; item.Description = m.ModuleDescription; item.Image = m.ModuleLargeGlyph; item.HoverImage = item.Image; groupDropDown.Items.Add(item); } }
public RibbonGalleryGroupDynamicUIAdapter(GalleryItemGroup ribbonGalleryGroup) : base(ribbonGalleryGroup) { }
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(); }