Exemplo n.º 1
0
        /// <summary>
        /// Загружает данные GraphData на основе данных из VmlData
        /// </summary>
        private void LoadFromVML()
        {
            //загрузка из VML
            try
            {
                _vmlDataName = (Request["VmlDataName"] == null) ? "" : Request["VmlDataName"];
                _vmlData     = (VmlData)Session[_vmlDataName];
                if (_vmlData == null)
                {
                    return;
                }

                graphModel = new GraphModel();
                graph      = graphModel.ClientData;

                //Установка визуальных параметров
                ConfigItem c = _vmlData.GetConfigItem();
                graph.Settings.MAXLinkWidth         = c.GetIntParam("MAXLinkWidth");
                graph.Settings.LinkColor            = c.GetStrParam("LinkColor");
                graph.Settings.AltLinkColor         = c.GetStrParam("AltLinkColor");
                graph.Settings.MINNodeSize          = c.GetIntParam("MINNodeSize");
                graph.Settings.MAXNodeSize          = c.GetIntParam("MAXNodeSize");
                graph.Settings.FontFace             = c.GetStrParam("FontFace");
                graph.Settings.FontColor            = c.GetStrParam("FontColor");
                graph.Settings.FontSize             = c.GetIntParam("FontSize");
                graph.Settings.NodeStrokeColor      = c.GetStrParam("NodeStrokeColor");
                graph.Settings.ProcessingCoordsMode = c.GetIntParam("ProcessingCoordsMode");
                graph.Settings.useBackGrnd          = c.GetBoolParam("useBackGrnd");
                graph.Settings.BackColor            = c.GetStrParam("BackColor");
                graph.Settings.BackGround           = c.GetStrParam("BackGround");

                //добавить script
                foreach (ScriptItem scriptItem in _vmlData.GetScriptItems())
                {
                    graphModel.HtmlIncludes.Add(scriptItem.sText);
                }

                CreateButtons();
                RenderNodes();

                _graphLayoutName          = GraphModel.GetNextName();
                Session[_graphLayoutName] = graphModel;
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }