示例#1
0
        new void Load(string filename)
        {
            try
            {
                List <string> la = StaticExtensionXmlParserLibrary.TransformFile(filename) as List <string>;
                List <string> l  = new List <string>();
                for (int ns = 0; ns < la.Count; ns++)
                {
                    string s = la[ns];
                    int    p = 0;
                    for (int k = ns + 1; k < la.Count; k++)
                    {
                        string ss = la[k];
                        if (ss.Length == 0)
                        {
                            break;
                        }
                        if (ss[0] != '\"')
                        {
                            break;
                        }
                        s = s.Substring(0, s.Length - 1) + ss.Substring(1);
                        ++p;
                    }
                    ns += p;
                    l.Add(s);
                }
                to.Text = l;
                if (ucproxy != null)
                {
                    ucproxy.Fill();
                }

                Perform(() => cont.Interface.Clear());
                UpdateAll();
                saveFileDialog.FileName = filename;
            }
            catch (Exception e)
            {
                WindowsExtensions.ControlExtensions.ShowMessageBoxModal(this, e.Message);
            }
        }
示例#2
0
        /// <summary>
        /// Creates object from file
        /// </summary>
        /// <param name="filename">Filename</param>
        /// <returns>Created object</returns>
        public static SimulinkDrawing FromFile(string filename)
        {
            XElement doc = SimulinkXmlParser.Create(StaticExtensionXmlParserLibrary.TransformFile(filename));

            return(new SimulinkDrawing(doc));
        }