Пример #1
0
 private void TryCreateFacet(Actor actor, string typeName)
 {
     try
     {
         if (typeName != "From File...") actor.CreateFacet<Facet>(typeName);
         else
         {
             OpenFileDialog opener = new OpenFileDialog { RestoreDirectory = true };
             if (opener.ShowDialog() == DialogResult.OK) actor.CreateFacetFromFile<Facet>(opener.FileName);
         }
     }
     catch (ArgumentException e)
     {
         MessageBox.Show(e.Message, "Invalid Facet Type");
     }
 }