Esempio n. 1
0
 /// <summary>
 /// Deserializes xml markup from file into an MPDtype object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output MPDtype object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out MPD obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(MPD);
     try
     {
         obj = LoadFromFile(fileName);
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Deserializes workflow markup into an MPDtype object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output MPDtype object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out MPD obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(MPD);
     try
     {
         obj = Deserialize(input);
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Gets all the BaseURL file names from the MPD file
        /// </summary>
        /// <param name="mpdFile"></param>
        /// <returns></returns>
        public static IEnumerable <string> GetFileNames(this MPD mpdFile)
        {
            if (mpdFile is null)
            {
                return(new List <string>());
            }

            List <string> names = new List <string>();

            foreach (var period in mpdFile.Period)
            {
                foreach (var set in period.AdaptationSet)
                {
                    foreach (var representation in set.Representation)
                    {
                        names.AddRange(representation.BaseURL);
                    }
                }
            }

            return(names);
        }
Esempio n. 4
0
 public static bool LoadFromFile(string fileName, out MPD obj)
 {
     System.Exception exception = null;
     return(LoadFromFile(fileName, out obj, out exception));
 }
Esempio n. 5
0
 public static bool Deserialize(string input, out MPD obj)
 {
     System.Exception exception = null;
     return(Deserialize(input, out obj, out exception));
 }
Esempio n. 6
0
 public static bool TryLoadFromFile(string fileName, out MPD obj)
 {
     return(TryLoadFromFile(fileName, out obj, out _));
 }
Esempio n. 7
0
 public static bool TryDeserialize(string input, out MPD obj)
 {
     return(TryDeserialize(input, out obj, out _));
 }