Example #1
0
        public void GetMap(XML_TYPE xmltype, out List <Completion> list, IGlyphService gs, string key, string pro)
        {
            list = new List <Completion>();
            ImageSource ico = gs.GetGlyph(StandardGlyphGroup.GlyphKeyword, StandardGlyphItem.GlyphItemPublic);

            AddProValue(ref list, key, pro, ref ico);
        }
Example #2
0
    protected bool Load(string XmlPath, XML_TYPE Type)
    // ERROR: Optional parameters aren't supported in C# XML_TYPE Type)
    {
        bool retcode = false;

        try
        {
            //Apparently MSDN says that this will autoformat the xml if I leave it false. We'll see
            XmlDoc.PreserveWhitespace = false;
            try
            {
                if (XmlPath == null || XmlPath.Equals(string.Empty))
                {
                    _XMLDocOpen     = false;
                    _XmlError       = true;
                    _XmlErrorDetail = "File not found.";
                    retcode         = false;
                }

                switch (Type)
                {
                case XML_TYPE.Filename:

                    FileInfo XmlFile = new FileInfo(XmlPath);
                    if (!XmlFile.Exists)
                    {
                        _XMLDocOpen     = false;
                        _XmlError       = true;
                        _XmlErrorDetail = "File not found.";

                        return(false);
                    }

                    XmlDoc.Load(XmlPath);
                    _XmlFile = XmlPath;

                    break;

                case XML_TYPE.RawXml:
                    XmlDoc.LoadXml(XmlPath);

                    break;
                }
                _XMLDocOpen = true;
            }
            catch (System.IO.FileNotFoundException io)
            { }
            //Console.WriteLine(io.FileName)
        }
        catch (XmlException xmlexp)
        {
            _XMLDocOpen     = false;
            _XmlError       = true;
            _XmlErrorDetail = string.Concat(xmlexp.ToString(), " ", xmlexp.Message);

            retcode = false;
        }
        return(retcode);
    }
Example #3
0
        public void GetMap(XML_TYPE xmltype, out List <Completion> list, MAPTYPE mapttype, IGlyphService gs, string key = null)
        {
            list = new List <Completion>();
            ImageSource ico = gs.GetGlyph(StandardGlyphGroup.GlyphKeyword, StandardGlyphItem.GlyphItemPublic);

            switch (mapttype)
            {
            case MAPTYPE.C:
            {
                foreach (KeyValuePair <string, CtrlInf> pair in m_controlMap)
                {
                    //第一个是显示的单词,第二个是插入的单词,第三个说明
                    list.Add(new Completion(pair.Key, pair.Key, pair.Value.getdes(), ico, "c"));
                }
            }
            break;

            case MAPTYPE.P:
            {
                addProToList(ref list, key, ref ico);
            }
            break;
            }
        }
Example #4
0
 public XmlManager(string Xml, XML_TYPE Type)
 {
     //If I want to do from cache at a certain point then i can use LoadXml and I have to put another param in
     Load(Xml, Type);
 }