コード例 #1
0
        public TdlNamespace AddNamespace(string identifier)
        {
            string[]     namespaces = identifier.Split('.');
            TdlNamespace current    = this;

            foreach (string namespaceIdentifier in namespaces)
            {
                if (current.NamespaceLookup.ContainsKey(namespaceIdentifier))
                {
                    current = current.NamespaceLookup[namespaceIdentifier];
                }
                else
                {
                    TdlNamespace tdlNamespace = new TdlNamespace(namespaceIdentifier, current);
                    current._Namespaces.Add(tdlNamespace);
                    current.NamespaceLookup.Add(namespaceIdentifier, tdlNamespace);
                    current = tdlNamespace;
                }
            }

            if (current.Identifier == namespaces.Last())
            {
                return(current);
            }
            return(null);
        }
コード例 #2
0
 public TdlObject(string identifier, TdlNamespace parent)
 {
     Namespace           = parent;
     Identifier          = identifier;
     ObjectId            = CRC.CalculateCRC32(FullName);
     _RequiredNamespaces = new List <string>();
     _Fields             = new List <TdlField>();
     File.AddStringToHash(FullName);
 }
コード例 #3
0
        public bool HasNamespace(string identifier, int index = 0)
        {
            string[]     namespaces = identifier.Split('.');
            TdlNamespace current    = this;

            foreach (string namespaceIdentifier in namespaces)
            {
                if (current.NamespaceLookup.ContainsKey(namespaceIdentifier))
                {
                    current = current.NamespaceLookup[namespaceIdentifier];
                }
                else
                {
                    return(false);
                }
            }
            return(current.Identifier == namespaces.Last());
        }
コード例 #4
0
        public TdlNamespace(string identifier, TdlNamespace parent = null)
        {
            Identifier      = identifier;
            Parent          = parent;
            _Namespaces     = new List <TdlNamespace>();
            NamespaceLookup = new Dictionary <string, TdlNamespace>();

            _Structs = new List <TdlStruct>();
            StructIdentifierLookup = new Dictionary <string, TdlStruct>();
            StructLookup           = new Dictionary <uint, TdlStruct>();

            _Classes = new List <TdlClass>();
            ClassIdentifierLookup = new Dictionary <string, TdlClass>();
            ClassLookup           = new Dictionary <uint, TdlClass>();

            _Services = new List <TdlService>();
            ServiceIdentifierLookup = new Dictionary <string, TdlService>();
            ServiceLookup           = new Dictionary <uint, TdlService>();
        }
コード例 #5
0
        public TdlNamespace GetNamespace(string identifier)
        {
            string[]     namespaces = identifier.Split('.');
            TdlNamespace current    = this;

            foreach (string namespaceIdentifier in namespaces)
            {
                if (current.NamespaceLookup.ContainsKey(namespaceIdentifier))
                {
                    current = current.NamespaceLookup[namespaceIdentifier];
                }
                else
                {
                    break;
                }
            }
            if (current.Identifier == namespaces.Last())
            {
                return(current);
            }
            return(null);
        }
コード例 #6
0
 public TdlClass(string identifier, TdlNamespace parent) : base(identifier, parent)
 {
     _Methods               = new List <TdlMethod>();
     MethodLookup           = new Dictionary <uint, TdlMethod>();
     MethodIdentifierLookup = new Dictionary <string, TdlMethod>();
 }
コード例 #7
0
 public TdlStruct(string identifier, TdlNamespace parent) : base(identifier, parent)
 {
     _Properties              = new List <TdlProperty>();
     PropertyLookup           = new Dictionary <uint, TdlProperty>();
     PropertyIdentifierLookup = new Dictionary <string, TdlProperty>();
 }