public SerializationMixin( Diagram diagram, MessageSystem messageSystem, ApplicationSettings applicationSettings) { _diagram = diagram; _messageSystem = messageSystem; _applicationSettings = applicationSettings; _fileName = applicationSettings.LastFile; }
public RendererViewModel( Diagram diagram, ApplicationSettings settings, MessageSystem messageSystem) { _diagram = diagram; _settings = settings; _yumleHttpConnection.BaseAddress = new Uri(settings.YumlBaseUrl); _yumleHttpConnection.DefaultRequestHeaders.Add("Accept-Language", "en-GB,en-US,de-DE,de-AT;q=0.8,en;q=0.6,ru;q=0.4"); RegisterForDomainChanges(messageSystem); // update the diagram the first time UpdateDiagram(); }
private void ConfigureDomainModel() { var diagram = new Diagram(); var classifierDictionary = diagram.Classifiers; _container.Instance(diagram); _container.Instance(classifierDictionary); _container.Singleton<MessageSystem>(); _container.Singleton<DeletionService>(); _container.Singleton<IRelationService,RelationService>(); _container.Singleton<IAskUserBeforeDeletionService, AskUserBeforeDeletionService>(); _container.Singleton<ViewModelContext>(); _container.Singleton<CommandFactory>(); _container.PerRequest<DiagramCommands>(); // load application settings var applicationSettings = new ApplicationSettings(); var applicationSettingsPath = Combine( GetFolderPath(SpecialFolder.ApplicationData), "umlsketch"); if (!Exists(applicationSettingsPath)) { try { CreateDirectory(applicationSettingsPath); } catch (Exception) { // could not create the application folder, so // use the appdata folder directly applicationSettingsPath = GetFolderPath(SpecialFolder.ApplicationData); } } var settingsFilePath = Combine(applicationSettingsPath,"umlsketch.settings"); applicationSettings.Load(settingsFilePath); _container.Instance(applicationSettings); }
public MainViewModel( DiagramCommands commands, Diagram diagram, ViewModelContext context, ApplicationSettings applicationSettings) { Requires(commands != null); Requires(diagram != null); Requires(applicationSettings != null); Requires(context != null); _context = context; _commands = commands; _diagram = diagram; _applicationSettings = applicationSettings; _serialization = new SerializationMixin(diagram, _context.MessageSystem,applicationSettings); // reload the view models when the classifiers are reset after // a load operation _context.MessageSystem.Subscribe<ClassifiersResetEvent>(diagram.Classifiers,_ => UpdateViewModels()); // try to load the last file that was edited by the user LoadLastFile(); }
public AskUserBeforeDeletionService(ApplicationSettings settings) { _settings = settings; }