Exemple #1
0
        public static void ToString(TypeRef obj, MethodReturnEventArgs <string> e)
        {
            e.Result = String.Format("{0}{1}",
                                     obj.Deleted == true ? "(DELETED) " : string.Empty,
                                     obj.FullName);

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #2
0
        public static void ToString(Zetbox.App.Base.AccessControl obj, MethodReturnEventArgs <string> e)
        {
            e.Result = String.Format("{0} ({1}) {2}",
                                     obj.Name ?? string.Empty,
                                     obj.Rights != null ? obj.Rights.ToString() :  "None",
                                     obj.Description ?? string.Empty);

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #3
0
        public static void ToString(RelationEnd obj, MethodReturnEventArgs <string> e)
        {
            e.Result = String.Format("RelationEnd {0}({1})",
                                     obj.RoleName,
                                     obj.Type == null
                    ? "no type"
                    : obj.Type.Name);

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #4
0
        public static void ToString(DataType obj, MethodReturnEventArgs <string> e)
        {
            e.Result = String.Format("{0}.{1}",
                                     obj.Module == null
                    ? "[no module]"
                    : obj.Module.Namespace,
                                     obj.Name);

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #5
0
        public static void ToString(BaseParameter obj, MethodReturnEventArgs <string> e)
        {
            e.Result = string.Format("{0}{1} {2}",
                                     obj.IsReturnParameter
                    ? "[Return] "
                    : String.Empty,
                                     obj.GetParameterTypeString(),
                                     obj.Name);

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #6
0
        public static void ToString(Method obj, MethodReturnEventArgs <string> e)
        {
            // TODO: IsValid?
            if (obj.ObjectClass != null && obj.ObjectClass.Module != null)
            {
                e.Result = obj.ObjectClass.Module.Namespace + "." +
                           obj.ObjectClass.Name + "." + obj.Name;

                ToStringHelper.FixupFloatingObjectsToString(obj, e);
            }
            else
            {
                e.Result = String.Format("new Method #{0}: {1}", obj.ID, obj.Name);
            }
        }
Exemple #7
0
 public static void ToString(Property obj, MethodReturnEventArgs <string> e)
 {
     if (obj.ObjectClass == null)
     {
         e.Result = String.Join(" ", new[] { "unattached", obj.Name });
     }
     else
     {
         e.Result = String.Format("{0} {1}.{2}",
                                  obj.GetPropertyTypeString(),
                                  obj.ObjectClass.Name,
                                  obj.Name);
     }
     ToStringHelper.FixupFloatingObjectsToString(obj, e);
 }
Exemple #8
0
        public static void ToString(Relation obj, MethodReturnEventArgs <string> e)
        {
            if (obj.A == null ||
                obj.B == null ||
                obj.A.Type == null ||
                obj.B.Type == null)
            {
                e.Result = "incomplete relation:";
                if (obj.A == null)
                {
                    e.Result += " A missing";
                }
                else
                {
                    e.Result += " A.Type missing";
                }

                if (obj.B == null)
                {
                    e.Result += " B missing";
                }
                else
                {
                    e.Result += " B.Type missing";
                }
            }
            else
            {
                string aDesc = (obj.A.RoleName ?? String.Empty).Equals(obj.A.Type.Name)
                    ? obj.A.RoleName
                    : String.Format("{0}({1})", obj.A.RoleName, obj.A.Type.Name);

                string bDesc = (obj.B.RoleName ?? String.Empty).Equals(obj.B.Type.Name)
                    ? obj.B.RoleName
                    : String.Format("{0}({1})", obj.B.RoleName, obj.B.Type.Name);

                e.Result = String.Format("Relation: {0} {1} {2}",
                                         aDesc,
                                         obj.Verb,
                                         bDesc);
            }

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #9
0
        public static void ToString(Assembly obj, MethodReturnEventArgs <string> e)
        {
            e.Result = obj.Name;

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #10
0
        public static void ToString(EnumerationEntry obj, MethodReturnEventArgs <string> e)
        {
            e.Result = obj.Enumeration + "." + obj.Name;

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #11
0
        public static void ToString(Zetbox.App.Base.Identity obj, MethodReturnEventArgs <string> e)
        {
            e.Result = (obj.DisplayName ?? string.Empty) + " (" + (obj.UserName ?? string.Empty) + ")";

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #12
0
        public static void ToString(Zetbox.App.Base.Blob obj, MethodReturnEventArgs <System.String> e)
        {
            e.Result = obj.OriginalName;

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }
Exemple #13
0
        public static void ToString(Zetbox.App.Base.ServiceDescriptor obj, MethodReturnEventArgs <System.String> e)
        {
            e.Result = obj.Description;

            ToStringHelper.FixupFloatingObjectsToString(obj, e);
        }