Beispiel #1
0
        protected override void ComputeString(IDescriptionBuilder context)
        {
            context.Append("{");
            var attributes = Enumerable.Range(0, _Attributes.Count)
                             .Select(i => new { name = _TypePropertyAccessor.AttributeNames[i], value = _Attributes[i] })
                             .OrderBy(at => at.name);

            var first = true;

            foreach (var att in attributes)
            {
                if (!first)
                {
                    context.Append(",");
                }

                first = false;
                context.Append($@"""{att.name}"":");

                using (context.PushContext(att.name))
                {
                    att.value.BuilString(context);
                }
            }

            context.Append("}");
        }
Beispiel #2
0
        protected override void ComputeString(IDescriptionBuilder context)
        {
            context.Append("[");
            var count = 0;

            foreach (var it in Items)
            {
                if (count != 0)
                {
                    context.Append(",");
                }

                using (context.PushContext(count++))
                {
                    it.BuilString(context);
                }
            }
            context.Append("]");
        }
Beispiel #3
0
        public void BuilString(IDescriptionBuilder context)
        {
            var contextualName = context.GetContextualName(this as IJsCsGlue);

            if (contextualName != null)
            {
                context.Append(contextualName);
                return;
            }
            ComputeString(context);
        }
Beispiel #4
0
        protected override void ComputeString(IDescriptionBuilder context)
        {
            context.Append("{");
            for (var i = 0; i < _Attributes.Count; i++)
            {
                if (i != 0)
                {
                    context.Append(",");
                }

                var name = _TypePropertyAccessor.AttributeNames[i];
                context.Append($@"""{name}"":");

                using (context.PushContext(name))
                {
                    _Attributes[i].BuilString(context);
                }
            }

            context.Append("}");
        }
 public void BuilString(IDescriptionBuilder context)
 {
     context.Append(ToString());
 }