private void Elem_Click(object sender, EventArgs e) { AccordionControlElement tooStripMenu = sender as AccordionControlElement; if (tooStripMenu == null) { return; } string tag = tooStripMenu.Tag as string; if (string.IsNullOrWhiteSpace(tag)) { return; } //获取插件目录 string Pluginspath = ConfigurationHelper.GetAppSettingOrDefault("PluginsPath", @"\plugins\"); //获取插件对象 IPlugIn plugIn = LoadPlugIn(Pluginspath + tag.Split(',')[1], tag.Split(',')[0]); if (plugIn == null) { MessageDxUtil.ShowError("未找到菜单配置的窗体实例,请检查窗体菜单配置。"); } //创建子窗体并显示 BaseForm plugInForm = plugIn.CreatePlugInForm(); plugInForm.MdiParent = this; plugInForm.Show(); }
private void NewConnectionFrom_Load(object sender, EventArgs e) { try { DataTable dt = ConnectInfo.LoadDriver(); foreach (DataRow dr in dt.Rows) { AccordionControlElement element = new AccordionControlElement(ElementStyle.Item); ConnectInfo info = ReflectionHelper.CreateInstance <ConnectInfo>(dr["assemblyName"].ToString(), dr["namespaceName"].ToString(), dr["className"].ToString()); element.Text = info.DriverName; element.Image = info.OpenImage; element.Tag = info; this.accDataSource.Elements[0].Elements.Add(element); } this.accDataSource.SelectedElement = this.accDataSource.Elements[0].Elements[0]; if (this.accDataSource.SelectedElement != null) { this.btnOK.Enabled = true; } else { this.btnOK.Enabled = false; } this.txtConnectName.Text = ""; this.txtConnectionString.Text = ""; } catch (Exception ex) { LogHelper.Error(ex); } }
protected virtual void InitializeBaseCurrencies() { var groups = Exchange.Tickers.GroupBy(t => t.BaseCurrency); AccordionControlElement groupElement = new AccordionControlElement() { Style = ElementStyle.Group }; groupElement.Text = "Markets"; this.accordionControl1.Elements.Add(groupElement); groupElement.Expanded = true; foreach (var group in groups) { AccordionControlElement item = new AccordionControlElement() { Style = ElementStyle.Item }; item.Text = group.Key; item.Click += OnBaseCurrencyItemClick; if (group.Key == "BTC") { SelectedAccordionItem = item; } groupElement.Elements.Add(item); } if (SelectedAccordionItem == null) { SelectedAccordionItem = groupElement.Elements.Count > 0? groupElement.Elements[0]: null; } this.accordionControl1.SelectElement(SelectedAccordionItem); UpdateTickersAccordingBaseCurrency(); }
void ZamanCizelgesiDoldur(CalismaDonemi Donem, Func <ZamanCizelgesi, bool> predicate = null) { var element = ElementParentÇalışmaDönemi.Elements.FirstOrDefault(x => x.Tag == Donem); element.Elements.Clear(); string format = @"hh\:mm"; Donem?.ZamanCizelgesi? .Where(predicate == null ? a => true : predicate) .Where(x => x.isActive) .ForEach(x => { var txt = $"{x.Gün.ToString()}-[{x.NetTime.ToString(format) }]"; var yeni = new AccordionControlElement() { Image = GetImage(ElementTipi.ÇalışmaZamanı), Style = ElementStyle.Item, Tag = x, //Text = $"{x.Gün}-[{x.StartTime.ToString(format)}-{x.EndTime.ToString(format)}]" Text = $"{x.Gün.ToString()}-[{x.NetTime.ToString(format) }]" }; element.Elements.Add(yeni); }); }
//load tất danh mục từ menu private void LoadDanhMuc() { DataTable dt = new DataTable(); dt.Load(SqlHelper.ExecuteReader(Commons.IConnections.CNStr, "spGetMenuLeft", Commons.Modules.UserName, Commons.Modules.TypeLanguage, iLoai)); foreach (DataRow item in dt.Rows) { AccordionControlElement element = new AccordionControlElement(); element.Expanded = true; element.Text = item["NAME"].ToString(); element.Name = item["KEY_MENU"].ToString(); element.Tag = item["CONTROLS"].ToString(); accorMenuleft.Elements.Add(element); DataTable dtchill = new DataTable(); dtchill.Load(SqlHelper.ExecuteReader(Commons.IConnections.CNStr, "spGetMenuLeft", Commons.Modules.UserName, Commons.Modules.TypeLanguage, Convert.ToInt32(item["ID_MENU"]))); if (dtchill.Rows.Count > 0) { foreach (DataRow itemchill in dtchill.Rows) { AccordionControlElement elementchill = new AccordionControlElement(); elementchill.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; elementchill.Text = itemchill["NAME"].ToString(); elementchill.Name = itemchill["KEY_MENU"].ToString(); elementchill.Tag = itemchill["CONTROLS"].ToString(); element.Elements.Add(elementchill); elementchill.Click += Element_Click; } } else { element.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; } } }
private void AddSettingsItem() { AccordionControlElement aceSettings; DevExpress.Utils.SuperToolTip superToolTip1 = new DevExpress.Utils.SuperToolTip(); DevExpress.Utils.ToolTipTitleItem toolTipTitleItem1 = new DevExpress.Utils.ToolTipTitleItem(); DevExpress.Utils.ToolTipItem toolTipItem1 = new DevExpress.Utils.ToolTipItem(); DevExpress.Utils.ToolTipSeparatorItem toolTipSeparatorItem1 = new DevExpress.Utils.ToolTipSeparatorItem(); DevExpress.Utils.ToolTipTitleItem toolTipTitleItem2 = new DevExpress.Utils.ToolTipTitleItem(); aceSettings = new AccordionControlElement { ControlFooterAlignment = AccordionItemFooterAlignment.Far, Expanded = true, Name = "aceSettings", Image = ImageResourceCache.Default.GetImage("images/setup/properties_32x32.png") }; toolTipTitleItem1.Text = "Settings"; toolTipItem1.LeftIndent = 6; toolTipItem1.Text = "Modify general settings which apply to all instances."; toolTipTitleItem2.LeftIndent = 6; superToolTip1.Items.Add(toolTipTitleItem1); superToolTip1.Items.Add(toolTipItem1); superToolTip1.Items.Add(toolTipSeparatorItem1); superToolTip1.Items.Add(toolTipTitleItem2); aceSettings.SuperTip = superToolTip1; aceSettings.Text = "Settings"; aceSettings.Click += this.Settings_Click; this.accordionControl.Elements.Add(aceSettings); }
public void DosyaDoldur(Func <Dosya, bool> prediticate = null) { var element = ElementDosyaParent; element.Elements.Clear(); User.Dosya? .Where(x => x.AnaDosyaID == null && x.isActive) .Where(prediticate == null ? a => true : prediticate) .Where(x => x.isActive) .OrderBy(x => x.AnaDosyaID) .ForEach(x => { var yeni = new AccordionControlElement() { Image = GetImage(ElementTipi.dosyachild), //Style = x.EkDosya?.Count > 0 ? ElementStyle.Group : ElementStyle.Item, Style = ElementStyle.Group, Tag = x, Text = $"{x.Adı } {x.Soyadı }-{x.DavaTarihi.ToShortDateString()}" //Text = $"{x.Adı } {x.Soyadı }" }; element.Elements.Add(yeni); yeni.Click += Element_Click; DosyalarıDoldur(x, yeni); }); }
protected override AccordionControlForm CreatePopupForm(AccordionControlElement elem) { AccordionControlForm form = base.CreatePopupForm(elem); form.Activated += Form_Activated; return(form); }
private void Menu_Elements_Manager() { accordionControl1.Elements.Clear(); AccordionControlElement G_Category1 = new AccordionControlElement(ElementStyle.Group) { Text = "프로그램" }; // accordionControl1.Elements.Add(G_Category1); AccordionControlElement I_Category1_1 = new AccordionControlElement(ElementStyle.Item) { Text = "Java" }; I_Category1_1.Name = "Java"; AccordionControlElement I_Category1_2 = new AccordionControlElement(ElementStyle.Item) { Text = "C#" }; I_Category1_2.Name = "C#"; AccordionControlElement I_Category1_3 = new AccordionControlElement(ElementStyle.Item) { Text = "DB" }; I_Category1_3.Name = "DB"; AccordionControlElement G_Category2 = new AccordionControlElement(ElementStyle.Group) { Text = "최영준" }; AccordionControlElement I_Category2_1 = new AccordionControlElement(ElementStyle.Item) { Text = "개인노트" }; I_Category2_1.Name = "개인노트"; AccordionControlElement I_Category2_2 = new AccordionControlElement(ElementStyle.Item) { Text = "Calender" }; I_Category2_2.Name = "Calender"; //AccordionControlElement G_Category3 = new AccordionControlElement(ElementStyle.Group) { Text = "일상" }; //AccordionControlElement I_Category3_1 = new AccordionControlElement(ElementStyle.Item) { Text = "맛집" }; //AccordionControlElement I_Category3_2 = new AccordionControlElement(ElementStyle.Item) { Text = "여행" }; //AccordionControlElement I_Category3_3 = new AccordionControlElement(ElementStyle.Item) { Text = "기타" }; G_Category1.Elements.AddRange(new AccordionControlElement[] { I_Category1_1, I_Category1_2, I_Category1_3 }); G_Category2.Elements.AddRange(new AccordionControlElement[] { I_Category2_1, I_Category2_2 }); accordionControl1.Elements.AddRange(new AccordionControlElement[] { G_Category1, G_Category2 }); //대그룹 Elements 아코디언 //대 중 소 그룹 세분화후 accordionControl 에 넣고 중 소 넣자 //accordionControl1.AllowItemSelection = true; accordionControl1.ExpandAll(); }
private void OpenFileBtn_ItemClick(object sender, ItemClickEventArgs e) { XtraFolderBrowserDialog OpenFolder = new XtraFolderBrowserDialog(); OpenFolder.ShowNewFolderButton = false; OpenFolder.UseParentFormIcon = true; OpenFolder.ShowDragDropConfirmation = true; //OpenFolder.SelectedPath = @"C:\Users\Administrator\Desktop\JGZC\ZDLP\ZDLP\bin\Release\RecvData"; if (OpenFolder.ShowDialog() == DialogResult.OK) { string path = OpenFolder.SelectedPath; DirectoryInfo fi = new DirectoryInfo(path); if (!fi.Exists) { return; } mainAccordionGroup.Elements.Clear(); List <AccordionControlElement> ac = new List <AccordionControlElement>(); foreach (FileInfo file in fi.GetFiles()) { if (file.Extension == ".dat") { AccordionControlElement tmp = new AccordionControlElement(DevExpress.XtraBars.Navigation.ElementStyle.Item); tmp.Text = file.Name; tmp.Tag = file.FullName; tmp.Click += new System.EventHandler(this.tmp_Click);; ac.Add(tmp); } } AccordionControlElement[] acArray = ac.ToArray(); mainAccordionGroup.Elements.AddRange(ac.ToArray()); } }
void DosyalarıDoldur(Dosya dossya, AccordionControlElement element) { if (dossya.EkDosya == null) { return; } var ekdosyalar = dossya.EkDosya .Where(x => x.isActive) .ToList(); foreach (var x in ekdosyalar) { var yeni = new AccordionControlElement() { Image = GetImage(ElementTipi.EkDosya), //Style = x.EkDosya?.Count == 0 ? ElementStyle.Item : ElementStyle.Group, Style = ElementStyle.Group, Tag = x, Text = $"{x.Adı } {x.Soyadı }-{x.DavaTarihi.ToShortDateString()}", }; element.Elements.Add(yeni); yeni.Click += Element_Click; if (x.EkDosya?.Count > 0) { DosyalarıDoldur(x, yeni); } } }
private async Task SaveNotes(AccordionControlElement element) { try { //Nothing happens when these conditionas are met. if (element is null || element.Style == ElementStyle.Group) { return; } //DocmBytes will the content of the TextBox in OpenXML format var notes = richEditControl1.DocBytes; //Get the Local File Storage service using IStorageLocatorFactoryService var fileStorage = _storageFactory.GetStorageService(StorageType.LocalFile); //SessionBto is stored in element.Tag var sessionBto = element.Tag as SessionBto; //Call SaveNotes await fileStorage.SaveNotes(sessionBto, notes); } catch (Exception ex) { //Handle errors in an intuitive way. Perhaps, updating a Statusbar or some alertbox. //But for our project purposes, we will Log Error _logger.LogError(ex, "Error while saving notes"); } }
private void InitializeAccordionControlElement() { if (this.AccordionControlElement == null) { this.AccordionControlElement = new AccordionControlElement(); this.AccordionControlElement.Click += new EventHandler(this.accordionControlElement_Click); } }
public void AddFilterItem(AccordionControlElement group, string captain, string filterString) { AccordionControlElement item = new AccordionControlElement(); item.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; item.Text = captain; item.Tag = filterString; item.Click += Item_Click; }
public AccordionControlElement AddFilterGroup(string captain) { AccordionControlElement item = new AccordionControlElement(); item.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; item.Text = captain; this.accordionControlElement1.Elements.Add(item); return(item); }
public void AddCustomDataGroupItem(string captain, string filterString) { AccordionControlElement item = new AccordionControlElement(); item.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item; item.Text = captain; item.Tag = filterString; item.Click += Item_Click; this.accordionControlElement5.Elements.Add(item); }
private void LoadMenu_MainPage() { ctrlMenu.Elements.Clear(); AccordionControlElement rootMenu = new AccordionControlElement(); rootMenu.Expanded = true; rootMenu.Text = "主界面"; ctrlMenu.Elements.Add(rootMenu); }
void CreateItem(AccordionControlElement parent, List <string> paths) { var container = CreateContainerWithTree(paths); if (container != null) { accordionControl1.Controls.Add(container); parent.ContentContainer = container; } }
private void Form1_Load(object sender, EventArgs e) { #region 设置显示的系统信息 this.tslLoginName.Text += RafyEnvironment.Principal.Identity.Name; this.tslGroupName.Text += "Group"; switch (RafyEnvironment.Location.DataPortalMode) { case DataPortalMode.ConnectDirectly: this.tslDataPortalMode.Text += "数据库直连模式"; break; case DataPortalMode.ThroughService: this.tslDataPortalMode.Text += "WCF服务模式"; break; default: this.tslDataPortalMode.Text += "未知"; break; } #endregion AccordionControlElement elem = new AccordionControlElement(); elem.Text = "菜单组"; elem.Name = "菜单组"; elem.Style = ElementStyle.Group; accordionControl1.Elements.Add(elem); AccordionControlElement elem1 = new AccordionControlElement(); elem1.Text = "测试菜单"; elem1.Name = "菜单"; elem1.Style = ElementStyle.Item; elem1.Tag = "MyPlugIn1.MyPlugIn1,MyPlugIn1.dll"; elem1.Click += Elem_Click; elem.Elements.Add(elem1); var repo = RF.ResolveInstance <ModulesRepository>(); ModulesList modulesList = repo.GetAll(); for (int i = 0; i < modulesList.Count; i++) { AccordionControlElement elemtemp = new AccordionControlElement(); elemtemp.Text = modulesList[0].ModuleName; elemtemp.Name = modulesList[0].ModuleName; elemtemp.Style = ElementStyle.Item; elemtemp.Tag = modulesList[0].ModuleType + "," + modulesList[0].ModuleAss;// "Rafy.Sys.Modules.ModulesPlugin,Rafy.Sys.Modules.dll"; elemtemp.Click += Elem_Click; elem.Elements.Add(elemtemp); } //AccordionControlElement elem2 = new AccordionControlElement(); //elem2.Text = "模块管理"; //elem2.Name = "ModulesPlugin"; //elem2.Style = ElementStyle.Item; //elem2.Tag = "Rafy.Sys.Modules.ModulesPlugin,Rafy.Sys.Modules.dll"; //elem2.Click += Elem_Click; //elem.Elements.Add(elem2); }
private void UpdateAccordionContainerHeight(AccordionControlElement node) { if (node.ContentContainer != null) { UpdateAccordionContainerHeight(node.ContentContainer); } foreach (AccordionControlElement child in node.Elements) { UpdateAccordionContainerHeight(child); } }
AccordionControlElement AddItem(AccordionControlElement group, string txt)//add element { AccordionControlElement item = new AccordionControlElement() { Text = txt, Style = ElementStyle.Item }; AccordionControlSeparator separator = new AccordionControlSeparator(); group.Elements.Add(item); group.Elements.Add(separator); return(item); }
private void itemsMenu_Click(object sender, EventArgs e) { AccordionControlElement item = (AccordionControlElement)sender; Form formulario = (Form)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("ControlResidencial.formas" + "." + item.Name); if (formulario == null) { return; } AbrirForm(formulario, this); }
private void Dictionary_Click(object sender, EventArgs e) { foreach (Form item in MdiChildren) { item.Close(); } AccordionControlElement element = sender as AccordionControlElement; Manager.Frm_Manager frm = new Manager.Frm_Manager(element.Tag); frm.MdiParent = this; frm.Show(); }
/// <summary> /// 엘리먼트 구하기 /// </summary> /// <param name="name">명칭</param> /// <param name="style">스타일</param> /// <param name="text">텍스트</param> /// <param name="expanded">확장 여부</param> /// <returns>아코디언 컨트롤 엘리먼트</returns> private AccordionControlElement GetElement(string name, ElementStyle style, string text, bool expanded = true) { AccordionControlElement element = new AccordionControlElement { Name = name, Style = style, Text = text, Expanded = true }; return(element); }
/// <summary> /// 重建参数视图 /// </summary> private void RecreateTableView(AccordionControlElementCollection elements , ReportTableView parentTableView , IEnumerable <ReportTableController> tables) { if (parentTableView != null) { parentTableView.ChildTableViews = new List <Views.ReportTableView>(); } foreach (var reportDataTable in tables) { ExtendAddonPublic.GetAddonExtendProperties(reportDataTable); var elementTableView = new AccordionControlElement(); elementTableView.Name = reportDataTable.ID; elementTableView.Style = ElementStyle.Group; elementTableView.Expanded = true; elementTableView.Text = String.Format("{0}({1})", reportDataTable.Caption, reportDataTable.TableName); elements.Add(elementTableView); var reportTableView = reportDataTable.CreateView() as ReportTableView; reportTableView.Dock = DockStyle.Top; reportTableView.AutoSize = true; reportTableView.RowCount = 0; reportTableView.BorderStyle = BorderStyle.FixedSingle; reportTableView.DataFetched += ReportTableView_DataFetched; reportTableView.DataRequery += ReportTableView_DataRequery; var elementParameterView = new AccordionControlElement(); elementParameterView.Name = reportDataTable.ID; elementParameterView.Style = ElementStyle.Item; elementParameterView.Expanded = true; elementParameterView.Text = "查询"; var container = new AccordionContentContainer(); container.Controls.Add(reportTableView); container.Height = reportTableView.Height; elementParameterView.ContentContainer = container; reportTableView.SizeChanged += (sender, e) => { container.Height = reportTableView.Height; }; TableControls.Add(reportDataTable.TableName, reportTableView); elementTableView.Elements.Add(elementParameterView); if (parentTableView != null) { parentTableView.ChildTableViews.Add(reportTableView); } if (reportDataTable.ChildTables.IsNotNullOrEmpty()) { RecreateTableView(elementTableView.Elements, reportTableView, reportDataTable.ChildTables); } } }
public void ApplyToAccordionControl(AccordionControlElement group) { group.Style = ElementStyle.Group; AccordionControlElement[] nodes = new AccordionControlElement[this.accordionControl1.Elements.Count]; this.accordionControl1.Elements.CopyTo(nodes, 0); foreach (AccordionControlElement node in nodes) { node.ContentContainer.Name = "TagSelectionControl" + node.ContentContainer.Name; this.accordionControl1.Elements.Remove(node); group.Elements.Add(node); group.AccordionControl.Controls.Add(node.ContentContainer); } }
/// <summary> /// 添加菜单子节点 /// </summary> /// <param name="element"></param> /// <param name="menu"></param> private void AddChildElement(AccordionControlElement element, Menu menu) { menu.ChildMenus.ForEach(u => { AccordionControlElement ace = new AccordionControlElement() { Name = u.ID.ToString(), Text = u.Name, Style = (u.ChildMenus == null || u.ChildMenus.Count() == 0) ? ElementStyle.Item : ElementStyle.Group }; AddChildElement(ace, u); element.Elements.Add(ace); }); }
private void DisplayFiles() { using (var context = new ConstructionDataContext()) { ((ISupportInitialize)ribbonControl).BeginInit(); barSubItemNavigation.LinksPersistInfo.Clear(); accordionControl.Elements.Clear(); foreach (var typeName in Enum.GetNames(typeof(FileType))) { var group = new AccordionControlElement { Text = typeName }; Enum.TryParse(typeName, out FileType type); foreach (var file in context.Files.Where(w => w.Type == type)) { #region display file in the group of parameter types var item = new AccordionControlElement { Style = ElementStyle.Item, Name = file.FileName, Text = file.FileName, Tag = file }; group.Elements.Add(item); item.Click += Item_Click; #endregion #region add to navigation list var barItem = new BarButtonItem { Caption = file.FileName, Tag = file }; ribbonControl.Items.Add(barItem); barSubItemNavigation.LinksPersistInfo.Add(new LinkPersistInfo(barItem)); #endregion } accordionControl.Elements.Add(group); } accordionControl.ExpandAll(); ((ISupportInitialize)ribbonControl).EndInit(); } }
private void LoadBooks() { aceOT.Elements.Clear(); aceNT.Elements.Clear(); var books = new XPQuery <Book>(uow).OrderBy(x => x.NumberOfBook); foreach (var book in books) { var item = new AccordionControlElement(ElementStyle.Group) { Text = book.Title, Tag = book, Name = $"ace{book.Abbreviation}" }; item.Elements.Add(new AccordionControlElement(ElementStyle.Item) { Text = $"Introduction to {book.Title}", Tag = 0, Name = $"ace{book.Abbreviation}Introduction" }); for (int i = 1; i <= book.NumberOfChapters; i++) { var itemChapter = new AccordionControlElement(ElementStyle.Item) { Text = $"{book.Abbreviation} {i}", Tag = i, Name = $"ace{book.Abbreviation}{i}" }; item.Elements.Add(itemChapter); } if (book.NumberOfBook < 40) { aceOT.Elements.Add(item); } else { aceNT.Elements.Add(item); } } aceOT.Expanded = false; aceNT.Expanded = true; }
// настройки сетки типов объектов private void Designer_ObjectsTypes() { // загрузка объектов mdQuery.SelectQueryData("Books_ObjectsTypes." + this.Name, "SELECT * FROM vBooks_ObjectsTypes", "GetObjectsTypes"); this.acRoot.Elements.Clear(); foreach (DataRow r in mdQuery.iDataSet.Tables["Books_ObjectsTypes." + this.Name].Rows) { AccordionControlElement el = new AccordionControlElement(); el.Name = "btn" + System.Convert.ToString(r["Name"]); el.Text = "<image=#" + System.Convert.ToString(r["Icon"]) + "> " + System.Convert.ToString(r["NameCountHtml"]); el.Tag = r["Id"]; el.Style = ElementStyle.Item; el.Height = 40; this.acRoot.Elements.Add(el); } this.Accord.SelectedElement = this.acRoot.Elements[SelectedObjectType]; }