/// <summary> /// 读取内存中的样式 /// </summary> /// <param name="p_name">主键名称</param> /// <param name="p_xtl">树</param> public void Get(string p_name, DevExpress.XtraTreeList.TreeList p_xtl) { if (p_name == string.Empty) { return; } if (this.m_ColumnLayoutList.ContainsKey(p_name)) { byte[] bt = this.m_ColumnLayoutList[p_name] as byte[]; System.IO.MemoryStream buffer = new System.IO.MemoryStream(bt); p_xtl.RestoreLayoutFromStream(buffer); buffer.Close(); } }
void SetLayoutData(DevExpress.XtraTreeList.TreeList tree, byte[] data) { if (data == null || data.Length == 0) { return; } MemoryStream stream = new MemoryStream(data); try { tree.RestoreLayoutFromStream(stream); } catch (Exception ex) { throw new Exception("Wrong data format", ex); } }