/// <summary> /// Loads the specified file path. /// </summary> /// <param name="filePath">The file path.</param> /// <returns></returns> public static ManagedApplication Load(string filePath) { using (Stream istrm = File.Open(filePath, FileMode.Open, FileAccess.ReadWrite)) { DataContractSerializer serializer = new DataContractSerializer(typeof(ManagedApplication)); ManagedApplication application = (ManagedApplication)serializer.ReadObject(istrm); application.m_sourceFile = new FileInfo(filePath); if (String.IsNullOrEmpty(application.DisplayName)) { string name = application.m_sourceFile.Name; int index = name.LastIndexOf('.'); if (index > 0) { name = name.Substring(0, index); } application.DisplayName = name; } application.LoadSdkConfigFile(); return(application); } }