private bool ChangeContent(IFrameContent content)
        {
            this.CurrentContent = content;
            this.CurrentContent.OnActivated();

            return(true);
        }
Example #2
0
        /// <summary>
        /// 添加控件后计算新的画布大小
        /// </summary>
        /// <param name="contentContorl">添加的控件</param>
        private void CalculateCanvasSize(IFrameContent contentContorl)
        {
            contentContorl.CalculateControlSize();//计算添加控件的大小

            //如果新添加的控件大于现在画布的范围则生成适合新控件大小的画布
            if (contentContorl.OffsetPos.X + contentContorl.Width > CanvasWidth - CanvasRightPadding || contentContorl.OffsetPos.Y + contentContorl.Height > CanvasHeight - CanvasBottomPadding)
            {
                if (contentContorl.OffsetPos.X + contentContorl.Width > CanvasWidth - CanvasRightPadding)
                {
                    CanvasWidth = contentContorl.OffsetPos.X + contentContorl.Width + CanvasRightPadding;//添加画布边界填充距离
                }
                if (contentContorl.OffsetPos.Y + contentContorl.Height > CanvasHeight - CanvasBottomPadding)
                {
                    CanvasHeight = contentContorl.OffsetPos.Y + contentContorl.Height + CanvasBottomPadding;//添加画布边界填充距离
                }
                if (renderTarget2D != null)
                {
                    renderTarget2D.Dispose();
                }
                renderTarget2D = new RenderTarget2D(Platform.GraphicsDevice, CanvasWidth.ConvertToIntPlus(), CanvasHeight.ConvertToIntPlus());
            }
        }
Example #3
0
 /// <summary>
 /// 向框架中添加控件
 /// </summary>
 /// <param name="contentContorl"></param>
 public void AddContentContorl(IFrameContent contentContorl)
 {
     ContentContorls.Add(contentContorl);//向画布内控件列表中添加新控件
     CalculateCanvasSize(contentContorl);
 }
Example #4
0
		///	<summary> 
		///		This method copy's each database field which is in the <paramref name="includedColumns"/> 
		///		from the <paramref name="source"/> interface to this data row.
		/// </summary>
		public void Copy_From_But_TakeOnly(IFrameContent source, params string[] includedColumns)
		{
			if (includedColumns.Contains(FrameContentsTable.IdCol)) this.Id = source.Id;
			if (includedColumns.Contains(FrameContentsTable.FormattingTemplateCol)) this.FormattingTemplate = source.FormattingTemplate;
			if (includedColumns.Contains(FrameContentsTable.MultiPageIndexCol)) this.MultiPageIndex = source.MultiPageIndex;
			if (includedColumns.Contains(FrameContentsTable.FrameOrderCol)) this.FrameOrder = source.FrameOrder;
			if (includedColumns.Contains(FrameContentsTable.NameIdCol)) this.NameId = source.NameId;
			if (includedColumns.Contains(FrameContentsTable.TableIdCol)) this.TableId = source.TableId;
			if (includedColumns.Contains(FrameContentsTable.PageIdCol)) this.PageId = source.PageId;
			if (includedColumns.Contains(FrameContentsTable.FrameIdCol)) this.FrameId = source.FrameId;
			if (includedColumns.Contains(FrameContentsTable.TableNameCol)) this.TableName = source.TableName;
			if (includedColumns.Contains(FrameContentsTable.ItemNameCol)) this.ItemName = source.ItemName;
			if (includedColumns.Contains(FrameContentsTable.PictureNameCol)) this.PictureName = source.PictureName;
			if (includedColumns.Contains(FrameContentsTable.PictureFileNameCol)) this.PictureFileName = source.PictureFileName;
			if (includedColumns.Contains(FrameContentsTable.VideoBeitragsIdCol)) this.VideoBeitragsId = source.VideoBeitragsId;
			if (includedColumns.Contains(FrameContentsTable.VideoFileNameCol)) this.VideoFileName = source.VideoFileName;
			if (includedColumns.Contains(FrameContentsTable.CommandCol)) this.Command = source.Command;
		}
Example #5
0
		///	<summary> This method copy's each database field from the <paramref name="source"/> interface to this data row.</summary>
		public void Copy_From(IFrameContent source, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) this.Id = source.Id;
			this.FormattingTemplate = source.FormattingTemplate;
			this.MultiPageIndex = source.MultiPageIndex;
			this.FrameOrder = source.FrameOrder;
			this.NameId = source.NameId;
			this.TableId = source.TableId;
			this.PageId = source.PageId;
			this.FrameId = source.FrameId;
			this.TableName = source.TableName;
			this.ItemName = source.ItemName;
			this.PictureName = source.PictureName;
			this.PictureFileName = source.PictureFileName;
			this.VideoBeitragsId = source.VideoBeitragsId;
			this.VideoFileName = source.VideoFileName;
			this.Command = source.Command;
		}
Example #6
0
		///	<summary> This method copy's each database field into the <paramref name="target"/> interface. </summary>
		public void Copy_To(IFrameContent target, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) target.Id = this.Id;
			target.FormattingTemplate = this.FormattingTemplate;
			target.MultiPageIndex = this.MultiPageIndex;
			target.FrameOrder = this.FrameOrder;
			target.NameId = this.NameId;
			target.TableId = this.TableId;
			target.PageId = this.PageId;
			target.FrameId = this.FrameId;
			target.TableName = this.TableName;
			target.ItemName = this.ItemName;
			target.PictureName = this.PictureName;
			target.PictureFileName = this.PictureFileName;
			target.VideoBeitragsId = this.VideoBeitragsId;
			target.VideoFileName = this.VideoFileName;
			target.Command = this.Command;
		}