示例#1
0
    public static GuidRef <T> Create(T obj)
    {
        GuidRef <T> result = new GuidRef <T>();

        result.guid      = Guid.NewGuid().ToString();
        result.reference = obj;
        return(result);
    }
示例#2
0
 public override string ToString()
 {
     if (NameRef != null)
     {
         return(string.Format("[refByName: {0}]", NameRef.ToString()));
     }
     else if (GuidRef != null)
     {
         return(string.Format("[refByGuid: {0}]", GuidRef.ToString()));
     }
     else
     {
         return(string.Format("[refByTarget: {0}]", Target.ToString()));
     }
 }