Exemplo n.º 1
0
 internal override void _OnAfterApiSerialize(object r, bool withClean)
 {
     if (r == null)
     {
         return;
     }
     if (this._Source != null)
     {
         if (this._Source._ClassName() == "Archive")
         {
             object s = withClean ? this._Source.ApiSerialize(true) : new System.Collections.Generic.Dictionary <string, object> {
                 { "ID", this._Source._Id() }
             };
             (r as System.Collections.Generic.Dictionary <string, object>)["SourceArchive"] = s;
         }
         else
         {
             if (this._Source._ClassName() == "Disk")
             {
                 object s = withClean ? this._Source.ApiSerialize(true) : new System.Collections.Generic.Dictionary <string, object> {
                     { "ID", this._Source._Id() }
                 };
                 (r as System.Collections.Generic.Dictionary <string, object>)["SourceDisk"] = s;
             }
             else
             {
                 this._Source = null;
                 Util.ValidateType(this._Source, "Disk or Archive", true);
             }
         }
     }
 }
Exemplo n.º 2
0
 internal override void _OnAfterApiDeserialize(object r, object root)
 {
     if (r != null)
     {
         this._Activity.SetSourceId(this._Id());
         if ((r as System.Collections.Generic.Dictionary <string, object>).ContainsKey("SourceDisk"))
         {
             object s = (r as System.Collections.Generic.Dictionary <string, object>)["SourceDisk"];
             if (s != null)
             {
                 object id = (s as System.Collections.Generic.Dictionary <string, object>)["ID"];
                 if (id != null)
                 {
                     this._Source = new Disk(this._Client, s);
                 }
             }
         }
         if ((r as System.Collections.Generic.Dictionary <string, object>).ContainsKey("SourceArchive"))
         {
             object s = (r as System.Collections.Generic.Dictionary <string, object>)["SourceArchive"];
             if (s != null)
             {
                 object id = (s as System.Collections.Generic.Dictionary <string, object>)["ID"];
                 if (id != null)
                 {
                     this._Source = Resource.CreateWith("Archive", this._Client, s);
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 internal override void _OnAfterApiDeserialize(object r, object root)
 {
     if (root != null)
     {
         if ((root as System.Collections.Generic.Dictionary <string, object>).ContainsKey("FTPServer"))
         {
             object ftp = (root as System.Collections.Generic.Dictionary <string, object>)["FTPServer"];
             if (ftp != null)
             {
                 this._FtpInfo = new FtpInfo(ftp);
             }
         }
     }
     if (r != null)
     {
         if ((r as System.Collections.Generic.Dictionary <string, object>).ContainsKey("SourceArchive"))
         {
             object s = (r as System.Collections.Generic.Dictionary <string, object>)["SourceArchive"];
             if (s != null)
             {
                 object id = (s as System.Collections.Generic.Dictionary <string, object>)["ID"];
                 if (id != null)
                 {
                     this._Source = new Archive(this._Client, s);
                 }
             }
         }
         if ((r as System.Collections.Generic.Dictionary <string, object>).ContainsKey("SourceDisk"))
         {
             object s = (r as System.Collections.Generic.Dictionary <string, object>)["SourceDisk"];
             if (s != null)
             {
                 object id = (s as System.Collections.Generic.Dictionary <string, object>)["ID"];
                 if (id != null)
                 {
                     this._Source = Resource.CreateWith("Disk", this._Client, s);
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
 public Resource Set_source(Resource source)
 {
     this._Source = source;
     return(source);
 }