Exemple #1
0
 protected string StringByPiObject(PropertyInfo _pi, Object _O)
 {
     if (_O == null)
     {
         return("");
     }
     if (Attribute.GetCustomAttribute(_pi, typeof(PasswordPropertyTextAttribute)) != null)
     {
         using (Cry cry = new Cry())
         {
             string ret = cry.to(_O.ToString());
             return(ret);
         }
     }
     if (_O is Color)
     {
         return(ColorTr.ToWin32((Color)_O));
     }
     return(_O.ToString());
 }
Exemple #2
0
 public override string ToString()
 {
     if (O == null)
     {
         return("");
     }
     if (Attribute.GetCustomAttribute(I, typeof(PasswordPropertyTextAttribute)) != null)
     {
         using (Cry cry = new Cry())
         {
             string ret = cry.to(O.ToString());
             return(ret);
         }
     }
     if (O is Color)
     {
         return(ColorTranslator.ToHtml((Color)O));
     }
     return(O.ToString());
 }
Exemple #3
0
 protected void ExecLoad(SerialTree _serialTree, object _o, string _path)
 {
     foreach (PropertyInfo pi in _o.GetType().GetProperties())
     {
         if (Attribute.GetCustomAttribute(pi, typeof(De)) == null)
         {
             continue;
         }
         string ipath = _path + "." + pi.Name;
         object io    = (_o as IParent).AddNew(pi);
         if (io == null)
         {
             if (Attribute.GetCustomAttribute(pi, typeof(PasswordPropertyTextAttribute)) == null)
             {
                 pi.SetValue(_o, GetValue(pi, ipath, _serialTree[ipath]), null);
             }
             else
             {
                 using (Cry cry = new Cry())
                 {
                     string bpwd = cry.from(_serialTree[ipath]);
                     pi.SetValue(_o, bpwd, null);
                 }
             }
         }
         if (io is IParent)
         {
             ExecLoad(_serialTree, io, ipath);
         }
         if (io is IParentList)
         {
             foreach (string npath in _serialTree.GetList(ipath))
             {
                 ExecLoad(_serialTree, (io as IParentList).AddNew(), npath);
             }
             SetCurrent(_serialTree, io, ipath);
         }
     }
 }