Beispiel #1
0
        public override string ToString()
        {
            string assembly         = "DL.Protocol";
            string formatsNamespace = "DL.Protocol.Formats";

            if (FieldFormat == null)
            {
                Type   type            = typeof(T);
                string formatClassName = type.Name + "Format";
                //IFormat<T> format = Tools.CreateInstance<IFormat<T>>(assembly, formatsNamespace, formatClassName);
                Type        formatType = Type.GetType(formatsNamespace + "." + formatClassName);
                IFormat <T> format     = Tools.InvokeStaticMethod <IFormat <T> >(formatType, "GetInstance", null);
                if (format == null)
                {
                    return(base.ToString());
                }
                else
                {
                    return(format.GetString(this, this.GetData()));
                }
            }
            else
            {
                return(FieldFormat.GetString(this, this.GetData()));
            }
        }
Beispiel #2
0
 private static void SetStringType(int strlen, string name, IFormat src, IFormat dst)
 {
     dst.Set(name, src.GetString(name, strlen), strlen);
 }