Ejemplo n.º 1
0
 public static void SaveToFile(string fileName, Model model, ModelExchangeFormat format = ModelExchangeFormat.Xmi)
 {
     using (StreamWriter writer = new StreamWriter(fileName))
     {
         writer.WriteLine(ModelExchange.SaveToString(model, format));
     }
 }
Ejemplo n.º 2
0
 public static Model LoadFromFile(string fileName, ModelExchangeFormat format = ModelExchangeFormat.Xmi)
 {
     using (StreamReader reader = new StreamReader(fileName))
     {
         string text = reader.ReadToEnd();
         return ModelExchange.LoadFromString(text, format);
     }
 }
Ejemplo n.º 3
0
 public static Model LoadFromString(string text, ModelExchangeFormat format = ModelExchangeFormat.Xmi)
 {
     switch (format)
     {
         case ModelExchangeFormat.Xmi:
             return ModelExchange.FromXmi(text);
         case ModelExchangeFormat.Json:
             return ModelExchange.FromJson(text);
         default:
             return null;
     }
 }
Ejemplo n.º 4
0
 public static string SaveToString(Model model, ModelExchangeFormat format = ModelExchangeFormat.Xmi)
 {
     switch (format)
     {
         case ModelExchangeFormat.Xmi:
             return ModelExchange.ToXmi(model);
         case ModelExchangeFormat.Json:
             return ModelExchange.ToJson(model);
         default:
             return string.Empty;
     }
 }