Ejemplo n.º 1
0
        /// <summary>
        /// 设置流程图的绘图参数
        /// </summary>
        /// <param name="args">流程图的绘图哈希表</param>
        public void SetArguments(Hashtable args)
        {
            slotContainerList = args["slotContainerList"] as List<SlotContainer>;
            connectorContainerList = args["connectorContainerList"] as List<ConnectorContainer>;
            background = args["background"] as Background;
            idIndex = (int)args["idIndex"];

            selectedGraphElementList = new List<GraphElement>();

            // 刷新画板参数
            background.Refresh();

            // 重设绘图参数
            canvas.CanvasBackgound = background;  
            canvas.AutoScrollMinSize = background.CanvasSize;
            canvas.BackColor = graphSetting.BackgroundColor;
            background.BaseSize = background.CanvasSize;
            graphSetting.CanvasScale = 1.0f;

            // 刷新图元数据
            foreach (SlotContainer slotContainer in slotContainerList)
            {
                slotContainer.Refresh();               
            }

            foreach (ConnectorContainer connectorContainer in connectorContainerList)
            {
                connectorContainer.Refresh();
            }            

            // 初始化区域管理器
            RefreshRegion();

            // 刷新绘图板
            ReconstructCanvasGraphElementList();
        }  
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化绘图板背景
        /// </summary>
        private void InitBackground()
        {
            background = new Background();
            canvas.CanvasBackgound = background;
            canvas.AutoScroll = true;
            canvas.AutoScrollMinSize = background.CanvasSize;

            background.Refresh();
        }