Example #1
0
        /// <summary>
        /// Example #2.
        /// Check the metadata of the file from Example #1.
        /// </summary>
        public static void Example2()
        {
            Console.WriteLine("Example #2 - Check the metadata of the file we just uploaded.");
            Console.Write("  Checking metadata... ");

            try
            {
                var documentDuplicate = BoxView.GetDocument(Document1.Id);

                Console.WriteLine("success :)");
                Console.WriteLine("  File ID is " + documentDuplicate.Id + ".");
                Console.WriteLine("  File status is " + documentDuplicate.Status + ".");
                Console.WriteLine("  File name is " + documentDuplicate.Name + ".");
                Console.WriteLine("  File was created on " + documentDuplicate.CreatedAt + ".");
            }
            catch (BoxViewException e)
            {
                Console.WriteLine("failed :(");
                Console.WriteLine("  Error Code: " + e.Code);
                Console.WriteLine("  Error Message: " + e.Message);
            }

            Console.WriteLine();
        }