Parcourir la Source

修改IsSaved调用时值类型错误;调整读取的xml文件及相关程序

mengjie il y a 8 ans
Parent
commit
941995780a

Fichier diff supprimé car celui-ci est trop grand
+ 125 - 0
AlterNormal.xml


BIN
Code/.vs/图形流程编辑器/v14/.suo


+ 18 - 5
Code/IVRFlowEditor/Utility/IVRFlowSerializer.cs

@@ -39,7 +39,9 @@ namespace HySoft.IVRFlowEditor.Utility
39 39
 
40 40
                      if (o.IVRControl != null && o.IVRControl.Count > 0)
41 41
                     {
42
-                        xmlBuilder.Append("<flow Name=\"" + o.IVR_Name + "\" Type=\"" + o.IVRFlowType.ToString() + "\" IVR_Name=\"" + o.IVR_Name + "\"  IVR_Text=\"" + o.IVR_Text + "\" MatchedNum=\"\" MatchedLine=\"\" Concurrency=\"1\"> \r\n");
42
+                        //xmlBuilder.Append("<flow Name=\"" + o.IVR_Name + "\" Type=\"" + o.IVRFlowType.ToString() + "\" IVR_Name=\"" + o.IVR_Name + "\"  IVR_Text=\"" + o.IVR_Text + "\" MatchedNum=\"\" MatchedLine=\"\" Concurrency=\"1\"> \r\n");
43
+                        //2017-4-28修改
44
+                        xmlBuilder.Append("<flow Name=\"" + o.IVR_Name + "\" Type=\"" + o.IVRFlowType.ToString() + "\" IVR_Name=\"" + o.IVR_Name + "\"  IVR_Text=\"" + o.IVR_Text + "\" MatchedNum=\".\" MatchedLine=\"|-1|\" Concurrency=\"1\"> \r\n");
43 45
                         foreach (IVRControlBase ivr in o.IVRControl)
44 46
                         {
45 47
                             Dictionary<int,string> disAtt=new Dictionary<int,string>();
@@ -211,8 +213,9 @@ namespace HySoft.IVRFlowEditor.Utility
211 213
                         XmlNodeList flowNodes = doc.GetElementsByTagName("flow");
212 214
                         foreach (XmlNode node in flowNodes)
213 215
                         {
214
-                            val.Add(new IVRFlowSerializerInfo() { IVR_Name = node.Attributes["IVR_Name"].Value, IVR_Text = node.Attributes["IVR_Text"].Value, IVRFlowType = (IVRFlowType)Enum.Parse(typeof(IVRFlowType), node.Attributes["Type"].Value), IVRControl = new List<IVRControlBase>(), LineNodes = new List<LineInfo>(), IVRVar=new List<IVRDefinevarDefVar>() });
215
-
216
+                            //val.Add(new IVRFlowSerializerInfo() { IVR_Name = node.Attributes["Name"].Value, IVR_Text = node.Attributes["Name"].Value, IVRFlowType = (IVRFlowType)Enum.Parse(typeof(IVRFlowType), node.Attributes["Type"].Value), IVRControl = new List<IVRControlBase>(), LineNodes = new List<LineInfo>(), IVRVar=new List<IVRDefinevarDefVar>() });
217
+                            //2017-4-27
218
+                            val.Add(new IVRFlowSerializerInfo() { IVR_Name = node.Attributes["IVR_Name"].Value, IVR_Text = node.Attributes["IVR_Text"].Value, IVRFlowType = (IVRFlowType)Enum.Parse(typeof(IVRFlowType), node.Attributes["Type"].Value), IVRControl = new List<IVRControlBase>(), LineNodes = new List<LineInfo>(), IVRVar = new List<IVRDefinevarDefVar>() });
216 219
                             XmlNodeList CellNode = node.SelectNodes("cell");
217 220
                             foreach (XmlNode cell in CellNode)
218 221
                             {
@@ -236,7 +239,7 @@ namespace HySoft.IVRFlowEditor.Utility
236 239
                                             if (p.PropertyType == typeof(IVRControlBase))
237 240
                                             {
238 241
                                                 if (cell.Attributes[p.Name].Value != "0" && !string.IsNullOrEmpty(cell.Attributes[p.Name].Value))
239
-                                                    val.Last().LineNodes.Add(new LineInfo() { AttributeName = p.Name, StartNodeID = val.Last().IVRControl.Last().Pos, EndNodeID = cell.Attributes[p.Name].Value });
242
+                                                    val.Last().LineNodes.Add(new LineInfo() { AttributeName = p.Name , StartNodeID = val.Last().IVRControl.Last().Pos, EndNodeID = cell.Attributes[p.Name].Value });
240 243
                                             }
241 244
                                             else if (p.PropertyType.IsEnum)
242 245
                                             {
@@ -267,7 +270,17 @@ namespace HySoft.IVRFlowEditor.Utility
267 270
                                                 if (p.PropertyType == typeof(Int32) || p.PropertyType == typeof(int))
268 271
                                                     p.SetValue(val.Last().IVRControl.Last(), Int32.Parse(cell.Attributes[p.Name].Value), null);
269 272
                                                 else if (p.PropertyType == typeof(Boolean) || p.PropertyType == typeof(bool))
270
-                                                    p.SetValue(val.Last().IVRControl.Last(), bool.Parse(cell.Attributes[p.Name].Value), null);
273
+                                                //2017-4-28添加
274
+                                                {
275
+                                                    bool bvalue = false;
276
+                                                    if (cell.Attributes[p.Name].Value.ToString() == "no")
277
+                                                    { bvalue = false; }
278
+                                                    else if (cell.Attributes[p.Name].Value.ToString() == "yes")
279
+                                                    { bvalue = true ; }
280
+                                                    else
281
+                                                    { bvalue = bool.Parse(cell.Attributes[p.Name].Value); }
282
+                                                    p.SetValue(val.Last().IVRControl.Last(), bvalue, null);//p.SetValue(val.Last().IVRControl.Last(), bool.Parse(cell.Attributes[p.Name].Value), null);//2017-4-28
283
+                                                }
271 284
                                                 else
272 285
                                                     p.SetValue(val.Last().IVRControl.Last(), cell.Attributes[p.Name].Value.ToString(), null);
273 286
                                             }

BIN
Code/IVRFlowEditor/bin/Debug/IVRFlowEditor.dll


BIN
Code/IVRFlowEditor/bin/Debug/IVRFlowEditor.pdb


BIN
Code/IVRFlowEditor/obj/x86/Debug/IVRFlowEditor.dll


BIN
Code/IVRFlowEditor/obj/x86/Debug/IVRFlowEditor.pdb


+ 19 - 7
Code/IVRFlowUI/FrmMain.cs

@@ -137,15 +137,27 @@ namespace IVRFlowUI
137 137
                     svf.InitialDirectory = Application.StartupPath;
138 138
                     //2017-4-26
139 139
                     #region 直接按原文件名进行保存
140
+                    bool pd = false;
140 141
                     string fp = this.tabControl1.SelectedTab.Text;
141
-                    int ffp = fp.IndexOf(".xml");
142
-                    int startindex = fp.LastIndexOf("\\");
143
-                    int leng = ffp - startindex-1;
144
-                    string fn = fp.Substring(startindex+1 ,leng);
145
-                    svf.FileName = this.tabControl1.SelectedTab.Text;//fn;
142
+                    if (this.tabControl1.SelectedTab.Text != "空白标签")
143
+                    {
144
+                        int ffp = fp.IndexOf(".xml");
145
+                        int startindex = fp.LastIndexOf("\\");
146
+                        int leng = ffp - startindex - 1;
147
+                        string fn = fp.Substring(startindex + 1, leng);
148
+                        svf.FileName = this.tabControl1.SelectedTab.Text;//fn;
149
+                        pd = true;
150
+                    }
151
+                    else
152
+                    {
153
+                        if (svf.ShowDialog() == DialogResult.OK)
154
+                        {
155
+                            pd = true;
156
+                        }
157
+                    }
146 158
                     #endregion
147 159
 
148
-                    //if (svf.ShowDialog() == DialogResult.OK)
160
+                    if(pd==true)//if (svf.ShowDialog() == DialogResult.OK)
149 161
                     {
150 162
                         List<IVRFlowSerializerInfo> f = new List<IVRFlowSerializerInfo>();
151 163
                         foreach(TabPage tp  in  this.tabControl1.SelectedTab.Controls[0].Controls)
@@ -162,7 +174,7 @@ namespace IVRFlowUI
162 174
                         }
163 175
                         MessageInfo msg =GlobalController.GetSerializerHandle().SaveFileInfo(svf.FileName, f);
164 176
                          MessageBox.Show(msg.Message);
165
-                        this.tabControl1.SelectedTab.Text = fp ;//this.tabControl1.SelectedTab.Text = svf.FileName;//2017-4-26修改
177
+                        this.tabControl1.SelectedTab.Text = svf.FileName;
166 178
 
167 179
                     }
168 180
 

BIN
Code/IVRFlowUI/bin/Debug/IVRFlowEditor.dll


BIN
Code/IVRFlowUI/bin/Debug/IVRFlowEditor.pdb


BIN
Code/IVRFlowUI/bin/Debug/IVRFlowUI.exe


BIN
Code/IVRFlowUI/bin/Debug/IVRFlowUI.pdb


BIN
Code/IVRFlowUI/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache


BIN
Code/IVRFlowUI/obj/x86/Debug/IVRFlowUI.csprojResolveAssemblyReference.cache


BIN
Code/IVRFlowUI/obj/x86/Debug/IVRFlowUI.exe


BIN
Code/IVRFlowUI/obj/x86/Debug/IVRFlowUI.pdb


BIN
Code/图形流程编辑器/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache


BIN
~$R流程文件说明(新).docx