Beispiel #1
0
        void ApiSetPropertyValue_Loaded(object sender, RoutedEventArgs e)
        {
            _XmlTemplate = this.IDesignFramework.GetCurrentXmlTemplate();
            this.ct.ShowTree(_XmlTemplate.ControlItem);

            InitParameter();
        }
Beispiel #2
0
        void pft_OpenPageInfo(object sender, OpenPageInfoEventArgs e)
        {
            //-->获取控件
            XElement _xe_page = XElement.Parse(e.PageDirectorySub.PageContent.Trim());

            if (null == _xe_page)
            {
                return;
            }
            XElement _xe_xaml = _xe_page.Element("xaml");
            XElement _xe_xml  = _xe_page.Element("xml");

            string xaml = _xe_xaml != null && _xe_xaml.FirstNode != null?_xe_xaml.FirstNode.ToString() : "";

            string xml = _xe_xml != null && _xe_xml.FirstNode != null?_xe_xml.FirstNode.ToString() : "";

            //-->xml操作
            _XmlTemplate_CurrentPage = XmlTemplate.DecodeXml(xml);
            //-->获取xaml
            _XamlTemplate = XamlTemplate.DecodeXml(xaml);
            _PageInfo     = Wrapper.CreateUIElement <UserControl>(xaml);
            LoadControls();

            if (null != OpenPageInfo)
            {
                OpenPageInfo(this, e);
            }
        }
Beispiel #3
0
        void txtXml_LostFocus(object sender, RoutedEventArgs e)
        {
            try
            {
                string _xml = this.txtXml.Text.Trim();
                if (Xml_Template.Equals(_xml))
                {
                    return;
                }
                var    xml    = XmlTemplate.DecodeXml(this.txtXml.Text.Trim());
                double width  = xml.BaseInfo.PageWidth;
                double height = xml.BaseInfo.PageHeight;
                //-->xml里的宽与高
                this.DesignPage.Width  = width;
                this.DesignPage.Height = height;

                _XmlTemplate = xml;
                Xml_Template = _xml;

                //-->xaml里面的高与宽
                this._XamlTemplate.Height = height;
                this._XamlTemplate.Width  = width;
                Xaml_Template             = _XamlTemplate.ParseXml().ToString();
            }
            catch
            {
                double width  = _XmlTemplate.BaseInfo.PageWidth;
                double height = _XmlTemplate.BaseInfo.PageHeight;
                this.DesignPage.Width  = width;
                this.DesignPage.Height = height;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 加载xml里的所有控件
        /// </summary>
        void InitLoadingControl(XmlTemplate xml)
        {
            lb_Controls1.Items.Clear();
            lb_Controls2.Items.Clear();
            _Controls2Item.Clear();
            foreach (var ci in xml.ControlItem)
            {
                var paramsCtrl = _GetControlParameter(xml, ci.MetaData, ci.ColumnName);
                try
                {
                    ListBoxItemExtend item = new ListBoxItemExtend();
                    item.Tag         = paramsCtrl;
                    item.Content     = ci.Name;
                    item.ControlInfo = ci;
                    lb_Controls1.Items.Add(item);

                    item             = new ListBoxItemExtend();
                    item.Tag         = paramsCtrl;
                    item.Content     = ci.Name;
                    item.ControlInfo = ci;
                    _Controls2Item.Add(item);
                }
                catch { }
            }
            lb_Controls2.ItemsSource = _Controls2Item;
        }
        /// <summary>
        /// 将当前选中的表添加到xml里的metadata里去。
        /// </summary>
        /// <param name="xml"></param>
        /// <param name="_CurrentDataTable"></param>
        void AddTableToXml(XmlTemplate xml, List <MetaDataColumnInfo> _CurrentDataTable)
        {
            if (null == xml.MetaDataItem)
            {
                xml.MetaDataItem = new List <MetaDataInfo>();
            }
            var dt = _CurrentDataTable[0];

            var data = xml.MetaDataItem.Where(p => p.table_name.ToLower().Equals(dt.table_name.ToLower())).GetFirst <MetaDataInfo>();

            if (null != data)
            {
                return;
            }
            data = new MetaDataInfo();
            xml.MetaDataItem.Add(data);
            data.table_comment = dt.table_comment;
            data.table_name    = dt.table_name;
            data.table_type    = dt.table_type;
            data.Item          = _CurrentDataTable.CloneList <MetaDataColumnInfo>();
            int _count = data.Item.Count;

            for (int i = 0; i < _count; i++)
            {
                var child = data.Item[i];
                child.table_comment           = string.Empty;
                child.table_name              = string.Empty;
                child.table_type              = string.Empty;
                _CurrentDataTable[i].IsChoose = false;
            }
        }
Beispiel #6
0
 static MetaDataInfo GetMetaDataInfoByTableName(XmlTemplate xml, string MetaData)
 {
     if (MetaData.IsNullOrEmpty() || null == xml || null == xml.MetaDataItem || 0 == xml.MetaDataItem.Count())
     {
         return(null);
     }
     return(xml.MetaDataItem.Where(p => p.table_name.Equals(MetaData)).GetFirst <MetaDataInfo>());
 }
Beispiel #7
0
 public byte[] GetPdf(XmlTemplate template) {
   PdfDocument doc ...
   CustomElementFactory factory ...
   foreach(XmlNode contentNode in template.ChildNodes) {
     doc.AddElements(factory.GetElement(node).GetContent());
   }
   return doc.CloseDocument();
 }
Beispiel #8
0
 public byte[] GetPdf(XmlTemplate template) {
   PdfDocument doc ...
   CustomElementFactory factory ...
   foreach(XmlNode node in template.ChildNodes) {
     doc.AddElements(factory.GetElement(node).GetContent()); // the point why all this is possible in such an easy generic way is that almost every itext element implements the IElement interface and therefore can be added to the document this way! Good job itext guys! ;)
   }
   return doc.CloseDocument();
 }
Beispiel #9
0
 void DecodeXml(string xml)
 {
     if (xml.IsNullOrEmpty())
     {
         BuilderXml(this.PageInfo);
         return;
     }
     _XmlTemplate      = XmlTemplate.DecodeXml(xml);
     this.Xml_Template = xml;
 }
 void XtnCallFunSelector_Loaded(object sender, RoutedEventArgs e)
 {
     //-->显示标题
     lblSelectCtrl.Text = string.Format("【{0}】控件参数", EventControlName);
     //-->加载其它控件
     _xml = IDesignFramework.GetCurrentXmlTemplate();
     InitLoadingOtherCtrl(_xml);
     BindControlEvent(_xml);
     //-->
     ReappearParam(_xml);
 }
Beispiel #11
0
        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
            this.pft.OpenPageInfo              -= pft_OpenPageInfo;
            this.ct.SelectedItemChanged        -= ct_SelectedItemChanged;
            this.lboxProperty.SelectionChanged -= lboxProperty_SelectionChanged;

            _XmlTemplate_CurrentPage = null;
            _XamlTemplate            = null;
            _PageInfo    = null;
            _ControlInfo = null;
            ct.Dispose();
        }
Beispiel #12
0
        /// <summary>
        /// 结构函数
        /// </summary>
        public PageWorkArea()
        {
            InitializeComponent();

            IsUpdate      = false;
            _XmlTemplate  = new XmlTemplate();
            _XamlTemplate = new XamlTemplate();

            DesignPage.ControlPosition += PageDesign_ControlPosition;
            DesignPage.ControlDelete   += DesignPage_ControlDelete;
            txtXaml.LostFocus          += txtXaml_LostFocus;
            txtXml.LostFocus           += txtXml_LostFocus;
        }
Beispiel #13
0
        /// <summary>
        /// ExecuteSchemaTestXml
        /// </summary>
        /// <typeparam name="TSchema"></typeparam>
        /// <param name="assembly"></param>
        /// <param name="sampleResource"></param>
        /// <param name="generatedDoc"></param>
        /// <param name="targetSchemaNamespace"></param>
        /// <param name="testContext"></param>
        /// <param name="arguments"></param>
        /// <returns></returns>
        public bool ExecuteSchemaTestXml <TSchema>(Assembly assembly, string sampleResource, out XmlDocument generatedDoc, string targetSchemaNamespace = null,
                                                   TestContext testContext = null, params object[] arguments) where TSchema : TestableSchemaBase, new()
        {
            TestableSchemaBase schemaToTest;
            XmlTemplate        xmlTemplate;

            generatedDoc = new XmlDocument();

            if (string.IsNullOrWhiteSpace(sampleResource))
            {
                return(false);
            }

            schemaToTest = new TSchema();

            if (string.IsNullOrWhiteSpace(targetSchemaNamespace))
            {
                targetSchemaNamespace = schemaToTest.Schema.TargetNamespace;
            }

            xmlTemplate = new XmlTemplate(typeof(TSchema), targetSchemaNamespace);

            xmlTemplate.LoadFromResource(assembly, sampleResource);
            if (arguments == null)
            {
                xmlTemplate.Execute();
            }
            else
            {
                xmlTemplate.Execute(arguments);
            }
            var tempFile = new TempFile(xmlTemplate);

            var xmlValidationResult = new XmlValidationResult(schemaToTest,
                                                              tempFile.FilePath);

            if (testContext != null)
            {
                testContext.WriteLine(
                    xmlValidationResult.IsValid
                        ? "Test successful for {0} good sample message. {1}"
                        : "Test failed for {0} good sample message. {1}",
                    schemaToTest.ToString(),
                    xmlValidationResult.Message);
            }

            generatedDoc.Load(tempFile.FilePath);

            return(xmlValidationResult.IsValid);
        }
Beispiel #14
0
            public void ReadXml()
            {
                System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(GetType());
                XmlTemplate <V> value = null;

                using (System.IO.Stream stream = new System.IO.FileStream(FileName, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Read))
                {
                    value = serializer.Deserialize(stream) as XmlTemplate <V>;
                    stream.Close();
                }
                foreach (string k in value.Keys)
                {
                    this[k] = value[k];
                }
            }
        public void RunXmlToCodeTest(string id)
        {
            string      xml      = GetXml(id);
            XmlDocument document = new XmlDocument();

            document.LoadXml(xml);

            XmlTemplate template = new XmlTemplate();

            template.ConstructFromXml(document.GetFirstChild("template"), document);

            string generatedCode = SerializeToCode(template);
            string expectedCode  = GetExpectedResult(id);

            Assert.AreEqual(expectedCode, generatedCode);
        }
Beispiel #16
0
        /// <summary>
        /// 初始化参数
        /// </summary>
        /// <param name="xml"></param>
        void InitParameter(XmlTemplate xml)
        {
            string _controlName = _GetControlName();

            var cei = xml.EventLinkItem.Where(p => p.ControlName == _controlName && p.EventName == EventName).GetFirst <EventLinkInfo>();

            if (null == cei)
            {
                return;
            }
            var ai = cei.Item.Where(p => p.ActivityName == this.ActivityName).GetFirst <ControlActivityInfo>();

            if (null == ai || null == ai.Param || 0 == ai.Param.Count)
            {
                return;
            }
            //-->1、初始化界面信息
            var _SelectedItem = lb_Controls1.Items.Where(p => (p as ListBoxItemExtend).Content.Equals(ai.ControlName)).GetFirst <ListBoxItemExtend>();

            lb_Controls1.SelectedItem = _SelectedItem;
            //-->2、初始化界面方法
            var _SelectedItemFunc = lb_Controls1Function.Items.Where(p => (p as ListBoxItemExtend).Content.Equals(ai.Description)).GetFirst <ListBoxItemExtend>();

            //-->3、初始化控件信息
            _SelectedItemFunc.ControlInfo     = this.IDesignFramework.GetControlInfoByControlName(ai.ControlName);
            lb_Controls1Function.SelectedItem = _SelectedItemFunc;
            //-->给参数里面赋值。
            foreach (var pi in ai.Param)
            {
                var ps = this.sp_Children.Children.Where(p => p is ParameterSelected && (p as ParameterSelected).FieldName.Equals(pi.OrgFieldName)).GetFirst <ParameterSelected>();
                if (null == ps)
                {
                    continue;
                }

                var _target_ci  = this.IDesignFramework.GetControlInfoByControlName(pi.TargetCtrlName);
                var _target_mdi = this.IDesignFramework.GetMetaDataInfoByTableName(_target_ci.MetaData);
                var _target_mdc = _target_mdi.Item.Where(p => p.column_name.Equals(pi.TargetFieldName)).GetFirst <MetaDataColumnInfo>();

                ps.Text                 = _target_mdc.column_comment;
                ps.InitLoadValue        = pi;
                ps.TargetCtrlName       = pi.TargetCtrlName;
                ps.TargetMetaDataColumn = _target_mdc;
                ps.OrgCtrlInfo          = _SelectedItemFunc.ControlInfo;
            }//End foreach;
        }
        /// <summary>
        /// 增加控件绑定事件
        /// </summary>
        void AddCtrlBindEvent(XmlTemplate xml)
        {
            var _cc = ParseControlConfig.GetControlConfig(CurrentSelectedSetEventControl.GetType().Name);
            var _be = _cc.Events.Where(p => p.Name.Equals(this.EventName)).GetFirst <BindEvent>();

            EventBindInfo _ebi = new EventBindInfo();

            _ebi.ControlName = this.EventControlName;
            _ebi.Item        = new List <CtrlBindEventInfo>();

            CtrlBindEventInfo _cbei = new CtrlBindEventInfo();

            _cbei.EventName        = this.EventName;
            _cbei.AssemblyName     = _be.AssemblyName;
            _cbei.BindFunctionName = _be.BindFunctionName;
            _ebi.Item.Add(_cbei);

            xml.EventBindItem.Add(_ebi);
            IDesignFramework.UpdateCurrentTemplate();
        }
Beispiel #18
0
        void InitParameter()
        {
            //-->获取出所有控件的方法来,来至两个地方,第一个接口,第二是控件自己的方法
            _XmlTemplate = IDesignFramework.GetCurrentXmlTemplate();
            string _controlName = Wrapper.ParseControlName(EventControlName);

            _CurrentControlEventInfo = _XmlTemplate.EventLinkItem.Where(p => p.ControlName == _controlName && p.EventName == EventName).GetFirst <EventLinkInfo>();
            if (null != _CurrentControlEventInfo)
            {
                _CurrentControlEventIndex = _XmlTemplate.EventLinkItem.IndexOf(_CurrentControlEventInfo);
                _CurrentActivityInfo      = _CurrentControlEventInfo.Item.Where(p => p.ActivityName == this.ActivityName).GetFirst <ControlActivityInfo>();
                if (null == _CurrentActivityInfo)
                {
                    _CurrentActivityInfo       = new ControlActivityInfo();
                    _CurrentActivityInfo.Param = new List <ParamInfo>();
                }
                else
                {
                    _CurrentActivityInfoIndex = _CurrentControlEventInfo.Item.IndexOf(_CurrentActivityInfo);
                    //-->1、初始化界面信息
                    if (null == _CurrentActivityInfo.Param || 0 == _CurrentActivityInfo.Param.Count)
                    {
                        _CurrentActivityInfo.Param = new List <ParamInfo>();
                        return;
                    }
                    //-->获取出是哪个控件。
                    ct.SetSelectionControl(_CurrentActivityInfo.ControlName);
                }//End if;
            }
            else
            {
                _CurrentControlEventInfo             = new EventLinkInfo();
                _CurrentControlEventInfo.EventName   = this.EventName;
                _CurrentControlEventInfo.ControlName = _controlName;
                _CurrentControlEventInfo.Item        = new List <ControlActivityInfo>();

                _CurrentActivityInfo       = new ControlActivityInfo();
                _CurrentActivityInfo.Param = new List <ParamInfo>();
            }
        }
Beispiel #19
0
        internal static List <MetaDataColumnInfo> GetControlParameter(XmlTemplate xml, string MetaData, string ColumnName)
        {
            if (MetaData.IsNullOrEmpty() || null == xml)
            {
                return(null);
            }
            //-->查找 metadata 里 row里的信息
            var mdis = GetMetaDataInfoByTableName(xml, MetaData);

            if (null == mdis)
            {
                return(null);
            }
            if (ColumnName.IsNullOrEmpty())
            {
                return(mdis.Item);
            }
            var items = ColumnName.Split('|');

            if (1 < items.Length)
            {
                var datas = new List <MetaDataColumnInfo>();
                foreach (var field in items)
                {
                    foreach (var mdci in mdis.Item)
                    {
                        if (mdci.column_name.Equals(field))
                        {
                            datas.Add(mdci);
                            break;
                        }
                    }
                }
                return(datas);
            }
            else
            {
                return(mdis.Item.Where(p => p.column_name.Equals(ColumnName)).GetTList <MetaDataColumnInfo>());
            }
        }
Beispiel #20
0
        /// <summary>
        /// 重绘
        /// </summary>
        internal void Redraw()
        {
            if (null == PageInfo || this.PageInfo.PageContent.IsNullOrEmpty())
            {
                return;
            }
            XElement _xe_page = XElement.Parse(this.PageInfo.PageContent.Trim());

            if (null == _xe_page)
            {
                return;
            }
            XElement _xe_xaml = _xe_page.Element("xaml");
            XElement _xe_xml  = _xe_page.Element("xml");

            string xaml = _xe_xaml != null && _xe_xaml.FirstNode != null?_xe_xaml.FirstNode.ToString() : "";  // _xe_xaml.GetElementValue("xaml");

            string xml = _xe_xml != null && _xe_xml.FirstNode != null?_xe_xml.FirstNode.ToString() : "";

            _XmlTemplate  = XmlTemplate.DecodeXml(xml);
            _XamlTemplate = XamlTemplate.DecodeXml(xaml);

            UserControl uc = Wrapper.CreateUIElement(xaml) as UserControl;

            if (null == uc)
            {
                return;
            }
            this.LayoutRoot.Children.Add(uc);

            //-->给复合控件设置标题内容,和运行时接口。
            SetCompositeCtrlTitleOrInterface();

            //-->给控件注册事件
            RegisterControl();

            //-->加载初化操作。
            LoadInitControl();
        }
        /// <summary>
        /// 绑定控件事件
        /// </summary>
        /// <param name="xml"></param>
        void BindControlEvent(XmlTemplate xml)
        {
            if (AttributeInfo.AssemblyQualifiedName.IsNullOrEmpty())
            {
                return;
            }
            var _ebi = xml.EventBindItem.Where(p => p.ControlName.Equals(this.EventControlName)).GetFirst <EventBindInfo>();

            if (null == _ebi)
            {
                AddCtrlBindEvent(xml);
            }
            else
            {
                //-->获取指定的事件
                var _cbei = _ebi.Item.Where(p => p.EventName.Equals(this.EventName)).GetFirst <CtrlBindEventInfo>();
                if (null == _cbei)      //-->说明事件不存在,增加进去
                {
                    AddCtrlBindEvent(xml);
                }
            }
        }
Beispiel #22
0
        void AddFunctionToStackPanel(string controlName, List <FunctionInfo> item, XmlTemplate _xml)
        {
            if (null == item || 0 == item.Count)
            {
                return;
            }
            double height = ConstantCollection.HEIGHT;

            foreach (var v in item)
            {
                PropertyGridEventBindCtrl pgec = new PropertyGridEventBindCtrl();
                pgec.Name                       = string.Format("pgec_Fun_{0}", v.Name);
                pgec.ShowName                   = v.Description;
                pgec.Height                     = height;
                pgec.MethodName                 = v.Name;
                pgec.ParentControl              = _ReadUIElement;
                pgec.IDesignFramework           = this.IDesignFramework;
                pgec.LostFocus                 += pgec_LostFocus;
                pgec.AttributeInfo              = new EventInfoAttribute(v.Name, null, v.Description, v.EventDesigner);
                pgec.CurrentSelectedControlName = this.CurrentSelectedControlName;

                var eli = _xml.EventLinkItem.Where(
                    p => p.ControlName.Equals(controlName) &&
                    p.EventName.Equals(pgec.MethodName)).GetFirst <EventLinkInfo>();
                if (null != eli && 0 < eli.Item.Count)
                {
                    var _eventItem = from p in eli.Item
                                     select p.Description.IsNullOrEmpty() ? p.EventName : p.Description;

                    string _value      = string.Join(",", _eventItem);
                    string _messageTip = string.Format("[{0}]调用[{1}]方法;{2}", pgec.MethodName, _eventItem.Count(), _value);

                    pgec.LoadInitValue(_value, _messageTip);
                }

                spPValue.Children.Add(pgec);
            }
        }
 void InitLoadingOtherCtrl(XmlTemplate xml)
 {
     foreach (var ctrl in xml.ControlItem)
     {
         var paramsCtrl = CoreHelper.GetControlParameter(xml, ctrl.MetaData.IsNullOrEmpty() ? ctrl.ControlDataSourceTableName : ctrl.MetaData, ctrl.ColumnName);
         if (null == paramsCtrl)
         {
             continue;
         }
         if (ctrl.Name.Equals(this.EventControlName))
         {
             InitloadingSelectCtrl(ctrl, paramsCtrl);
         }
         else
         {
             ListBoxItemExtend item = new ListBoxItemExtend();
             item.Tag         = paramsCtrl;
             item.Content     = ctrl.Name;
             item.ControlInfo = ctrl;
             this.lbCtrls.Items.Add(item);
         }
         _DictCtrlParam.Add(ctrl, paramsCtrl);
     }
 }
        public void LoadTemplates()
        {
            //_commonTemplateDir = Directory.GetCurrentDirectory() + "\\" + _commonTemplateDir;

            /*
             * if (Directory.Exists(_commonTemplateDir) == false) Directory.CreateDirectory(_commonTemplateDir);
             *
             * _projectPath = Directory.GetCurrentDirectory() + "\\" + _projectBase + "\\" + projectName;
             * _scenarioDir = _projectPath + "\\Scenarios";
             */
            String[] subTemplates = Directory.GetDirectories(_commonTemplateDir);
            for (int si = 0; si < subTemplates.Length; si++)
            {
                String subName = subTemplates[si].Substring(subTemplates[si].LastIndexOf("\\") + 1);

                //Cmds.Add(subName);
                //Dictionary<string, XmlTemplate> cmds = Cmds[subName] = new Dictionary<string, XmlTemplate>();
                Dictionary <String, String> icons = Icons[subName] = new Dictionary <string, String>();

                String templateBaseIconPath = Path.GetFullPath((_commonTemplateDir + "\\" + subName + ".png").Replace("/", "\\"));

                if (File.Exists(templateBaseIconPath))
                {
                    TemplateBaseIcons[subName] = templateBaseIconPath;                                   // new BitmapImage(new Uri(templateBaseIconPath));
                }
                String[] filePath = Directory.GetFiles(subTemplates[si]);

                for (int i = 0; i < filePath.Length; i++)
                {
                    //Con_Peer peer = new Con_Peer(peerPaths[i]);
                    String fileName = filePath[i].Substring(filePath[i].LastIndexOf("\\") + 1);

                    string ext  = fileName.Substring(fileName.LastIndexOf(".") + 1).ToLower(); //확장자..
                    String name = fileName.Substring(0, fileName.LastIndexOf("."));            // 확장자를 뗌..
                    //String absName = name;// subName + "." + name;

                    if (ext.Equals("xml"))
                    {
                        XmlDocument xDoc;
                        XmlNode     rootNode = XmlGetter.RootNode(out xDoc, filePath[i]);
                        if (rootNode.Name.ToLower().Equals("packet"))
                        {
                            _templatesPath[name] = filePath[i].Replace("/", "\\");

                            XmlTemplate template = new XmlTemplate(name);
                            template.LoadXml(_templatesPath[name]);

                            _totalTemplates.Add(name, template);
                            if (icons.ContainsKey(name)) //icon이 이전에 설정되었으면
                            {
                                template.ImagePath = icons[name];
                            }
                            else
                            {
                                icons[name] = null; //key를 사용할 것이므로 일단 null이라도 넣어서 방을 만든다.
                            }
                            //cmds.Add(name, template);
                        }
                        else if (rootNode.Name.ToLower().Equals("packetgroup"))
                        {
                        }
                    }
                    else if (ext.Equals("png") || ext.Equals("jpg") || ext.Equals("gif") || ext.Equals("jpeg"))
                    {
                        String fullPath = Path.GetFullPath(filePath[i].Replace("/", "\\"));

                        //BitmapImage img = new BitmapImage(new Uri(fullPath));
                        //icons.Add(name, img);
                        icons[name] = fullPath;                         //path일단 저장
                        if (_totalTemplates.ContainsKey(name))          //template이 먼저 추가되면
                        {
                            _totalTemplates[name].ImagePath = fullPath; //이미지 설정
                        }
                    }
                }
            }

            /*
             * String[] templatePath = Directory.GetFiles(_commonTemplateDir+"\\IOCMD");
             * for (int i = 0; i < templatePath.Length; i++)
             * {
             *  //Con_Peer peer = new Con_Peer(peerPaths[i]);
             *  String name = templatePath[i].Substring(templatePath[i].LastIndexOf("\\") + 1);
             *  name = name.Substring(0, name.LastIndexOf("."));// .xml을 떼어줌..
             *  _templatesPath[name] = templatePath[i].Replace("/", "\\");
             *  XmlTemplate template = new XmlTemplate();
             *  template.LoadXml(_templatesPath[name]);
             *  TOTALCMD.Add(name, template);
             *  IOCMD.Add(name, template);
             * }
             * templatePath = Directory.GetFiles(_commonTemplateDir + "\\LCMD");
             * for (int i = 0; i < templatePath.Length; i++)
             * {
             *  //Con_Peer peer = new Con_Peer(peerPaths[i]);
             *  String name = templatePath[i].Substring(templatePath[i].LastIndexOf("\\") + 1);
             *  name = name.Substring(0, name.LastIndexOf("."));// .xml을 떼어줌..
             *  _templatesPath[name] = templatePath[i].Replace("/", "\\");
             *  XmlTemplate template = new XmlTemplate();
             *  template.LoadXml(_templatesPath[name]);
             *  TOTALCMD.Add(name, template);
             *  LCMD.Add(name, template);
             * }
             * templatePath = Directory.GetFiles(_commonTemplateDir + "\\M1553CMD");
             * for (int i = 0; i < templatePath.Length; i++)
             * {
             *  //Con_Peer peer = new Con_Peer(peerPaths[i]);
             *  String name = templatePath[i].Substring(templatePath[i].LastIndexOf("\\") + 1);
             *  name = name.Substring(0, name.LastIndexOf("."));// .xml을 떼어줌..
             *  _templatesPath[name] = templatePath[i].Replace("/", "\\");
             *  XmlTemplate template = new XmlTemplate();
             *  template.LoadXml(_templatesPath[name]);
             *  TOTALCMD.Add(name, template);
             *  M1553CMD.Add(name, template);
             * }
             *
             *
             * templatePath = Directory.GetFiles(_projectPath + "/Templates");
             *
             * for (int i = 0; i < templatePath.Length; i++)
             * {
             *  //Con_Peer peer = new Con_Peer(peerPaths[i]);
             *  String name = templatePath[i].Substring(templatePath[i].LastIndexOf("\\") + 1);
             *  name = name.Substring(0, name.LastIndexOf("."));// .xml을 떼어줌..
             *  _templatesPath[name] = templatePath[i].Replace("/", "\\");
             *  //node.RelativeObject["peer"] = peer;
             *  //peer.SetName(name);
             *  //_activatedPeerNode = node;
             *
             *
             *  //_peersGroup[peer] = name;//마지막 읽은 group을 _activatedPeer에 배정한다.
             *  //peer.SetMsgList(name, new ConMsgList(name));
             * }
             */
        }
        /// <summary>
        /// 数据重现操作
        /// </summary>
        /// <param name="xml"></param>
        void ReappearParam(XmlTemplate xml)
        {
            string _controlName = CoreHelper.GetControlName(this.CurrentSelectedSetEventControl, this.EventName);
            //-->获取事件
            var cei = xml.EventLinkItem.Where(p => p.ControlName.Equals(_controlName) &&
                                              p.EventName.Equals(EventName)
                                              ).GetFirst <EventLinkInfo>();

            if (null == cei)
            {
                return;
            }
            //-->获取行为
            var ai = cei.Item.Where(p => p.ActivityName.Equals(this.ActivityName)).GetFirst <ControlActivityInfo>();

            if (null == ai || null == ai.Param || 0 == ai.Param.Count)
            {
                return;
            }
            //-->获取控件信息
            var ci = this.IDesignFramework.GetControlInfoByControlName(ai.ControlName);
            //-->1、查找选择控件信息
            var _SelectedItem = lbCtrls.Items.Where(p => (p as ListBoxItemExtend).Content.Equals(ai.ControlName)).GetFirst <ListBoxItemExtend>();

            _SelectedItem.ControlInfo = ci;
            lbCtrls.SelectedItem      = _SelectedItem;
            //-->2、查找选择控件方法
            var _SelectedItemFunc = lbCtrlsFuns.Items.Where(p => (p as ListBoxItemExtend).Content.Equals(ai.Description)).GetFirst <ListBoxItemExtend>();

            _SelectedItemFunc.ControlInfo = ci;
            lbCtrlsFuns.SelectedItem      = _SelectedItemFunc;
            //-->3、查找选择控件的参数
            foreach (var pi in ai.Param)
            {
                var ps = this.spCtrlParams.Children.Where(p => p is ParameterSelected && (p as ParameterSelected).FieldName.Equals(pi.OrgFieldName)).GetFirst <ParameterSelected>();
                if (null == ps)
                {
                    continue;
                }
                var _target_ci = this.IDesignFramework.GetControlInfoByControlName(pi.TargetCtrlName);
                if (null == _target_ci)
                {
                    continue;
                }
                var _target_mdi = this.IDesignFramework.GetMetaDataInfoByTableName(_target_ci.MetaData);
                if (null == _target_mdi)
                {
                    continue;
                }
                var _target_mdc = _target_mdi.Item.Where(p => p.column_name.ToLower().Equals(pi.TargetFieldName.ToLower())).GetFirst <MetaDataColumnInfo>();
                if (null == _target_mdc)
                {
                    continue;
                }
                ps.Text                 = _target_mdc.column_comment;
                ps.TargetCtrlName       = pi.TargetCtrlName;
                ps.TargetMetaDataColumn = _target_mdc;
                ps.OrgCtrlInfo          = _SelectedItemFunc.ControlInfo;
                ps.InitLoadValue        = pi;
            }//End foreach;
        }
 void pftm_OpenPageInfo(object sender, OpenPageInfoEventArgs e)
 {
     _XmlTemplate_CurrentPage = this.pftm.SelectedPageInfo;
     _CurrentPageControl      = this.pftm.PageControl;
 }