public bool LoadLayout(AMS.Profile.IProfile profile) { int r = profile.GetValue("SearchManager." + m_sm.Name, "MaxResult", -1); if (r != -1) { m_sm.MaxResult = r; } string history = profile.GetValue("SearchManager." + m_sm.Name, "History", string.Empty); if (!string.IsNullOrEmpty(history)) { string[] ss = history.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); for(int i=ss.Length -1; i>=0; --i) { string s = ss[i]; if (string.IsNullOrEmpty(s)) continue; string[] sss = s.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); if (sss.Length == 0) continue; ISearchExpression se = null; try { se = SearchExpression.Parse(sss[0]); } catch (Exception) { } if (se == null) continue; IList<ISearchOrder> so = null; if (sss.Length > 1) { so = SearchOrder.Parse(sss[1]); } SearchHistoryInfo his = m_sm.SetHistory(se, so); his.IsCurrentSession = false; } } bool ret = this.searchControlContainer1.LoadLayout(profile); return ret; }
public bool LoadLayout(AMS.Profile.IProfile profile) { if (this.SearchManager != null) { int r = profile.GetValue("SearchManager." + this.SearchManager.Name, "MaxResult", -1); if (r != -1) { this.SearchManager.MaxResult = r; return true; } } return false; }
/// <summary> /// 读入保存的Column布局 /// </summary> /// <param name="grid"></param> /// <param name="sectionName"></param> /// <returns></returns> private static bool LoadLayout(this IGrid grid, string sectionName, AMS.Profile.IProfile profile) { string s = profile.GetValue(sectionName, "Column", ""); if (string.IsNullOrEmpty(s)) { return false; } string[] columns = s.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); foreach (string columnName in columns) { string[] ss = columnName.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (ss.Length != 5) { continue; } if (grid.Columns[ss[0]] == null) { continue; } Xceed.Grid.Column column = grid.Columns[ss[0]]; // 默认是-1,设置成0是gridcolumnInfo 设置成Invisible if (column != null && column.MaxWidth != 0) { column.Visible = Convert.ToBoolean(ss[1]); column.VisibleIndex = Convert.ToInt32(ss[2]); column.Width = Convert.ToInt32(ss[3]); column.Fixed = Convert.ToBoolean(ss[4]); } } return true; }
/// <summary> /// 读入保存的样式 /// </summary> public static void LoadStyleSheet(this IGrid grid, AMS.Profile.IProfile profile) { string styleSheetName = profile.GetValue("Grid.StyleSheet." + grid.GridName, "Name", ""); if (string.IsNullOrEmpty(styleSheetName)) { return; } }
/// <summary> /// ������ҿؼ���Ϣ /// </summary> /// <param name="grid"></param> /// <param name="profile"></param> /// <returns></returns> public bool LoadLayout(AMS.Profile.IProfile profile) { string sectionName = "SearchControlContainer." + "." + m_sm.Name + ".Layout"; string s = profile.GetValue(sectionName, "SearchControls", ""); if (string.IsNullOrEmpty(s)) { return false; } string[] columns = s.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); foreach (string columnName in columns) { string[] ss = columnName.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (ss.Length != 3) { continue; } ISearchControl sc = m_sm.SearchControls[ss[0]]; if (sc == null) { continue; } GridColumnInfo info = sc.Tag as GridColumnInfo; if (info == null || (!string.IsNullOrEmpty(info.SearchControlType) && Authority.AuthorizeByRule(info.SearchControlVisible))) { sc.Available = Convert.ToBoolean(ss[1]); } else { m_sm.SearchControls[ss[0]].Available = false; } sc.Index = Convert.ToInt32(ss[2]); } return true; }
/// <summary> /// LoadLayout /// </summary> /// <param name="profile"></param> /// <returns></returns> public bool LoadLayout(AMS.Profile.IProfile profile) { string sectionName = "ArchiveDetailForm." + "." + this.Name + "." + m_controlGroupName + ".Layout"; string s = profile.GetValue(sectionName, "DataControls", ""); if (string.IsNullOrEmpty(s)) { return false; } string[] dcs = s.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); foreach (string dc in dcs) { string[] ss = dc.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (ss.Length != 2) { continue; } if (m_dm.DataControls[ss[0]] == null) { continue; } GridColumnInfo info = m_dm.DataControls[ss[0]].Tag as GridColumnInfo; if (m_dm.DataControls[ss[0]] != null) { if (info == null || (!string.IsNullOrEmpty(info.DataControlType) && Authority.AuthorizeByRule(info.DataControlVisible))) { m_dm.DataControls[ss[0]].Available = Convert.ToBoolean(ss[1]); } else { m_dm.DataControls[ss[0]].Available = false; } } } return true; }