Ejemplo n.º 1
0
        /// <summary>
        /// 克隆函数
        /// </summary>
        /// <returns>克隆的DUILayout对象</returns>
        public object Clone()
        {
            DUILayout newLayout = new DUILayout(this._name, this._transparentKey, this._captionHeight,
                                                this._titleInfo, this._normalBackgroundInfo, this._maximizedbackgroundInfo,
                                                this._imageManager, this._buttonManager);

            return(newLayout);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 读取皮肤参数配置
        /// </summary>
        /// <param name="skinName">皮肤唯一名(皮肤根目录名)</param>
        /// <param name="parameterDict">皮肤参数字典</param>
        private void LoadSkinLayouts(DUISkinInfo skinInfo, IDictionary <string, DUILayout> layoutDict)
        {
            if (layoutDict == null)
            {
                return;
            }
            foreach (string layoutFileName in Directory.GetFiles(skinInfo.SkinLayoutDirectory))
            {
                FileInfo fileInfo = new FileInfo(layoutFileName);
                if (fileInfo.Extension.ToLower().Equals(".layout"))
                {
                    DUILayout newLayout = new DUILayout(layoutFileName);

                    layoutDict.Add(newLayout.Name, newLayout);
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 返回指定DUIForm窗口的DUILayout对象
        /// </summary>
        /// <param name="formUniqueID">窗口唯一标识</param>
        /// <param name="layoutName">布局名称</param>
        /// <returns></returns>
        public DUILayout GetLayout(Guid formUniqueID, string layoutName)
        {
            DUILayout retLayout = null;

            if (this._formLayouts != null)
            {
                if (this._formLayouts.ContainsKey(formUniqueID))
                {
                    if (this._formLayouts[formUniqueID].ContainsKey(layoutName))
                    {
                        retLayout = this._formLayouts[formUniqueID][layoutName];
                    }
                    else
                    {
                        //获得布局对象的拷贝
                        retLayout = GetLayoutCopy(layoutName);
                        //缓存到拷贝字典中
                        this._formLayouts[formUniqueID].Add(layoutName, retLayout);
                    }
                }
                else
                {
                    //创建二级字典
                    this._formLayouts.Add(formUniqueID, new Dictionary <string, DUILayout>());
                    //获得布局对象的拷贝
                    retLayout = GetLayoutCopy(layoutName);
                    //缓存到拷贝字典中
                    this._formLayouts[formUniqueID].Add(layoutName, retLayout);
                }
            }
            if (retLayout == null)
            {
                throw new Exception(string.Format("未能获取到窗口{0}名为{1}的的布局信息!",
                                                  formUniqueID, layoutName));
            }

            return(retLayout);
        }