public WrongReferencePropabilityMetadata(DllMetadata sample, ProbabilityMatch <DllMetadata> match, double probability, string sampleProjectPath, ProjectPoco suspectedProject) : base(sample, match, probability) { //Project = sample.Sample.Project; SuspectedProject = suspectedProject; Reference = sampleProjectPath; }
private void editButton_Click(object sender, RoutedEventArgs e) { ProjectPoco selected = (ProjectPoco)projectDataGrid.SelectedItem; AddProject projWnd = new AddProject(OrganizationId, selected); projWnd.Show(); }
private void projectDataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (projectDataGrid.SelectedItem != null) { ProjectPoco selected = (ProjectPoco)projectDataGrid.SelectedItem; ProjectWindow projectWindow = new ProjectWindow(selected.ProjectId, selected.Name); projectWindow.Show(); } }
public AddProject(int organizationId, ProjectPoco project) //For existing projects { InitializeComponent(); isNew = false; OrganizationId = organizationId; datePicker.SelectedDate = DateTime.Now; Project = project; fillWindow(); }
public AddProject(int organizationId) //For new project { InitializeComponent(); OrganizationId = organizationId; datePicker.SelectedDate = DateTime.Now; isNew = true; DateTime startTime; startTime = (DateTime)datePicker.SelectedDate; Project = new ProjectPoco(this.nameTextBox.Text, startTime, 1, OrganizationId, AboutClientString(), 0); }
/// <summary> /// Creates the project. /// </summary> /// <returns></returns> public virtual IProjectPoco CreateProject() { IProjectPoco project = new ProjectPoco() { Id = Guid.NewGuid(), ProjectUsers = new List <IProjectUserPoco>(), DateCreated = DateTime.UtcNow, DateUpdated = DateTime.UtcNow }; return(project); }
public virtual ReferenceInformation GetReferenceInformation(ProjectPoco projectPoco) { var fullPath = Path.GetFullPath(Path.IsPathRooted(_targetPath) ? _targetPath : Path.Combine(projectPoco.ProjectFilePath.DirectoryPath, _targetPath)); try { return(new ReferenceInformation(fullPath)); } catch (Exception e) { throw new ApplicationException($"Error parsing {projectPoco.Name} -- {fullPath}", e); } }
private static ReferenceInformation ComposeReferenceInformation(ExistingReferenceMetadataBase z, ProjectPoco x, IObserver <Message.Info> observer) { try { return(z.GetReferenceInformation(x)); } catch (Exception e) { observer.OnNextError(e.Message); return(null); } }
private void delButton_Click(object sender, RoutedEventArgs e) { if (projectDataGrid.SelectedItem != null) { MessageWindow message = new MessageWindow("Czy napewno chcesz usunąć zaznaczony projekt?", true); if (message.ShowDialog() == true) { ProjectPoco toDelete = (ProjectPoco)projectDataGrid.SelectedItem; SimpleResponse response = JsonConvert.DeserializeObject <SimpleResponse>(toDelete.ProjectDELETE()); if (response.Succeeded) { MessageBox.Show("Pomyślnie usunięto projekt"); } else { MessageBox.Show("Coś poszło nie tak... \n" + response.Message); } refresh(); } } }
private static IEnumerable <KeyValuePair <ProjectPoco, IEnumerable <string> > > FindMissingNugetReferences( string solutionPath, ProjectPoco projectPoco, IEnumerable <ReferenceInformation> projectReferences, IEnumerable <ExistingReferenceMetadataBase> nugetRefeferenceMetadatas) { var projectReferencessArray = projectReferences.ToArray(); var packagesRootDirectory = Path.GetFullPath(Path.Combine(solutionPath, "packages")); using (var pcs = File.Open(projectPoco.PackagesConfigPath, FileMode.Open)) { string frameworkName; try { frameworkName = GetFrameworkIdentifier(projectPoco, Path.GetDirectoryName(solutionPath)); } catch (Exception e) { return(new[] { new KeyValuePair <ProjectPoco, IEnumerable <string> >( projectPoco, new[] { $"error loading project: {e.Message}" }) }); } var pcr = new PackagesConfigReader(pcs); var packages = pcr.GetPackages() .ToArray(); var packageItems = packages.Select( x => { var packageIdentity = x.PackageIdentity; var nugetPackageItems = GetNugetPackageItems(packageIdentity, frameworkName, packagesRootDirectory); return(new KeyValuePair <PackageIdentity, string[]>(packageIdentity, nugetPackageItems)); }) .ToArray(); var allPackageItems = packageItems.SelectMany( x => x.Value.Select( y => Path.GetFullPath(Path.Combine(packagesRootDirectory, $"{x.Key.Id}.{x.Key.Version}", y.Replace("/", "\\"))))) .ToArray(); var referencesWithoutPackage = projectReferencessArray.Where(x => !string.IsNullOrEmpty(x.FullPath)) .Where(x => x.FullPath.StartsWith(packagesRootDirectory)) .Where(x => !allPackageItems.Contains(x.FullPath)) .Select( x => $"reference to a file inside packages folder [{x.FullPath} {x.AssemblyName}, {x.Version}] without entry in packages.config file. consider to install it from nuget"); var missingNugetReferences = packageItems.Select( y => { var packageIdentity = y.Key; var nugetPackageItems = y.Value; var missingReferencesToNugetPackageDlls = nugetPackageItems .Where(x => projectReferencessArray.Any(z => string.Equals(z.AssemblyName, x))) .Select( x => $"nuget lib folder has dll [{x}], but project doesn't reference it. consier reinstall package [{packageIdentity}]"); return(new KeyValuePair <ProjectPoco, IEnumerable <string> >(projectPoco, missingReferencesToNugetPackageDlls)); }) .ToList(); missingNugetReferences.Add(new KeyValuePair <ProjectPoco, IEnumerable <string> >(projectPoco, referencesWithoutPackage)); return(missingNugetReferences); } }
public override ReferenceInformation GetReferenceInformation(ProjectPoco projectPoco) { return(new ReferenceInformation("I am no implement. make me.", "make me")); }
public virtual ReferenceInformation GetReferenceInformation(ProjectPoco projectPoco) { var fullPath = Path.IsPathRooted(_targetPath) ? _targetPath : Path.Combine(projectPoco.ProjectFilePath.DirectoryPath, _targetPath); return(new ReferenceInformation(fullPath)); }