當前位置: 首頁>>代碼示例>>C#>>正文


C# Model.Solution類代碼示例

本文整理匯總了C#中ripple.Model.Solution的典型用法代碼示例。如果您正苦於以下問題:C# Solution類的具體用法?C# Solution怎麽用?C# Solution使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Solution類屬於ripple.Model命名空間,在下文中一共展示了Solution類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ForSolution

        public static PersistenceExpression<Solution> ForSolution(Solution target)
        {
            var file = "{0}-{1}.config".ToFormat(typeof(Solution).Name, Guid.NewGuid());
            var fileSystem = new FileSystem();

            if (fileSystem.FileExists(file))
            {
                fileSystem.DeleteFile(file);
            }

            var writer = ObjectBlockWriter.Basic(new RippleBlockRegistry());
            var contents = writer.Write(target);
            Debug.WriteLine(contents);
            fileSystem.WriteStringToFile(file, contents);

            var reader = SolutionLoader.Reader();

            var specification = new PersistenceSpecification<Solution>(x =>
            {
                var fileContents = fileSystem.ReadStringFromFile(file);
                var readValue = Solution.Empty(); 
                reader.Read(readValue, fileContents);

                fileSystem.DeleteFile(file);

                return readValue;
            });

            specification.Original = target;

            return new PersistenceExpression<Solution>(specification);
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:32,代碼來源:CheckObjectBlockPersistence.cs

示例2: SetUp

        public void SetUp()
        {
            theSolution = new Solution();
            theSolution.ClearFeeds();

            theSolution.AddFeed(Feed.Fubu);
            theSolution.AddFeed(Feed.NuGetV2);

            theSolution.AddDependency(fubucore = new Dependency("FubuCore", "1.0.1.201"));

            var theProject = new Project("Test.csproj");
            theSolution.AddProject(theProject);

            theProject.AddDependency(bottles = new Dependency("Bottles"));
            theProject.AddDependency(rhinomocks = new Dependency("RhinoMocks", "3.6.1", UpdateMode.Fixed));
            theProject.AddDependency(structuremap = new Dependency("StructureMap", "2.6.3", UpdateMode.Fixed));

            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                    .Add("Bottles", "1.0.2.2")
                    .Add("FubuCore", "1.0.2.232")
                    .Add("StructureMap", "2.6.4.71");

                scenario.For(Feed.NuGetV2)
                    .Add("RhinoMocks", "3.6.1")
                    .Add("StructureMap", "2.6.3");

                scenario.For(theSolution.Cache.ToFeed());

                scenario.Online();
            });
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:33,代碼來源:finding_project_nugets_to_restore.cs

示例3: SetUp

        public void SetUp()
        {
            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", sln =>
                {
                    sln.LocalDependency("FubuCore", "1.1.0.0");

                    sln.ProjectDependency("Test1", "FubuCore");
                });
            });

            theSolution = theScenario.Find("Test");

            FeedScenario.Create(scenario =>
            {
                scenario.For(theSolution.Cache.ToFeed())
                        .Add("FubuCore", "1.1.0.0")
                        .Add("FubuCore", "1.2.0.0");

                scenario.Offline();
            });

            theBuilder = new NugetPlanBuilder();

            theRequest = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("FubuCore"),
                Operation = OperationType.Update,
                ForceUpdates = false
            };
        }
開發者ID:kjnilsson,項目名稱:ripple,代碼行數:33,代碼來源:update_an_existing_floated_dependency_offline.cs

示例4: SetUp

        public void SetUp()
        {
            FeedScenario.Create(scenario =>
                {
                    scenario.For(Feed.Fubu)
                            .Add("FubuCore", "1.1.0.0")
                            .Add("FubuCore", "1.2.0.0");
                });

            theScenario = SolutionScenario.Create(scenario =>
                {
                    scenario.Solution("Test", sln =>
                        {
                            sln.LocalDependency("FubuCore", "1.1.0.0");

                            sln.ProjectDependency("Test1", "FubuCore");
                        });
                });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
                {
                    Solution = theSolution,
                    Dependency = new Dependency("FubuCore"),
                    Operation = OperationType.Update,
                    ForceUpdates = false
                };

            thePlan = theBuilder.PlanFor(request);
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:33,代碼來源:update_an_existing_floated_dependency.cs

示例5: SetUp

        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("fubu", "1.2.0.0"));

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("fubu", "1.0.0.1", UpdateMode.Fixed);
                    test.LocalDependency("fubu", "1.0.0.1");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("fubu"),
                Operation = OperationType.Update,
                ForceUpdates = false
            };

            thePlan = theBuilder.PlanFor(request);
        }
開發者ID:4lexm,項目名稱:ripple,代碼行數:27,代碼來源:updating_to_a_higher_version_of_an_existing_fixed_solution_dependency.cs

示例6: SetUp

        public void SetUp()
        {
            theCacheFeed = new Feed("file://cache");
            theFileSystemFeed = new Feed("file://feed");

            FeedScenario.Create(scenario =>
            {
                scenario.For(theCacheFeed)
                        .Add("Dependency1", "1.0.0.0");

                scenario.For(theFileSystemFeed)
                        .Add("Dependency1", "1.1.0.0");

                scenario.For(Feed.NuGetV2)
                        .Add("Dependency1", "1.0.23.0");
            });

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("Dependency1", "1.1.0.0", UpdateMode.Float);
                });
            });

            theSolution = theScenario.Find("Test");
            theSolution.ClearFeeds();
            theSolution.AddFeed(theFileSystemFeed);
            theSolution.AddFeed(Feed.NuGetV2);

            theSolution.UseCache(new InMemoryNugetCache(theCacheFeed));
        }
開發者ID:johnsimons,項目名稱:ripple,代碼行數:32,代碼來源:feed_order_with_cache.cs

示例7: SetUp

        public void SetUp()
        {
            theSolution = new Solution();
            theProject = theSolution.AddProject("Project1");

            theRunner = new NugetStepRunner(theSolution);
        }
開發者ID:bobpace,項目名稱:ripple,代碼行數:7,代碼來源:NugetStepRunnerTester.cs

示例8: FeedService

        public FeedService(Solution solution)
        {
            _solution = solution;
            _dependenciesCache.OnMissing = key => findDependenciesFor(key.Dependency, key.Mode, SearchLocation.Local);

            ServicePointManager.DefaultConnectionLimit = 10;
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:7,代碼來源:FeedService.cs

示例9: SetUp

        public void SetUp()
        {
            theSolution = new Solution();
            p1 = theSolution.AddProject("MyProject");

            p1.AddDependency("Bottles");
            p1.AddDependency("FubuCore");
            p1.AddDependency("FubuLocalization");

            p2 = theSolution.AddProject("MyOtherProject");
            p2.AddDependency("FubuMVC.Core");

            theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed));
            theSolution.AddDependency(new Dependency("FubuCore", "1.1.0.0", UpdateMode.Float));
            theSolution.AddDependency(new Dependency("FubuLocalization", "1.2.0.0", UpdateMode.Fixed));
            theSolution.AddDependency(new Dependency("FubuMVC.Core", "1.4.0.0", UpdateMode.Fixed));

            theNugetSpec = new NugetSpec("MyProject", "myproject.nuspec");

            theGroup = new NuspecTemplate(theNugetSpec, new[]
            {
                new ProjectNuspec(p1, new NugetSpec("MyProject", "MyProject.nuspec")), 
                new ProjectNuspec(p2, new NugetSpec("MyOtherProject", "MyOtherProject.nuspec"))
            });
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:25,代碼來源:SpecGroupTester.cs

示例10: persists_and_retrieves_the_solution

        public void persists_and_retrieves_the_solution()
        {
            var solution = new Solution
            {
                Name = "Test",
                BuildCommand = "rake",
                FastBuildCommand = "rake compile",
                Feeds = new[] { Feed.NuGetV2, Feed.NuGetV1 },
                Nugets = new[] { new Dependency("FubuCore", "1.0.1.0") }
            };

            var group = new DependencyGroup();
            group.Dependencies.Add(new GroupedDependency("FubuCore"));
            solution.Groups.Add(group);

            var constrainedDependency = new Dependency("Bottles", "1.0.0.0")
            {
                VersionConstraint = VersionConstraint.DefaultFloat
            };
            solution.AddDependency(constrainedDependency);

            solution.Nuspecs.Add(new NuspecMap { File = "Temp", Project = "Test"});

            CheckXmlPersistence.For(solution);
        }
開發者ID:4lexm,項目名稱:ripple,代碼行數:25,代碼來源:SolutionPersistence.cs

示例11: SetUp

        public void SetUp()
        {
            theScenario = SolutionGraphScenario.Create(scenario =>
                {
                    scenario.Solution("Test", test =>
                        {
                            test.SolutionDependency("FubuCore", "1.2.0.0", UpdateMode.Float);
                            test.SolutionDependency("UnneededAnywhereButHere", "1.2.0.0", UpdateMode.Float);

                            test.ProjectDependency("Test1", "FubuCore");
                            test.ProjectDependency("Test1", "UnneededAnywhereButHere");

                            test.ProjectDependency("Test2", "FubuCore");

                            test.LocalDependency("FubuCore", "1.2.0.0");
                            test.LocalDependency("UnneededAnywhereButHere", "1.2.0.0");
                        });
                });

            theSolution = theScenario.Find("Test");

            RippleOperation
                .With(theSolution)
                .Execute<RemoveInput, RemoveCommand>(new RemoveInput { Nuget = "FubuCore", ProjectFlag = "Test1"});
            RippleOperation
                .With(theSolution)
                .Execute<RemoveInput, RemoveCommand>(new RemoveInput { Nuget = "UnneededAnywhereButHere", ProjectFlag = "Test1" });

            theSolution = SolutionBuilder.ReadFrom(theScenario.DirectoryForSolution("Test"));
        }
開發者ID:4lexm,項目名稱:ripple,代碼行數:30,代碼來源:remove_a_dependency_from_a_project.cs

示例12: SetUp

        public void SetUp()
        {
            theFinder = MockRepository.GenerateStub<INuspecTemplateFinder>();
            
            theSolution = new Solution();
            theSolution.AddProject("Project1");
            theSolution.AddProject("Project2");

            d1 = new NuspecDependencyToken("DependencyA", "1.0.0.0", VersionConstraint.DefaultFixed);
            d2 = new NuspecDependencyToken("DependencyB", "1.0.0.0", VersionConstraint.DefaultFixed);

            g1 = new NuspecTemplate(new NugetSpec("Spec1", "Spec1.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project1")) });
            g2 = new NuspecTemplate(new NugetSpec("Spec2", "Spec2.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project2")) });

            theTemplates = new NuspecTemplateCollection(new[] { g1, g2 });

            src1 = MockRepository.GenerateStub<INuspecDependencySource>();
            src2 = MockRepository.GenerateStub<INuspecDependencySource>();

            theFinder.Stub(x => x.Templates(theSolution)).Return(theTemplates);

            src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new[] { d1 });
            src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]);

            src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]);
            src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new[] { d2 });

            theGenerator = new NuspecGenerator(theFinder, new[] { src1, src2 });
            thePlan = theGenerator.PlanFor(theSolution, new SemanticVersion("1.0.0.0"));
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:30,代碼來源:NuspecGenerationPlanTester.cs

示例13: SetUp

        public void SetUp()
        {
            theScenario = SolutionScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("StructureMap", "2.6.3", UpdateMode.Fixed);
                    test.ProjectDependency("Test", "structuremap");
                });
            });

            theSolution = theScenario.Find("Test");

            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                        .Add("structuremap", "2.6.4.54");

                scenario.For(Feed.NuGetV2)
                        .Add("structuremap", "2.6.3");
            });

            RippleOperation
                .With(theSolution)
                .Execute<RestoreInput, RestoreCommand>();
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:26,代碼來源:restore_dependencies_case_insensitive.cs

示例14: SetUp

        public void SetUp()
        {
            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("TestNuGet", "1.1.0.1", UpdateMode.Float);
                    test.ProjectDependency("Test", "TestNuGet");
                });
            });

            theCache = new Feed("cache");

            theSolution = theScenario.Find("Test");
            theSolution.UseCache(new InMemoryNugetCache(theCache));

            FeedScenario.Create(scenario =>
            {
                scenario.For(theCache)
                        .Add("TestNuGet", "1.1.0.1");
            });

            RippleOperation
                .With(theSolution)
                .Execute<RestoreInput, RestoreCommand>();
        }
開發者ID:kjnilsson,項目名稱:ripple,代碼行數:26,代碼來源:restore_dependencies_that_only_exist_in_cache.cs

示例15: SetUp

        public void SetUp()
        {
            theScenario = SolutionScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    // Defacto a float
                    test.ProjectDependency("Test", "Spark");
                });
            });

            theCache = new Feed("cache");

            theSolution = theScenario.Find("Test");
            theSolution.UseCache(new InMemoryNugetCache(theCache));

            FeedScenario.Create(scenario =>
            {
                scenario.For(theCache)
                    .Add("Spark", "1.0.0.0");

                scenario.For(Feed.NuGetV2)
                    .Add("Spark", "1.1.0.1");
            });

            RippleOperation
                .With(theSolution)
                .Execute<RestoreInput, RestoreCommand>();
        }
開發者ID:modulexcite,項目名稱:ripple,代碼行數:29,代碼來源:restore_float_dependency_with_no_version.cs


注:本文中的ripple.Model.Solution類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。