Click here to Skip to main content
15,902,777 members
Home / Discussions / C#
   

C#

 
GeneralRe: Extension method for a list Pin
Agent__00711-Dec-14 16:31
professionalAgent__00711-Dec-14 16:31 
GeneralRe: Extension method for a list Pin
BillWoodruff11-Dec-14 18:20
professionalBillWoodruff11-Dec-14 18:20 
QuestionEF Code-First to Existing Database Pin
jasonalien10-Dec-14 22:10
jasonalien10-Dec-14 22:10 
AnswerRe: EF Code-First to Existing Database Pin
Maciej Los11-Dec-14 20:10
mveMaciej Los11-Dec-14 20:10 
Questionsuperimpose two pictureboxes C# Pin
Member 1045669210-Dec-14 19:32
Member 1045669210-Dec-14 19:32 
AnswerRe: superimpose two pictureboxes C# Pin
BillWoodruff10-Dec-14 22:13
professionalBillWoodruff10-Dec-14 22:13 
QuestionA simple example using a USB plug and unplug (to next plugin) condition... Pin
Member 1127546610-Dec-14 7:29
Member 1127546610-Dec-14 7:29 
AnswerRe: A simple example using a USB plug and unplug (to next plugin) condition... Pin
Eddy Vluggen10-Dec-14 7:35
professionalEddy Vluggen10-Dec-14 7:35 
QuestionReg. Regular Expression Pin
Dhimant B10-Dec-14 2:51
Dhimant B10-Dec-14 2:51 
AnswerRe: Reg. Regular Expression Pin
OriginalGriff10-Dec-14 3:05
mveOriginalGriff10-Dec-14 3:05 
GeneralRe: Reg. Regular Expression Pin
Dhimant B10-Dec-14 18:58
Dhimant B10-Dec-14 18:58 
GeneralRe: Reg. Regular Expression Pin
OriginalGriff11-Dec-14 0:21
mveOriginalGriff11-Dec-14 0:21 
SuggestionRe: Reg. Regular Expression Pin
Matt T Heffron11-Dec-14 8:34
professionalMatt T Heffron11-Dec-14 8:34 
SuggestionRe: Reg. Regular Expression Pin
Matt T Heffron11-Dec-14 15:33
professionalMatt T Heffron11-Dec-14 15:33 
SuggestionRe: Reg. Regular Expression Pin
Matt T Heffron11-Dec-14 8:35
professionalMatt T Heffron11-Dec-14 8:35 
AnswerRe: Reg. Regular Expression Pin
Agent__00710-Dec-14 21:07
professionalAgent__00710-Dec-14 21:07 
AnswerRe: Reg. Regular Expression Pin
Matt T Heffron12-Dec-14 7:04
professionalMatt T Heffron12-Dec-14 7:04 
GeneralRe: Reg. Regular Expression Pin
jschell12-Dec-14 12:08
jschell12-Dec-14 12:08 
QuestionRevit macro with if/else command Pin
William Wydock9-Dec-14 11:15
William Wydock9-Dec-14 11:15 
AnswerRe: Revit macro with if/else command Pin
BillWoodruff9-Dec-14 14:21
professionalBillWoodruff9-Dec-14 14:21 
AnswerRe: Revit macro with if/else command Pin
Eddy Vluggen10-Dec-14 0:32
professionalEddy Vluggen10-Dec-14 0:32 
Questionplease help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
gajanangan9-Dec-14 7:22
gajanangan9-Dec-14 7:22 
SuggestionRe: please help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
gaurigan9-Dec-14 16:17
gaurigan9-Dec-14 16:17 
namespace CollectionsTest
{
using System;
using System.Collections.Generic;

using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Runtime;

using System.Collections.Concurrent;
using System.Threading.Tasks;
using System.Threading;

class Program
{


static void Main(string[] args)
{
basictestc();
}
// loop to print odd and even key values in debug window
public static void printvalue(int k)
{
var cc = (Cnestedict5[k]).Values.ToArray();
var ck = (Cnestedict5[k]).Keys.ToArray();
for (int i = 0; i < cc.Count(); i++)
{
DateTime dt = ck[i];
String dcandle = cc[i];
Debug.WriteLine(string.Format("pids1:{0},Count{1}, datetime:{2}: ticks:{3}", k * 100 + i, cc.Count(), ck[i], cc[i]));

}

}

public static ConcurrentDictionary<int, ConcurrentDictionary<DateTime, String>> Cnestedict5 = new ConcurrentDictionary<int, ConcurrentDictionary<DateTime, string>>();
public static void basictestc()
{
int mk = 7001, nk = 7000;
DateTime ddn = DateTime.Now;
ConcurrentDictionary<DateTime, string> cd = new ConcurrentDictionary<DateTime, string>();
Cnestedict5.TryAdd(mk, cd); Cnestedict5.TryAdd(nk, cd);

for (int i = 0; i < 12; i++)
{
ddn = ddn.AddMinutes(1);

if (ddn.Minute % 2 != 0)
{
Cnestedict5.GetOrAdd(mk, n => new ConcurrentDictionary<DateTime, string>()).TryAdd(ddn, "odd");
printvalue(mk);
}

else if (ddn.Minute % 2 == 0)
{
Cnestedict5.GetOrAdd(nk, n => new ConcurrentDictionary<DateTime, string>()).TryAdd(ddn, "even");
printvalue(nk);
}
}
}
}
}
QuestionRe: please help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
Richard MacCutchan9-Dec-14 22:15
mveRichard MacCutchan9-Dec-14 22:15 
AnswerSolved :please help me solve a nested dictionary structure problem!!! (here is a sample code where am i doing wrong) Pin
gaurigan10-Dec-14 13:56
gaurigan10-Dec-14 13:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.