Exemplo n.º 1
0
        public static ReferenceCollection One(string item)
        {
            ReferenceCollection referenceCollection = new ReferenceCollection();

            referenceCollection.Add(item);
            return(referenceCollection);
        }
Exemplo n.º 2
0
        public override void Write(object target, object value)
        {
            string[]            strArray            = (value ?? string.Empty).ToString().Split('|');
            ReferenceCollection referenceCollection = base.Read(target) as ReferenceCollection;

            if (referenceCollection == null)
            {
                base.Write(target, referenceCollection = new ReferenceCollection());
            }
            referenceCollection.ReplaceAll(strArray.Where(v => !string.IsNullOrWhiteSpace(v)));
        }
Exemplo n.º 3
0
        public override object Read(object target)
        {
            ReferenceCollection referenceCollection = base.Read(target) as ReferenceCollection;

            if (referenceCollection == null || referenceCollection.Count == 0)
            {
                return("");
            }
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("|");
            foreach (string str in referenceCollection)
            {
                stringBuilder.Append(str);
                stringBuilder.Append("|");
            }
            return(stringBuilder.ToString());
        }