コード例 #1
0
ファイル: ScriptInfo.cs プロジェクト: PetX1996/CODSCRIPT
        private static void ReadUsing(ScriptInfo SI, XmlElement usingElem)
        {
            string       name   = string.Empty;
            string       sfPath = string.Empty;
            MemberAccess access = MemberAccess.Public;

            name   = usingElem.GetAttribute("name");
            access = (MemberAccess)Enum.Parse(typeof(MemberAccess), usingElem.GetAttribute("access"));
            foreach (XmlNode curNode in usingElem)
            {
                if (!(curNode is XmlElement))
                {
                    continue;
                }

                XmlElement curElem = (XmlElement)curNode;

                if (curElem.Name == "sfPath")
                {
                    sfPath = curElem.InnerText;
                }
                else
                {
                    throw new XmlException("Unknown ScriptInfo using node '" + curElem.Name + "'");
                }
            }

            UsingInfo usingInfo = new UsingInfo(SI.SF, name, sfPath, access, null);

            SI.AddUsing(usingInfo);
        }
コード例 #2
0
ファイル: ScriptInfo.cs プロジェクト: PetX1996/CODSCRIPT
        /// <summary>
        /// Nájde funkciu v includovaných súboroch.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public UsingInfo FindIncludesUsing(string name)
        {
            UsingInfo curUsing = null;

            foreach (IncludeInfo includeInfo in this.Includes)
            {
                if (includeInfo.SF.SI == null)
                {
                    continue;
                }

                curUsing = includeInfo.SF.SI.FindLocalUsing(name);
                if (curUsing != null)
                {
                    break;
                }
            }
            return(curUsing);
        }
コード例 #3
0
ファイル: ScriptInfo.cs プロジェクト: PetX1996/CODSCRIPT
        /// <summary>
        /// Nájde funkciu na všetkých dostupných miestach.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public UsingInfo FindUsing(string name)
        {
            UsingInfo curUsing = null;

            // search in local file...
            curUsing = FindLocalUsing(name);
            if (curUsing != null)
            {
                return(curUsing);
            }

            // search in includes...
            curUsing = FindIncludesUsing(name);
            if (curUsing != null)
            {
                return(curUsing);
            }

            return(curUsing);
        }
コード例 #4
0
ファイル: ScriptInfo.cs プロジェクト: PetX1996/CODSCRIPT
 public void AddUsing(UsingInfo usingInfo)
 {
     Usings.Add(usingInfo);
     localMembers = null;
 }
コード例 #5
0
ファイル: IReferenceInfo.cs プロジェクト: PetX1996/CODSCRIPT
 /// <summary>
 /// Vytvorí referenciu priamo zo SC.
 /// </summary>
 /// <param name="constInfo"></param>
 /// <param name="charIndex"></param>
 /// <param name="charLength"></param>
 public UsingRefInfo(ScriptFile sf, UsingInfo usingInfo, int charIndex, int charLength, string codePart)
     : this(sf, charIndex, charLength, codePart)
 {
     this._definition = usingInfo;
 }