public IsPartOfCurrentProject(CurrentProject currentProject, ProjectRepository projectRepository, ProjectOptions projectOptions) { _currentProject = currentProject; _projectRepository = projectRepository; _projectOptions = projectOptions; }
public void CompareCheckMissingModules() { CurrentProject.SetProjectPath(@"C:/project/"); List <string> testAllLanguages = new List <string> { "en" }; CurrentProject.SetAllLanguage(testAllLanguages); MockFileSystem mockFileSystem = new MockFileSystem(new Dictionary <string, MockFileData> { { Path.Combine(CurrentProject.Path, testAllLanguages[0], "global.json"), new MockFileData("{'home':'town'}") }, { Path.Combine(CurrentProject.Path, testAllLanguages[0], "home.json"), new MockFileData("{'living':'fun'}") }, { Path.Combine(CurrentProject.Path, "Meta", "global.json"), new MockFileData("{'home':'otherstuf'}") }, { Path.Combine(CurrentProject.Path, "Meta", "Default", "global.json"), new MockFileData("{'home':''}") } }); JsonCompare jsonCompare = new JsonCompare(mockFileSystem); bool checkMissing = jsonCompare.Compare(); if (checkMissing) { Assert.Fail(); } }
private void unloadedassemblymenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Name == "addtoproject") { NodeAssemblyData data = (NodeAssemblyData)objectview.SelectedNode.Tag; CurrentProject.AddManifest(data.AssemblyName); CurrentProject.Save(CurrentProjectFilename); data.Included = true; data.Loaded = true; data.Definition = LoadAssembly(data.AssemblyName); objectview.SelectedNode.ImageKey = "accept.png"; objectview.SelectedNode.SelectedImageKey = "accept.png"; objectview.SelectedNode.Nodes.Clear(); string realfilename = Path.Combine(CurrentProject.TargetDirectory, data.AssemblyName + ".dll"); string origfilename = Path.Combine(CurrentProject.TargetDirectory, data.AssemblyName + "_Original.dll"); if (!File.Exists(origfilename)) { CreateOriginal(realfilename, origfilename); } // Populate PopulateAssemblyNode(objectview.SelectedNode, data.Definition); } }
/// <summary> /// Discards selected changes from the selected project. /// </summary> public void Discard(string[] files) { if (CheckProjects()) { return; } ClientUI.ShowProgress("Discarding..."); try { var diffs = CurrentProject.BuildDiff(); var diff = diffs.Where(file => files.Any(x => x == file.FileName)).ToList(); var commit = Commit.FromDiff(diff.ToArray()); CurrentProject.Discard(commit.Files, x => { ClientUI.SetProgress("Discarding " + diff.Count + " change(s). " + x); }); } catch (Exception ex) { ClientUI.ShowMessage("Error when discarding, no changes were discared, message: <br>" + ex.Message, true); } ClientUI.HideProgress(); ClientUI.ShowProgress("Discarding done! Loading..."); CurrentProject.Refresh(delegate { UpdateView(); ClientUI.HideProgress(); }); }
//Autogenerated code. End of implementation [GetState_OpenSchematics] //Autogenerated code. Begin of implementation [Command_OpenSchematics] public void Command_OpenSchematics(IServerDocumentView view, ref string parameters) { IDXPWorkSpace CurrentWorkspace = DXP.GlobalVars.DXPWorkSpace; IDXPProject CurrentProject; int LogicalDocumentCount; int LoopIterator; IDXPDocument CurrentSheet; CurrentProject = CurrentWorkspace.DM_FocusedProject(); LogicalDocumentCount = CurrentProject.DM_LogicalDocumentCount(); ISch_Document SchDoc; IClient Client = DXP.GlobalVars.Client; for (LoopIterator = 1; LoopIterator <= LogicalDocumentCount; LoopIterator++) { CurrentSheet = CurrentProject.DM_LogicalDocuments(LoopIterator - 1); if (CurrentSheet.DM_DocumentKind() == "SCH") { SchDoc = CurrentSheet as ISch_Document; //Open document if not already open. if (!Client.IsDocumentOpen(CurrentSheet.DM_FullPath())) { Client.ShowDocument(Client.OpenDocument("SCH", CurrentSheet.DM_FullPath())); } } } }
/// <inheritdoc /> public async Task ExportAsync() { var openDialogOptions = new OpenDialogOptions { Title = Translator.Translate("Please choose the Export location"), Properties = new[] { OpenDialogProperty.openDirectory } }; var exportPath = (await ElectronHelper.ShowOpenDialogAsync(ElectronHelper.GetBrowserWindow(), openDialogOptions)).FirstOrDefault(); if (!string.IsNullOrWhiteSpace(exportPath)) { ExportStatus = ExportStatus.Exporting; // this is really not nice, but otherwise, // the UI won't be refreshed and no status message is displayed. ElectronHelper.ReloadBrowserWindow(); CurrentProject.ExportImages(exportPath, i => ElectronHelper.SetProgressBar(i)); ExportStatus = ExportStatus.ExportSuccessful; ElectronHelper.SetProgressBar(-1); // remove progress bar // this is really not nice, but otherwise, // the UI won't be refreshed and no status message is displayed. ElectronHelper.ReloadBrowserWindow(); } }
private void SetCopyTeamButtonProperties() { try { CurrentProject currentProject = SessionManager.GetCurrentProject(this.Page) as CurrentProject; object connectionManager = SessionManager.GetConnectionManager(this.Page); if (connectionManager != null) { ProjectCoreTeamMember coreTeamMember = new ProjectCoreTeamMember(connectionManager); coreTeamMember.IdProject = currentProject.Id; coreTeamMember.IdAssociate = currentProject.IdAssociate; btnOpenPopupCopyCoreTeam.Visible = (coreTeamMember.IsAssociatePMOnProject()); btnOpenPopupCopyCoreTeam.OnClientClick = "ShowPopUpWithReload('" + ResolveUrl("~/UserControls/Budget/ProjectCopyCoreTeam/CopyCoreTeam.aspx") + "', 0, 700, '" + ResolveUrl("~/Catalogs.aspx?Code=CRT") + "', '" + ResolveUrl("~/Default.aspx?SessionExpired=1") + "', 'true', '" + this.Page.Form.ClientID + "');return false;"; } } catch (IndException ex) { ReportControlError(ex); return; } catch (Exception ex) { ReportControlError(new IndException(ex)); return; } }
private void ImportAssimpModel(ImportModelsDialog imd) { ProjectManager.StartBatchChanges(); foreach (var model in imd.ModelsToImport) { var geom = Meshes.MeshConverter.AssimpToLdd(imd.SceneToImport, model.Mesh); var surface = CurrentProject.Surfaces.FirstOrDefault(x => x.SurfaceID == model.SurfaceID); if (surface == null) { surface = new PartSurface(model.SurfaceID, CurrentProject.Surfaces.Max(x => x.SubMaterialIndex) + 1); CurrentProject.Surfaces.Add(surface); } var partModel = surface.Components.FirstOrDefault(x => x.ComponentType == ModelComponentType.Part); if (partModel == null) { partModel = new PartModel(); surface.Components.Add(partModel); } var modelMesh = CurrentProject.AddMeshGeometry(geom, model.Name); partModel.Meshes.Add(new ModelMeshReference(modelMesh)); } ProjectManager.EndBatchChanges(); }
/// <summary> /// MOVE THIS CODE /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BasinMenu_BasinSwitch_Click(object sender, RoutedEventArgs e) { DanoBasinSwitcherHost DBSH = new DanoBasinSwitcherHost(CurrentProject.GetBasinNames()); DBSH.Owner = this; DBSH.Show(); }
public SwitchBase AddComponent(SwitchBase sourceComponent, PointF pt) { SwitchBase switchBase = Activator.CreateInstance(sourceComponent.GetType()) as SwitchBase; if (sourceComponent is VariableSwitch && switchBase is VariableSwitch) { var variableComponent = switchBase as VariableSwitch; variableComponent.VariableKey = ((VariableSwitch)sourceComponent).VariableKey; } var sourcePrefabSwitch = sourceComponent as PrefabSwitch; if (sourcePrefabSwitch != null && switchBase is PrefabSwitch) { var prefabSwitch = switchBase as PrefabSwitch; prefabSwitch.Prefab = sourcePrefabSwitch.Prefab; } if (switchBase != null) { switchBase.Position = pt; CurrentProject.Add(this, switchBase); return(switchBase); } return(null); }
/// <summary> /// Pulls all changes on the selected project. /// </summary> public void Pull() { if (CheckProjects()) { return; } try { ClientUI.ShowProgress("Pulling changes..."); CurrentProject.Pull(x => { ClientUI.SetProgress("Pulling..." + x); }); ClientUI.HideProgress(); ClientUI.ShowProgress("Pulling done! Loading..."); CurrentProject.Refresh(delegate { UpdateView(); ClientUI.HideProgress(); }); } catch (WarningException ex) { ClientUI.HideProgress(); ClientUI.ShowMessage(ex.Message); } catch (Exception ex) { ClientUI.HideProgress(); ClientUI.ShowMessage("Error when pulling, no changes were pulled, message: <br>" + ex.Message, true); } }
private bool TryGeneratingSymbolMetadata(ISymbol symbol, SyntaxNode syntax, out SymbolMetadata generatedSymbolMetadata) { generatedSymbolMetadata = null; var filePathsOfSourceDeclarations = symbol .Locations .Where(location => location.IsInSource) .Select(location => location.GetLineSpan().Path) .Select(path => CurrentProject.GetRelativePathToFile(path)) .ToArray(); if (!filePathsOfSourceDeclarations.Any()) { return(false); } var assignedSymbolId = Guid.NewGuid().ToString("N"); generatedSymbolMetadata = new SymbolMetadata( assignedSymbolId, symbol.MetadataName, filePathsOfSourceDeclarations, symbol.Kind); return(true); }
public AddingVersionResponse AddNewVersion(string repositoryName, string tags) { CurrentProject project = _currentProjectRepository.FindCurrentProject(); if (project.BuildDirectory.IsMissing) { return(new AddingVersionResponse(AddingVersionResponse.Status.NoBuildDirectory)); } if (project.BuildDirectory.IsEmpty) { return(new AddingVersionResponse(AddingVersionResponse.Status.BuildDirectoryEmpty)); } RepositorySet repositorySet = project.RepositorySet; Repository repository; if (repositorySet.HasMoreThanOneRepository) { if (String.IsNullOrEmpty(repositoryName)) { return(new AddingVersionResponse(AddingVersionResponse.Status.AmbiguousRepositoryName)); } repository = repositorySet.FindRepositoryByName(repositoryName); } else { repository = repositorySet.DefaultRepository; } // ArchivedProjectAndVersion version = project.CreateNewVersion(); project.AddNewVersion(repository, new Tags(tags)); _repositoryRepository.SaveRepository(repository); return(new AddingVersionResponse(AddingVersionResponse.Status.Success)); }
private void SaveCurrentProject(bool isDefaultPosition = true) { if (CurrentProject == null) { return; } SaveCurrentTasks(); if (CurrentProject.Tasks.Any() == false && MessageBox.Show(GlobalHelper.Get("key_316"), GlobalHelper.Get("key_151"), MessageBoxButton.OKCancel) == MessageBoxResult.Cancel) { return; } if (isDefaultPosition) { ControlExtended.SafeInvoke(() => CurrentProject.Save(dataManager.DataCollections), LogType.Important, GlobalHelper.Get("key_317")); var pro = ConfigFile.GetConfig <DataMiningConfig>().Projects.FirstOrDefault(); if (pro != null) { pro.SavePath = CurrentProject.SavePath; } } else { CurrentProject.SavePath = null; ControlExtended.SafeInvoke(() => CurrentProject.Save(dataManager.DataCollections), LogType.Important, GlobalHelper.Get("key_318")); } ConfigFile.Config.SaveConfig(); }
private void UpdateConnectorList(bool rebuild) { string prevSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string; using (FlagManager.UseFlag("UpdateConnectorList")) { if (rebuild) { Connections.Clear(); } if (CurrentProject != null) { var studConnectors = CurrentProject.GetAllElements <PartConnection>(x => x.ConnectorType == LDD.Primitives.Connectors.ConnectorType.Custom2DField); if (rebuild) { Connections.AddRange(studConnectors); } else { Connections.SyncItems(studConnectors); } } } string currentSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string; if (prevSelectedID != currentSelectedID) { FillSelectedConnector(false); } }
protected void btnReject_Click(object sender, EventArgs e) { try { TrackingActivityLog tkl = new TrackingActivityLog(SessionManager.GetConnectionManager(this.Page)); CurrentUser currentUser = SessionManager.GetSessionValueRedirect(this.Page, SessionStrings.CURRENT_USER) as CurrentUser; //if (currentUser.UserRole.Id == ApplicationConstants.ROLE_BUSINESS_ADMINISTATOR || currentUser.UserRole.Id == ApplicationConstants.ROLE_KEY_USER) //{ // currentUser.IdProjectFunctionImpersonated = ApplicationConstants.INT_NULL_VALUE; //} CurrentProject currentProject = SessionManager.GetSessionValueRedirect(this.Page, SessionStrings.CURRENT_PROJECT) as CurrentProject; bool isFake; string versionNo; switch (BudgetType) { case 0: RejectInitialBudget(); versionNo = "1"; break; case 1: RejectRevisedBudget(); RevisedBudget revBudget = new RevisedBudget(SessionManager.GetConnectionManager(this.Page)); revBudget.IdProject = currentProject.Id; versionNo = revBudget.GetVersionNumber(out isFake); break; case 2: RejectCompletionBudget(); ReforecastBudget refBudget = new ReforecastBudget(SessionManager.GetConnectionManager(this.Page)); refBudget.IdProject = currentProject.Id; versionNo = refBudget.GetVersionNumber(out isFake); break; default: throw new IndException("Unknown budget type: " + BudgetType.ToString()); } if (!string.IsNullOrEmpty(versionNo)) { currentProject.IdVersion = int.Parse(versionNo); } tkl.InsertTrackingActivityLog(currentProject, currentUser, ETrackingActivity.DisapprovedBudget); } catch (IndException ex) { ReportControlError(ex); return; } catch (Exception ex) { ReportControlError(new IndException(ex)); return; } //navigate back to followup ParentPage.ResponseRedirect("~/Pages/Budget/FollowUpBudget/FollowUpBudget.aspx?BudgetType=" + BudgetType + "&BudgetVersion=" + BudgetVersion); }
private void UpdateElementList(bool rebuild) { string prevSelectedID = ElementsComboBox.ComboBox.SelectedValue as string; using (FlagManager.UseFlag(nameof(UpdateElementList))) { if (rebuild || CurrentProject == null) { Connections.Clear(); } if (CurrentProject != null) { var studConnectors = CurrentProject.GetAllElements <PartConnection>(); if (rebuild) { Connections.AddRange(studConnectors); } else { Connections.SyncItems(studConnectors); } } } string currentSelectedID = ElementsComboBox.ComboBox.SelectedValue as string; if (prevSelectedID != currentSelectedID) { SetCurrentObject(ElementsComboBox.SelectedItem as PartConnection, false); } }
public override void Execute(object parameter) { AddPSMDiagramCommand c = AddPSMDiagramCommandFactory.Factory().Create(CurrentProject.GetModelController()) as AddPSMDiagramCommand; c.Set(CurrentProject, null); c.Execute(); }
protected virtual bool ExecutePerInterface(InterfaceWithAttributeResult a) { // Load Macro var macroname = GetMacroName(a.TypeName, a.Attribute, out var args, out var outputname); var macro = MacroFactory.GetMacro <MacroTypeVariables>(macroname, a.FsPath, out var errores); // Check for errors in macro if (macro == null) { OutputEngine.LogConsoleErrorWrite($"{a.TypeName} : {macroname}"); foreach (var e in errores) { OutputEngine.LogConsoleErrorWrite(e); } return(false); } // Execute macro var refinterface = args[0].StartsWith("I") ? args[0] : ""; var refdata = Engine.GetRecordForSymbol(refinterface); var variables = CreateVariables(a, outputname, a.AttributeList, refdata); var res = macro.Execute(variables, out var error); // Check for errors if (!res) { OutputEngine.LogConsoleErrorWrite(error); } // Write Results CurrentProject.WriteResults(variables); return(res); }
/// <inheritdoc /> public async Task SaveProjectAsync() { if (string.IsNullOrWhiteSpace(CurrentProject.ProjectPath)) { var saveDialogOptions = new SaveDialogOptions { Title = Translator.Translate("Please choose where to save your Project File"), Filters = new[] { new FileFilter { Extensions = new[] { "json" }, Name = Translator.Translate("Project File") } } }; var saveFilePath = await ElectronHelper.ShowSaveDialogAsync(ElectronHelper.GetBrowserWindow(), saveDialogOptions); if (string.IsNullOrWhiteSpace(saveFilePath)) { return; } CurrentProject.ProjectPath = saveFilePath; } await CurrentProject.SaveAsync(); }
public void SaveCurrentTasks() { foreach (var process in CurrentProcessCollections) { SaveTask(process, false); } CurrentProject.Save(); }
/// <summary> /// Cancel a currently running work /// </summary> public static void Cancel() { CurrentProject.Cancel(); if (!HasInit) { NewProject(UsedProgram); } }
private void CalcGeomBoundingButton_Click(object sender, EventArgs e) { if (CurrentProject != null && !InternalSet) { var bounding = CurrentProject.CalculateBoundingBox(); GeomBoundingEditor.Value = bounding; } }
/// <summary> /// Closes the current project and releases all data associated with it /// </summary> public static void Close() { if (CurrentProject != null) { CurrentProject.Dispose(); CurrentProject = null; } }
/// <summary> /// Writes processing data or images to disk /// </summary> public static void ProcessFiles() { if ((CurrentProject.Type == ProjectType.LapseStudio && !Directory.Exists(ImageSavePath)) || (CurrentProject.Type == ProjectType.RawTherapee && ((ProjectRT)CurrentProject).RunRT && !Directory.Exists(ImageSavePath))) { throw new DirectoryNotFoundException("Output directory doesn't exist"); } CurrentProject.ProcessFiles(); }
private void ContextMenu_AddSurface_Click(object sender, EventArgs e) { if (CurrentProject != null) { var newSurface = CurrentProject.AddSurface(); ProjectManager.SelectElement(newSurface); SelectElementNodeDelayed(newSurface); } }
public UpdateProjectInfo(IContentEvents contentEvents, IProjectEnhancementsStore projectEnhancementsStore, CurrentProject currentProject, ProjectOptions projectOptions) { _contentEvents = contentEvents; _projectEnhancementsStore = projectEnhancementsStore; _currentProject = currentProject; _projectOptions = projectOptions; }
public LatestContentResolver(IContentStoreModelCreator contentStoreModelCreator, IContentVersionRepository contentVersionRepository, LanguageResolver languageResolver, IContentLoader contentLoader, ProjectContentResolver projectContentResolver, CurrentProject currentProject) { _contentStoreModelCreator = contentStoreModelCreator; _contentVersionRepository = contentVersionRepository; _languageResolver = languageResolver; _contentLoader = contentLoader; _projectContentResolver = projectContentResolver; _currentProject = currentProject; }
protected void Page_Load(object sender, EventArgs e) { try { LoadCurrentUser(); if (CurrentUser != null) { //check user role to see if ShowOnly Combobox will be visible if (CurrentUser.UserRole.Id == ApplicationConstants.ROLE_FINANCIAL_TEAM) { lblShowOnly.Visible = false; cmbShowOnly.Visible = false; } if (!Page.IsPostBack) { CurrentProject currentProject = (CurrentProject)SessionManager.GetSessionValueNoRedirect(this, SessionStrings.CURRENT_PROJECT); //check to see if we have something already selected if (currentProject != null) { //fill in the hard coded values to display FillShowOnlyValues(); LoadOwnersFiltered(currentProject.IdOwner); cmbOW.SelectedValue = currentProject.IdOwner.ToString(); LoadProgramsFiltered(currentProject.IdOwner); cmbPG.SelectedValue = currentProject.IdProgram.ToString(); LoadProjectsFiltered(currentProject.IdProgram); cmbPJ.SelectedValue = currentProject.Id.ToString(); UpdateFunctionLabel(); UpdateActiveMembersLabel(); UpdateTimingIntercoPercentLabel(); UpdateInitialBudgetValidatedLabel(); } else { PopulateComboBoxes(); } } } } catch (IndException ex) { ShowError(ex); return; } catch (Exception ex) { ShowError(new IndException(ex)); return; } }
public void DeleteDiagram(DiagramModel diagram) { CurrentProject.RemoveDiagram(diagram); var diagramViewModel = Diagrams.FirstOrDefault(m => m.Model == diagram); if (diagramViewModel != null) { Diagrams.Remove(diagramViewModel); } }
public void SaveCurrentProject(CurrentProject project) { foreach (ProjectReference projectReference in project.References) { if (projectReference.Status.IsOlderVersionInstalled) { projectReference.UnpackageIfNecessary(); } } Infrastructure.ProjectManifestRepository.SaveProjectManifestStore(project.Manifests); }
/// <summary> /// Updates the current project data in the database. /// </summary> /// <param name="currentProject"> /// The project data to be used in the update /// </param> public void UpdateCurrentProject( CurrentProject currentProject ) { OpenProjectLoader.UpdateCurrentProject( currentProject ); }
/// <summary> /// The update current project. /// </summary> /// <param name="currentProject"> /// The current project. /// </param> public static void UpdateCurrentProject( CurrentProject currentProject ) { if( null == currentProject ) return; using( ImpactDatabase database = new ImpactDatabase() ) { ImpactUpdate update = new ImpactUpdate( ImpUser.Instance ) { Columns = { { ImpUser.CurrentFactory, currentProject.Factory }, { ImpUser.CurrentProject, currentProject.Project.PadLeft( 12 ) }, }, Where = { ImpUser.Userid.Equal( currentProject.User ) } }; string statement = update.ToString(); database.ExecuteNonQuery( statement ); } }