//-------------------------------------------------------------------------
        public virtual void test_zipWithIndex()
        {
            Stream <string> @base             = Stream.of("a", "b", "c");
            IList <ObjIntPair <string> > test = Guavate.zipWithIndex(@base).collect(Collectors.toList());

            assertEquals(test, ImmutableList.of(ObjIntPair.of("a", 0), ObjIntPair.of("b", 1), ObjIntPair.of("c", 2)));
        }
Beispiel #2
0
        /// <summary>
        /// Returns a collector that can be used to create a multi-currency amount
        /// from a stream of amounts where each amount has a different currency.
        /// <para>
        /// Each amount in the stream must have a different currency.
        ///
        /// </para>
        /// </summary>
        /// <returns> the collector </returns>
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: private static java.util.stream.Collector<CurrencyAmount, ?, MultiCurrencyAmount> collectorInternal()
        private static Collector <CurrencyAmount, ?, MultiCurrencyAmount> collectorInternal()
        {
            // this method must not be exposed publicly as misuse creates an instance with invalid state
            // it exists because when used internally it offers better performance than collector()
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            return(Collectors.collectingAndThen(Guavate.toImmutableSortedSet(), MultiCurrencyAmount::new));
        }
        //-------------------------------------------------------------------------
        public virtual void test_stream_Iterable()
        {
            IEnumerable <string> iterable = Arrays.asList("a", "b", "c");
            IList <string>       test     = Guavate.stream(iterable).collect(Collectors.toList());

            assertEquals(test, ImmutableList.of("a", "b", "c"));
        }
Beispiel #4
0
        public void TestGetCollector()
        {
            Collectors c = new Collectors();
            Type       t = c.GetCollector("Dkb");

            Assert.AreEqual("Dkb", t.Name);
        }
Beispiel #5
0
        public async Task <ActionResult> AddEmployee(AddEmployeeViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser {
                    UserName = model.Email, Email = model.Email, FirstName = model.FirstName, LastName = model.LastName, PhoneNumber = model.PhoneNumber
                };
                var result = await UserManager.CreateAsync(user, model.Password);

                var db          = new ApplicationDbContext();
                var roleStore   = new RoleStore <IdentityRole>(db);
                var roleManager = new RoleManager <IdentityRole>(roleStore);

                var userStore   = new UserStore <ApplicationUser>(db);
                var userManager = new UserManager <ApplicationUser>(userStore);
                userManager.AddToRole(user.Id, "Collector");

                var newCollector = new Collectors();
                newCollector.UserId  = user.Id;
                newCollector.ZipCode = model.ZipCode;
                var result2 = db.Collectors.Add(newCollector);
                db.SaveChanges();

                if (result.Succeeded)
                {
                    return(RedirectToAction("Index", "Manage", new { Message = ManageMessageId.AddEmployeeSuccess }));
                }

                AddErrors(result);
            }
            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Beispiel #6
0
        /// <summary>
        /// Mutates the input map by removing entries which do not have keys in the new backing data, as extracted with
        /// the keyExtractor. </summary>
        /// <param name="map"> the map to mutate. </param>
        /// <param name="newBackingData"> the backing data to retain. </param>
        /// <param name="keyExtractor"> the function to extract keys from the backing data. </param>
        /// @param <K> type of the key in the input map. </param>
        /// @param <V> type of the values in the input map. </param>
        /// @param <T> type of the keys in the new baking data. </param>
        public static void TrimToList <K, V, T>(IDictionary <K, V> map, IList <T> newBackingData, System.Func <T, K> keyExtractor)
        {
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            ISet <K> retainedKeys = newBackingData.Select(keyExtractor).collect(Collectors.toSet());

            TrimToList(map, retainedKeys);
        }
Beispiel #7
0
        public void Postbank()
        {
            Collectors c = new Collectors();

            c.Payments = a.Payments;
            c.ExecFile(SecretFile("test-Postbank.command"));
        }
Beispiel #8
0
        public void Dkb()
        {
            Collectors c = new Collectors();

            c.Payments = a.Payments;
            c.ExecFile(SecretFile("test-dkb.command"));
        }
        public virtual void test_zipWithIndex_empty()
        {
            Stream <string> @base             = Stream.of();
            IList <ObjIntPair <string> > test = Guavate.zipWithIndex(@base).collect(Collectors.toList());

            assertEquals(test, ImmutableList.of());
        }
Beispiel #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldHavePredefinedRoles() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldHavePredefinedRoles()
        {
            // Given
            StartServerWithConfiguredUser();

            // When
            string method = "POST";
            string path   = "db/data/transaction/commit";

            HTTP.RawPayload payload  = HTTP.RawPayload.quotedJson("{'statements':[{'statement':'CALL dbms.security.listRoles()'}]}");
            HTTP.Response   response = HTTP.withBasicAuth("neo4j", "secret").request(method, Server.baseUri().resolve(path).ToString(), payload);

            // Then
            assertThat(response.Status(), equalTo(200));
            ArrayNode errors = ( ArrayNode )response.Get("errors");

            assertThat("Should have no errors", errors.size(), equalTo(0));
            ArrayNode results = ( ArrayNode )response.Get("results");
            ArrayNode data    = ( ArrayNode )results.get(0).get("data");

            assertThat("Should have 5 predefined roles", data.size(), equalTo(5));
            Stream <string> values = data.findValues("row").Select(row => row.get(0).asText());

            assertThat("Expected specific roles", values.collect(Collectors.toList()), hasItems("admin", "architect", "publisher", "editor", "reader"));
        }
Beispiel #11
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private String readJsonFile(final String fileName) throws java.io.IOException, java.net.URISyntaxException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        private string ReadJsonFile(string fileName)
        {
            Path   path     = Paths.get(this.GetType().getResource("/org.neo4j.causalclustering.discovery/" + fileName).toURI());
            string fullFile = Files.lines(path).collect(Collectors.joining("\n"));

            return(string.format(fullFile, _testServiceName, _testPortName, _testPortNumber));
        }
Beispiel #12
0
		public virtual void TestMaxOut(TableFactor factor, int marginalize)
		{
			if (!Arrays.Stream(factor.neighborIndices).Boxed().Collect(Collectors.ToSet()).Contains(marginalize))
			{
				return;
			}
			if (factor.neighborIndices.Length <= 1)
			{
				return;
			}
			TableFactor maxedOut = factor.MaxOut((int)marginalize);
			NUnit.Framework.Assert.AreEqual(factor.neighborIndices.Length - 1, maxedOut.neighborIndices.Length);
			NUnit.Framework.Assert.IsTrue(!Arrays.Stream(maxedOut.neighborIndices).Boxed().Collect(Collectors.ToSet()).Contains(marginalize));
			foreach (int[] assignment in factor)
			{
				NUnit.Framework.Assert.IsTrue(factor.GetAssignmentValue(assignment) >= double.NegativeInfinity);
				NUnit.Framework.Assert.IsTrue(factor.GetAssignmentValue(assignment) <= maxedOut.GetAssignmentValue(SubsetAssignment(assignment, (TableFactor)factor, maxedOut)));
			}
			IDictionary<IList<int>, IList<int[]>> subsetToSuperset = SubsetToSupersetAssignments((TableFactor)factor, maxedOut);
			foreach (IList<int> subsetAssignmentList in subsetToSuperset.Keys)
			{
				double max = double.NegativeInfinity;
				foreach (int[] supersetAssignment in subsetToSuperset[subsetAssignmentList])
				{
					max = Math.Max(max, factor.GetAssignmentValue(supersetAssignment));
				}
				int[] subsetAssignment = new int[subsetAssignmentList.Count];
				for (int i = 0; i < subsetAssignment.Length; i++)
				{
					subsetAssignment[i] = subsetAssignmentList[i];
				}
				NUnit.Framework.Assert.AreEqual(maxedOut.GetAssignmentValue(subsetAssignment), 1.0e-5, max);
			}
		}
Beispiel #13
0
		public virtual void TestObserve(TableFactor factor, int observe, int value)
		{
			if (!Arrays.Stream(factor.neighborIndices).Boxed().Collect(Collectors.ToSet()).Contains(observe))
			{
				return;
			}
			if (factor.neighborIndices.Length == 1)
			{
				return;
			}
			TableFactor observedOut = factor.Observe((int)observe, (int)value);
			int observeIndex = -1;
			for (int i = 0; i < factor.neighborIndices.Length; i++)
			{
				if (factor.neighborIndices[i] == observe)
				{
					observeIndex = i;
				}
			}
			foreach (int[] assignment in factor)
			{
				if (assignment[observeIndex] == value)
				{
					NUnit.Framework.Assert.AreEqual(observedOut.GetAssignmentValue(SubsetAssignment(assignment, (TableFactor)factor, observedOut)), 1.0e-7, factor.GetAssignmentValue(assignment));
				}
			}
		}
        public async Task <IActionResult> Edit(int id, [Bind("Id,Country,Name,Contacts,AvailabilityInCollection")] Collectors collectors)
        {
            if (id != collectors.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(collectors);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CollectorsExists(collectors.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(collectors));
        }
        public void AddFileTest()
        {
            Collectors.InitCollectors();
            Collectors.AddProvider(typeof(FSIndexDirectoryProvider), System.Reflection.Assembly.GetAssembly(typeof(FSIndexDirectoryProvider)), "", typeof(IIndexDirectoryProviderV60));
            Host.Instance = new Host();
            Host.Instance.OverridePublicDirectory(testDir);

            ProviderLoader.SetUp <IIndexDirectoryProviderV60>(typeof(FSIndexDirectoryProvider), "");

            string fileName = "file_name_1";

            string filePath = Path.Combine(testDir, "test.txt");

            using (StreamWriter writer = File.CreateText(filePath)) {
                writer.Write("This is the content of a file");
            }

            Assert.IsTrue(SearchClass.IndexFile(fileName, filePath, "wiki1"));

            List <SearchResult> results = SearchClass.Search("wiki1", new SearchField[] { SearchField.FileName, SearchField.FileContent }, "file", SearchOptions.AtLeastOneWord);

            Assert.AreEqual(1, results.Count, "Wrong result length");

            Assert.AreEqual(DocumentType.File, results[0].DocumentType, "Wrong document type");

            FileDocument fileDocument = results[0].Document as FileDocument;

            Assert.AreEqual(fileName, fileDocument.FileName, "Wrong file name");
            Assert.AreEqual("This is the content of a <b class=\"searchkeyword\">file</b>", fileDocument.HighlightedFileContent, "Wrong file content");
        }
    public override void CreateChildren()
    {
        Debug.Log("Setting Up the Magic Chamber!");

        // First the focus
        Focus newFocus = Instantiate(focusPrefab).GetComponent <Focus>();

        newFocus.transform.SetParent(gameObject.transform, false);
        newFocus.name = "Focus";
        newFocus.SetParent(this);
        children.Add(newFocus);
        SetFocus(newFocus);

        // Then the condensers
        Collectors newCollectors = Instantiate(collectorsPrefab).GetComponent <Collectors>();

        newCollectors.transform.SetParent(gameObject.transform, false);
        newCollectors.name = "Collectors";
        newCollectors.SetParent(this);
        children.Add(newCollectors);
        newCollectors.CreateChildren();

        // Then the crystals
        Crystals newCrystals = Instantiate(crystalsPrefab).GetComponent <Crystals>();

        newCrystals.transform.SetParent(gameObject.transform, false);
        newCrystals.name = "Crystals";
        newCrystals.SetParent(this);
        children.Add(newCrystals);
        newCrystals.CreateChildren();

        // Then the altars
    }
        public void AddPageTest()
        {
            IPagesStorageProviderV60 pagesStorageProvider = mocks.DynamicMock <IPagesStorageProviderV60>();

            Expect.Call(pagesStorageProvider.CurrentWiki).Return("wiki1").Repeat.Any();

            mocks.ReplayAll();

            Collectors.InitCollectors();
            Collectors.AddProvider(typeof(FSIndexDirectoryProvider), System.Reflection.Assembly.GetAssembly(typeof(FSIndexDirectoryProvider)), "", typeof(IIndexDirectoryProviderV60));
            Host.Instance = new Host();
            Host.Instance.OverridePublicDirectory(testDir);

            ProviderLoader.SetUp <IIndexDirectoryProviderV60>(typeof(FSIndexDirectoryProvider), "");

            string pageTitle   = "This is the title of the page";
            string pageContent = "This is the content of the page";

            PageContent page = new PageContent("pagefullname", pagesStorageProvider, DateTime.Now, pageTitle,
                                               "user-test", DateTime.Now, "comment to last editing", pageContent, null, "Description of the page");


            Assert.IsTrue(SearchClass.IndexPage(page));

            List <SearchResult> results = SearchClass.Search("wiki1", new SearchField[] { SearchField.Title }, "page", SearchOptions.AtLeastOneWord);

            Assert.AreEqual(1, results.Count, "Wrong result length");

            Assert.AreEqual(DocumentType.Page, results[0].DocumentType, "Wrong document type");

            PageDocument documentPage = results[0].Document as PageDocument;

            Assert.AreEqual("This is the title of the <b class=\"searchkeyword\">page</b>", documentPage.HighlightedTitle, "Wrong title");
            Assert.AreEqual("This is the content of the <b class=\"searchkeyword\">page</b>", documentPage.HighlightedContent, "Wrong content");
        }
Beispiel #18
0
 protected override void _create()
 {
     MediaInfo = new MediaInfo
     {
         Audios = new List <string>(),
         Images = new List <string>()
     };
     DirectoryCreate($"{OutputPath}/{Name}");
     DirectoryCreate($"{OutputPath}/res/img/{Name}");
     DirectoryCreate($"{OutputPath}/res/audio/{Name}");
     DirectoryCreate($"{OutputPath}/res/font/{Name}");
     Collectors.ForEach(collector =>
     {
         collector.Collect(Name);
         if (collector.I18NImages != null)
         {
             ImagePass(collector);
         }
         if (collector.I18NAudios != null)
         {
             AudioPass(collector);
         }
         if (collector.I18NFonts != null)
         {
             FontPass(collector);
         }
     });
     SaveFile($"{OutputPath}/{Name}/mediaInfo.json", JsonUtility.ToJson(MediaInfo));
 }
        public void AddMessageTest()
        {
            IPagesStorageProviderV60 pagesStorageProvider = mocks.DynamicMock <IPagesStorageProviderV60>();

            Expect.Call(pagesStorageProvider.CurrentWiki).Return("wiki1").Repeat.Any();

            mocks.ReplayAll();

            Collectors.InitCollectors();
            Collectors.AddProvider(typeof(FSIndexDirectoryProvider), System.Reflection.Assembly.GetAssembly(typeof(FSIndexDirectoryProvider)), "", typeof(IIndexDirectoryProviderV60));
            Host.Instance = new Host();
            Host.Instance.OverridePublicDirectory(testDir);

            ProviderLoader.SetUp <IIndexDirectoryProviderV60>(typeof(FSIndexDirectoryProvider), "");

            string messageSubject = "This is the subject of the message";
            string messageBody    = "This is the body of the message";

            DateTime    dt      = DateTime.Now;
            PageContent page    = new PageContent("pagefullname", pagesStorageProvider, dt, "title", "user-test", dt, "", "content", new string[0], "");
            Message     message = new Message(1, "user-test", messageSubject, dt, messageBody);

            Assert.IsTrue(SearchClass.IndexMessage(message, page));

            List <SearchResult> results = SearchClass.Search("wiki1", new SearchField[] { SearchField.Content }, "message", SearchOptions.AtLeastOneWord);

            Assert.AreEqual(1, results.Count, "Wrong result length");

            Assert.AreEqual(DocumentType.Message, results[0].DocumentType, "Wrong document type");

            MessageDocument documentMessage = results[0].Document as MessageDocument;

            Assert.AreEqual("This is the subject of the message", documentMessage.Subject, "Wrong title");
            Assert.AreEqual("This is the body of the <b class=\"searchkeyword\">message</b>", documentMessage.HighlightedBody, "Wrong content");
        }
Beispiel #20
0
        public void Hbci()
        {
            Collectors c = new Collectors();

            c.Payments = a.Payments;
            c.ExecFile(SecretFile("test-hbci.command"));
        }
Beispiel #21
0
        public static List <Collectors> GetCollector(int branchID)
        {
            var dbUtil     = new DatabaseManager();
            var collectors = new List <Collectors>();

            using (var conn = new SqlConnection(dbUtil.getSQLConnectionString("MainDB")))
            {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandType    = CommandType.StoredProcedure;
                    cmd.CommandText    = "spMasStubNumberGetEmployee";
                    cmd.CommandTimeout = 180;
                    cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@intBranchID", branchID);

                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var collector = new Collectors
                            {
                                CollectorID = ReferenceEquals(reader["intCollectorID"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intCollectorID"]),
                                Name        = ReferenceEquals(reader["strName"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strName"])
                            };

                            collectors.Add(collector);
                        }

                        return(collectors);
                    }
                }
            }
        }
Beispiel #22
0
        /// <summary>
        /// Open collector window
        /// </summary>
        public void OpenAddCollectorDialog()
        {
            if (_group == null || _group.Length < 1 || _indiv == null | _indiv.Length < 1)
            {
                return;
            }

            var dialog = new Dialog.Dialog();

            dialog.Title        = "Add New Data Collector";
            dialog.QuestionText = "Please give a name to the new data collector.";

            if (dialog.ShowDialog() == true)
            {
                try
                {
                    string mKeySetName = dialog.ResponseText;

                    collectorListViewModel.AllCollectors.Add(Collector.CreateCollector(mKeySetName));

                    using (StreamWriter file = new StreamWriter(Path.Combine(Properties.Settings.Default.SaveLocation, _group, _indiv, "DataCollectors.json"), false))
                    {
                        Collectors mCollector = new Collectors();
                        mCollector.DataCollectors = collectorListViewModel.AllCollectors;
                        file.WriteLine(JsonConvert.SerializeObject(mCollector));
                    }

                    MessageBox.Show("Successfully added: " + dialog.ResponseText);
                }
                catch (IOException e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
        }
Beispiel #23
0
		public virtual void TestGetMaxedMarginals(TableFactor factor, int marginalizeTo)
		{
			if (!Arrays.Stream(factor.neighborIndices).Boxed().Collect(Collectors.ToSet()).Contains(marginalizeTo))
			{
				return;
			}
			int indexOfVariable = -1;
			for (int i = 0; i < factor.neighborIndices.Length; i++)
			{
				if (factor.neighborIndices[i] == marginalizeTo)
				{
					indexOfVariable = i;
					break;
				}
			}
			Assume.AssumeTrue(indexOfVariable > -1);
			double[] gold = new double[factor.GetDimensions()[indexOfVariable]];
			for (int i_1 = 0; i_1 < gold.Length; i_1++)
			{
				gold[i_1] = double.NegativeInfinity;
			}
			foreach (int[] assignment in factor)
			{
				gold[assignment[indexOfVariable]] = Math.Max(gold[assignment[indexOfVariable]], factor.GetAssignmentValue(assignment));
			}
			Normalize(gold);
			Assert.AssertArrayEquals(factor.GetMaxedMarginals()[indexOfVariable], 1.0e-5, gold);
		}
 // Public static utility methods
 public static bool IsAcronymImpl(string str, IList <string> tokens)
 {
     // Remove some words from the candidate acronym
     str = discardPattern.Matcher(str).ReplaceAll(string.Empty);
     // Remove stopwords if we need to
     if (str.Length != tokens.Count)
     {
         tokens = tokens.Stream().Filter(null).Collect(Collectors.ToList());
     }
     // Run the matcher
     if (str.Length == tokens.Count)
     {
         for (int i = 0; i < str.Length; i++)
         {
             char ch = char.ToUpperCase(str[i]);
             if (!tokens[i].IsEmpty() && char.ToUpperCase(tokens[i][0]) != ch)
             {
                 return(false);
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #25
0
		public virtual void TestSumOut(TableFactor factor, int marginalize)
		{
			if (!Arrays.Stream(factor.neighborIndices).Boxed().Collect(Collectors.ToSet()).Contains(marginalize))
			{
				return;
			}
			if (factor.neighborIndices.Length <= 1)
			{
				return;
			}
			TableFactor summedOut = factor.SumOut((int)marginalize);
			NUnit.Framework.Assert.AreEqual(factor.neighborIndices.Length - 1, summedOut.neighborIndices.Length);
			NUnit.Framework.Assert.IsTrue(!Arrays.Stream(summedOut.neighborIndices).Boxed().Collect(Collectors.ToSet()).Contains(marginalize));
			IDictionary<IList<int>, IList<int[]>> subsetToSuperset = SubsetToSupersetAssignments((TableFactor)factor, summedOut);
			foreach (IList<int> subsetAssignmentList in subsetToSuperset.Keys)
			{
				double sum = 0.0;
				foreach (int[] supersetAssignment in subsetToSuperset[subsetAssignmentList])
				{
					sum += factor.GetAssignmentValue(supersetAssignment);
				}
				int[] subsetAssignment = new int[subsetAssignmentList.Count];
				for (int i = 0; i < subsetAssignment.Length; i++)
				{
					subsetAssignment[i] = subsetAssignmentList[i];
				}
				NUnit.Framework.Assert.AreEqual(summedOut.GetAssignmentValue(subsetAssignment), 1.0e-5, sum);
			}
		}
Beispiel #26
0
        protected override void RegisterCollectors(ILogifyClientConfiguration config)
        {
            IgnorePropertiesInfoConfig ignoreConfig = config.IgnoreConfig;

            if (ignoreConfig == null)
            {
                ignoreConfig = new IgnorePropertiesInfoConfig();
            }

            //Collectors.Add(new DevelopementPlatformCollector(Platform.ASP)); // added in constuctor
            Collectors.Add(new NetCoreWebApplicationCollector());

            HttpContext context = LogifyHttpContext.Current;

            if (context != null)
            {
                if (context.Request != null)
                {
                    Collectors.Add(new RequestCollector(context.Request, ignoreConfig));
                }
                if (context.Response != null)
                {
                    Collectors.Add(new ResponseCollector(context.Response, ignoreConfig));
                }
                //if (context.ApplicationInstance != null && context.ApplicationInstance.Modules != null)
                //    Collectors.Add(new ModulesCollector(context.ApplicationInstance.Modules));
            }
            Collectors.Add(new OperatingSystemCollector());
            //Collectors.Add(new VirtualMachineCollector());
            Collectors.Add(new DebuggerCollector());
            //Collectors.Add(new MemoryCollector(config));
            //Collectors.Add(new FrameworkVersionsCollector());
        }
        public virtual void test_zip_empty()
        {
            Stream <string>             base1 = Stream.of();
            Stream <int>                base2 = Stream.of();
            IList <Pair <string, int> > test  = Guavate.zip(base1, base2).collect(Collectors.toList());

            assertEquals(test, ImmutableList.of());
        }
Beispiel #28
0
 public AggregateNode GetResult()
 {
     Finalize();
     Node.Collectors = Collectors.ToArray();
     Node.Routs      = AllRoutes().ToArray();
     NormalizeRootNodeOnEmptySet();
     return(Node);
 }
        public virtual void test_zip_secondLonger()
        {
            Stream <string>             base1 = Stream.of("a", "b");
            Stream <int>                base2 = Stream.of(1, 2, 3);
            IList <Pair <string, int> > test  = Guavate.zip(base1, base2).collect(Collectors.toList());

            assertEquals(test, ImmutableList.of(Pair.of("a", 1), Pair.of("b", 2)));
        }
Beispiel #30
0
 public void Register(ICollector collector)
 {
     if (string.IsNullOrWhiteSpace(collector.Key))
     {
         collector.Key = "val" + mid++;
     }
     Collectors.Add(collector);
 }
 private void InitChromatogramExtraction()
 {
     // Load SRM chromatograms synchronously.
     if (_isSrm)
     {
         _collectors = new Collectors();
         ExtractChromatograms();
     }
     // Load non-SRM chromatograms asynchronously.
     else
     {
         var keys = _filter.ProductChromKeys;
         bool runAsync = _retentionTimePredictor != null || keys.Any(k => k.OptionalMaxTime.HasValue);
         _collectors = new Collectors(_filter.ProductChromKeys, runAsync);
     }
 }
 public override void Dispose()
 {
     _isDisposing = true;
     lock (_disposeLock)
     {
         _spectra.Dispose();
         _scanIdList = null;
         if (_chromGroups != null)
         {
             _chromGroups.Dispose();
             _chromGroups = null;
         }
     }
     _collectors = null;
 }
        private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
        {
            var draggedItem = DragDropPayloadManager.GetDataFromObject(e.Data, "DraggedData") as List<Collectors>;
            var listBox = sender as ListBox;

            if (listBox != null)
            {
                if (draggedItem != null)
                {
                    var list = listBox.ItemsSource as ObservableCollection<Collectors>;
                    if (list != null)
                    {
                        foreach (var item in draggedItem)
                        {
                            Collectors tmp = new Collectors() { UserId = item.UserId, UserName = item.UserName };
                            if (list.Count(l => l.UserId == item.UserId) == 0)
                            {
                                list.Add(tmp);
                            }
                        }
                    }
                }
                else
                {
                    var list = listBox.ItemsSource as ObservableCollection<Collectors>;
                    if (list != null)
                    {
                        foreach (var item in _CollectorForAdd)
                        {
                            Collectors tmp = new Collectors() { UserId = item.UserId, UserName = item.UserName };
                            if (list.Count(l => l.UserId == item.UserId) == 0)
                            {
                                list.Add(tmp);
                            }
                        }
                    }
                    e.Handled = true;
                }
            }
        }