Ejemplo n.º 1
0
        public Dictionary <string, int> GetTagIds()
        {
            Connect();

            int tagCount = 1;

            if (_tagMap.Count != tagCount)
            {
                Tag[] tags = new Tag[tagCount];
                for (int i = 0; i < tagCount; i++)
                {
                    Tag tag = new Tag();
                    tag.name = String.Format("{0}.Tag {1:D4}", _dataset, i + 1);
                    tag.transformEquation = null;
                    tag.timeExtension     = true;
                    tags[i] = tag;
                }

                int[]  tagIds;
                string error = _session.GetTagIds(tags, out tagIds);
                if (error != null)
                {
                    // handle error
                    return(null);
                }

                for (int i = 0; i < tagCount; i++)
                {
                    _tagMap.Add(tags[i].name, tagIds[i]);
                }
            }

            return(_tagMap);
        }