public MessageVM(CgbAppInstanceVM instance, Model.Message model) { _config = instance?.Config; _instanceGetter = () => instance; _fallbackInstNameGetter = () => instance?.ShortPath ?? "?"; _model = model; }
public FileDeploymentDataVM(Model.FileDeploymentData model, CgbAppInstanceVM inst) { _model = model; foreach (var msg in _model.Messages) { Messages.Add(new MessageVM(inst, msg)); } }
public WatchedDirectoryVM(WpfApplication app, CgbAppInstanceVM inst, string directoryToWatch) { _app = app; _inst = inst; _dispatcher = System.Windows.Threading.Dispatcher.CurrentDispatcher; Directory = directoryToWatch; FileSystemWatcher = new FileSystemWatcher { Path = Directory, // Which kinds of changes to watch for (strangely enough, without Security, no change-events, WTF?!) NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.Attributes | NotifyFilters.CreationTime | NotifyFilters.Security | NotifyFilters.Size, // Files to be watched will be set later Filter = "TBD" }; Files = new ObservableCollection <WatchedFileVM>(); _inst.IssueAllOnPropertyChanged(); }