public LeafNode(BranchNode parent, string name, string value)
            : base(parent, name)
        {
            this.Value = value;
            MemberName = base.MemberName;

            if (Configuration.Config.IsFormatStringEnabled && ResourceName.StartsWith("$"))
            {
                this.MemberName        = Helper.Refine(ResourceName.Substring(1));
                this.FormatStringValue = new FormattableResourceString(value);
            }
        }
Beispiel #2
0
        protected Node(BranchNode parent, string resourceName)
        {
            if (parent != null)
            {
                if (!parent.ChildrenResourceNames.Add(resourceName))
                {
                    throw new InvalidOperationException($"Dupicated resource name `{resourceName}`");
                }
                parent.Childern.Add(this);
            }

            this.Parent       = parent;
            this.ResourceName = resourceName;

            this.MemberName = Helper.Refine(resourceName);
        }
 public BranchNode(BranchNode parent, string name)
     : base(parent, name)
 {
     this.ClassName = Helper.Refine(Helper.GetRandomName(ResourceName));
     this.FieldName = "s_" + Helper.Refine(Helper.GetRandomName(ResourceName));
 }