public OpenFromPackageViewModel(IDialogFactory dialogFactory, TemplateLoader templateLoader, MessageManager messageManager, string projectLanguage, IProjectConfiguraiton projectConfiguration) { if (dialogFactory == null) { throw new ArgumentNullException(nameof(dialogFactory)); } if (templateLoader == null) { throw new ArgumentNullException(nameof(templateLoader)); } if (messageManager == null) { throw new ArgumentNullException(nameof(messageManager)); } if (projectConfiguration == null) { throw new ArgumentNullException(nameof(projectConfiguration)); } this.dialogFactory = dialogFactory; this.templateLoader = templateLoader; this.messageManager = messageManager; this.projectLanguage = projectLanguage; this.selectedFolderPath = projectConfiguration.LastSelectedDir; this.lastSelectedMFFile = projectConfiguration.LastSelectedMfFile; this.isUseVSFormattingCode = projectConfiguration.UseVSFormatting; this.SelectedSearchType = projectConfiguration.LastSelectedSearchTypeInOpenFromPackage; folderBrowserCommand = new RelayCommand(OnFolderBrowserCommandClicked); okCommand = new RelayCommand <object>(OnOkClicked, IsOkButtonEnabled); closeCommand = new RelayCommand <object>(OnCloseCliked); SelectedEventSpecificData = EventSpecificData.First(); }
public OpenFromArasViewModel( IAuthenticationManager authenticationManager, IDialogFactory dialogFactory, IProjectConfigurationManager configurationManager, IProjectConfiguraiton projectConfiguration, TemplateLoader templateLoader, PackageManager packageManager, string pathToProjectConfigFile, string projectName, string projectFullName, string projectLanguage) { if (authenticationManager == null) { throw new ArgumentNullException(nameof(authenticationManager)); } if (dialogFactory == null) { throw new ArgumentNullException(nameof(dialogFactory)); } if (configurationManager == null) { throw new ArgumentNullException(nameof(configurationManager)); } if (projectConfiguration == null) { throw new ArgumentNullException(nameof(projectConfiguration)); } if (templateLoader == null) { throw new ArgumentNullException(nameof(templateLoader)); } if (packageManager == null) { throw new ArgumentNullException(nameof(packageManager)); } this.authenticationManager = authenticationManager; this.dialogFactory = dialogFactory; this.configurationManager = configurationManager; this.projectConfiguration = projectConfiguration; this.templateLoader = templateLoader; this.packageManager = packageManager; this.pathToProjectConfigFile = pathToProjectConfigFile; this.projectName = projectName; this.projectFullName = projectFullName; this.projectLanguage = projectLanguage; this.isUseVSFormattingCode = projectConfiguration.UseVSFormatting; this.editConnectionInfoCommand = new RelayCommand <object>(EditConnectionInfoCommandClicked); this.searchMethodDialogCommand = new RelayCommand <object>(SearchMethodDialogCommandClicked); this.okCommand = new RelayCommand <object>(OkCommandCliked, IsEnabledOkButton); this.closeCommand = new RelayCommand <object>(OnCloseCliked); ConnectionInformation = projectConfiguration.Connections.First(c => c.LastConnection); SelectedEventSpecificData = EventSpecificData.First(); }
public CreateMethodViewModel( IAuthenticationManager authenticationManager, IDialogFactory dialogFactory, IProjectConfiguraiton projectConfiguration, TemplateLoader templateLoader, PackageManager packageManager, IProjectManager projectManager, IArasDataProvider arasDataProvider, ICodeProvider codeProvider, IGlobalConfiguration userConfiguration, MessageManager messageManager) { if (authenticationManager == null) { throw new ArgumentNullException(nameof(authenticationManager)); } if (dialogFactory == null) { throw new ArgumentNullException(nameof(dialogFactory)); } if (projectConfiguration == null) { throw new ArgumentNullException(nameof(projectConfiguration)); } if (templateLoader == null) { throw new ArgumentNullException(nameof(templateLoader)); } if (packageManager == null) { throw new ArgumentNullException(nameof(packageManager)); } if (projectManager == null) { throw new ArgumentNullException(nameof(projectManager)); } if (arasDataProvider == null) { throw new ArgumentNullException(nameof(arasDataProvider)); } if (codeProvider == null) { throw new ArgumentNullException(nameof(codeProvider)); } if (userConfiguration == null) { throw new ArgumentNullException(nameof(userConfiguration)); } if (messageManager == null) { throw new ArgumentNullException(nameof(messageManager)); } this.authenticationManager = authenticationManager; this.dialogFactory = dialogFactory; this.projectConfiguration = projectConfiguration; this.templateLoader = templateLoader; this.packageManager = packageManager; this.projectManager = projectManager; this.arasDataProvider = arasDataProvider; this.codeProvider = codeProvider; this.globalConfiguration = userConfiguration; this.messageManager = messageManager; this.isUseVSFormattingCode = projectConfiguration.UseVSFormatting; this.UserCodeTemplates = LoadUserCodeTemplates(); this.SelectedUserCodeTemplate = this.userCodeTemplates.First(); this.methodItemTypeInfo = arasDataProvider.GetMethodItemTypeInfo(); this.MethodNameMaxLength = methodItemTypeInfo.NameStoredLength; this.MethodCommentMaxLength = methodItemTypeInfo.CommentsStoredLength; actionLocations = new ObservableCollection <ListInfo>(); foreach (var localtion in Utilities.Utils.GetValueListByName(authenticationManager.InnovatorInstance, "Action Locations")) { string value = localtion.getProperty("value", string.Empty); if (string.Equals(value, "client")) { continue; } actionLocations.Add(new ListInfo(value, localtion.getProperty("label", string.Empty))); } allLanguages = new List <FilteredListInfo>(); foreach (var language in Utilities.Utils.GetFilterValueListByName(authenticationManager.InnovatorInstance, "Method Types")) { string value = language.getProperty("value"); string label = language.getProperty("label"); string filter = language.getProperty("filter"); if (string.Equals(filter, "server", StringComparison.CurrentCultureIgnoreCase) && !string.Equals(value, this.codeProvider.Language, StringComparison.CurrentCultureIgnoreCase)) { continue; } allLanguages.Add(new FilteredListInfo(value, label, filter)); } SelectedActionLocation = actionLocations.First(al => string.Equals(al.Value.ToLowerInvariant(), "server")); okCommand = new RelayCommand <object>(OnOkClick, IsEnabledOkButton); cancelCommand = new RelayCommand <object>(OnCancelClick); closeCommand = new RelayCommand <object>(OnCloseCliked); selectedIdentityCommand = new RelayCommand(SelectedIdentityCommandClick); browseCodeTemplateCommand = new RelayCommand(BrowseCodeTemplateCommandClick); deleteUserCodeTemplateCommand = new RelayCommand <KeyValuePair <string, XmlMethodInfo> >(DeleteUserCodeTemplateCommandClick); SelectedEventSpecificData = EventSpecificData.First(); }