Esempio n. 1
0
        public void SetDesigner(MultiPanes mp)
        {
            _panes     = mp;
            _classId   = mp.Loader.ClassID;
            _prjId     = mp.Loader.Project.ProjectGuid;
            _eventPath = new EventPath();
            //
            _eventPath.SetDesignerEx(mp, this);
            _eventPath.Dock = DockStyle.None;            //.Fill;
            //
            int     width = 0, height = 0;
            XmlNode epNode = _eventPath.XmlData;

            if (epNode != null)
            {
                width  = XmlUtil.GetAttributeInt(epNode, XMLATT_Width);
                height = XmlUtil.GetAttributeInt(epNode, XMLATT_Height);
            }
            if (width < splitContainer1.Panel1.Width)
            {
                width = splitContainer1.Panel1.Width * 2;
            }
            if (height < splitContainer1.Panel1.Height)
            {
                height = splitContainer1.Panel1.Height * 2;
            }
            _eventPath.Size = new Size(width, height);
            splitContainer1.Panel1.Controls.Add(_eventPath);
            Dictionary <UInt32, EventPathHolder> eps;
            EventMapService lst = VPLUtil.GetServiceByName(EGSCR) as EventMapService;

            if (lst == null)
            {
                lst = new EventMapService();
                VPLUtil.SetServiceByName(EGSCR, lst);
            }
            if (!lst.TryGetValue(_prjId, out eps))
            {
                eps = new Dictionary <uint, EventPathHolder>();
                lst.Add(_prjId, eps);
            }
            if (eps.ContainsKey(_classId))
            {
                eps[_classId] = this;
            }
            else
            {
                eps.Add(_classId, this);
            }
        }
Esempio n. 2
0
        private void removeService()
        {
            EventMapService lst = VPLUtil.GetServiceByName(EGSCR) as EventMapService;

            if (lst != null)
            {
                Dictionary <UInt32, EventPathHolder> eps;
                if (lst.TryGetValue(_prjId, out eps))
                {
                    if (eps.ContainsKey(_classId))
                    {
                        if (eps[_classId] == this)
                        {
                            eps.Remove(_classId);
                        }
                    }
                }
            }
        }