コード例 #1
0
        public MachineContents GetMachineWithDirs(Credentials c, MachineIdentity mid)
        {
            var cl = new Ref.FileSyncModelClient();
            try {
                if (c == null)
                    throw new ArgumentNullException("c", "user credentials must be provided");
                if (mid == null)
                    throw new ArgumentNullException("mid", "machine identity was null");

                MachineContents newM = new MachineContents(mid);
                newM.Directories = cl.GetDirList(c, newM);
                cl.Close();
                if (newM == null)
                    throw new ActionException("Received a null object.", ActionType.User);
                return newM;

                //MachineContents m = null;
                //m = cl.GetMachineWithDirs(c, mid);
                //cl.Close();
                //return m;
            } catch (Exception ex) {
                cl.Abort();
                throw new ActionException("Unable to get list of directories belonging "
                    + "to the machine.", ActionType.Machine, ex);
            }
        }