Click here to Skip to main content
15,891,372 members
Home / Discussions / WPF
   

WPF

 
QuestionCreating TreeViewItem dynamically ? Pin
Mohammad Dayyan17-Dec-09 20:28
Mohammad Dayyan17-Dec-09 20:28 
AnswerRe: Creating TreeViewItem dynamically ? Pin
Aviad P.18-Dec-09 0:51
Aviad P.18-Dec-09 0:51 
GeneralRe: Creating TreeViewItem dynamically ? Pin
Mohammad Dayyan18-Dec-09 1:01
Mohammad Dayyan18-Dec-09 1:01 
GeneralRe: Creating TreeViewItem dynamically ? Pin
Pete O'Hanlon18-Dec-09 2:18
mvePete O'Hanlon18-Dec-09 2:18 
NewsFree Silverlight 4 Developer Training Now Available on Channel 9 Pin
brucedkyle17-Dec-09 11:10
brucedkyle17-Dec-09 11:10 
GeneralRe: Free Silverlight 4 Developer Training Now Available on Channel 9 Pin
Abhinav S17-Dec-09 16:55
Abhinav S17-Dec-09 16:55 
QuestionGetting WPF in VC++ Pin
Anu_Bala16-Dec-09 18:29
Anu_Bala16-Dec-09 18:29 
Questionunable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 7:15
Mogamboo_Khush_Hua16-Dec-09 7:15 
This is my service code

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Threading;<br />
using System.ServiceModel;<br />
using System.ServiceModel.Description;<br />
using System.Collections;<br />
<br />
namespace ServerConsole<br />
<br />
{<br />
<br />
    [ServiceContract ]<br />
<br />
    public interface IService1<br />
    {<br />
<br />
        [OperationContract]<br />
        String GetMessage(String name);<br />
<br />
        [OperationContract]<br />
        string GetData(int value);<br />
<br />
 <br />
<br />
    }<br />
<br />
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]<br />
<br />
     //   [ServiceBehavior( InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]<br />
<br />
    //[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Single)]<br />
<br />
   // [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Multiple)]<br />
<br />
 // [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Single)]<br />
<br />
    //[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]<br />
<br />
   <br />
<br />
   <br />
<br />
   <br />
<br />
    public class Service1 : IService1<br />
<br />
    {<br />
<br />
       //Dictionary<int, string> d = new Dictionary<int, string>();<br />
<br />
       Int32 someNumber;<br />
<br />
      <br />
<br />
        Service1()<br />
<br />
        {<br />
<br />
            Console.WriteLine("{0} : Created new instance ", System.DateTime.Now);<br />
<br />
        }<br />
<br />
 <br />
<br />
        public string GetData(int value)<br />
<br />
        {<br />
<br />
           <br />
<br />
            //Console.WriteLine("{0} : Get data called on thread {1}", System.DateTime.Now, Thread.CurrentThread.ManagedThreadId);<br />
<br />
 <br />
            someNumber = value;<br />
<br />
<br />
 <br />
<br />
            Random rand = new Random();<br />
<br />
 <br />
<br />
            Thread.Sleep(rand.Next(1000));<br />
<br />
 <br />
<br />
            // show the current value of the field and parameter<br />
<br />
 <br />
<br />
            // with percall, they will always be the same<br />
<br />
 <br />
<br />
            Console.WriteLine("parameter = {0}, somenumber = {1}, thread = {2}\n",<br />
<br />
 <br />
<br />
              value.ToString(),<br />
<br />
 <br />
<br />
              someNumber.ToString(),<br />
<br />
 <br />
<br />
              Thread.CurrentThread.ManagedThreadId);<br />
<br />
 <br />
            return string.Format("You entered: {0}", value);<br />
<br />
           <br />
<br />
        }<br />
<br />
 <br />
        public String GetMessage(String name)<br />
<br />
        {<br />
<br />
            Console.WriteLine("{0} : Get Message called on thread {1}", System.DateTime.Now, Thread.CurrentThread.ManagedThreadId);<br />
<br />
            return "Hello world from " + name + "!";<br />
<br />
        }<br />
<br />
    }<br />
<br />
<br />
    class Program<br />
<br />
    {<br />
<br />
        static void Main(string[] args)<br />
<br />
        {<br />
<br />
            ServiceHost serviceHost = new ServiceHost(typeof(Service1), new Uri("http://localhost:8001/ServerConsole"));<br />
<br />
            serviceHost.AddServiceEndpoint(typeof(IService1), new WSHttpBinding(), "");<br />
<br />
 <br />
<br />
            ServiceMetadataBehavior smb = new ServiceMetadataBehavior();<br />
<br />
            smb.HttpGetEnabled = true;<br />
<br />
            serviceHost.Description.Behaviors.Add(smb);<br />
<br />
 <br />
<br />
            serviceHost.Open();<br />
<br />
 <br />
<br />
 <br />
<br />
            Console.ReadKey();<br />
<br />
 <br />
<br />
            serviceHost.Close();<br />
<br />
        }<br />
<br />
    }<br />
<br />
}<br />
<br />
<br />
but through this code i cannot understand properly  the concurrency mode,<br />
<br />
do any one have code to under stand concurrency mode clearly.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
 <br />
<br />

AnswerRe: unable to understand concurrencymode Pin
Ian Shlasko16-Dec-09 7:26
Ian Shlasko16-Dec-09 7:26 
GeneralRe: unable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 7:50
Mogamboo_Khush_Hua16-Dec-09 7:50 
GeneralWrite code in client to check concurrency Pin
Mogamboo_Khush_Hua16-Dec-09 9:01
Mogamboo_Khush_Hua16-Dec-09 9:01 
GeneralRe: Write code in client to check concurrency Pin
Ian Shlasko16-Dec-09 9:09
Ian Shlasko16-Dec-09 9:09 
GeneralRe: unable to understand concurrencymode Pin
Ian Shlasko16-Dec-09 9:08
Ian Shlasko16-Dec-09 9:08 
GeneralRe: unable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 18:12
Mogamboo_Khush_Hua16-Dec-09 18:12 
GeneralRe: unable to understand concurrencymode Pin
Pete O'Hanlon16-Dec-09 22:02
mvePete O'Hanlon16-Dec-09 22:02 
GeneralRe: unable to understand concurrencymode Pin
Mogamboo_Khush_Hua16-Dec-09 22:51
Mogamboo_Khush_Hua16-Dec-09 22:51 
Generalproblem in thread Pin
Mogamboo_Khush_Hua17-Dec-09 1:13
Mogamboo_Khush_Hua17-Dec-09 1:13 
QuestionHow can I deploy an application using VISIFIRE Pin
cutudi16-Dec-09 2:00
cutudi16-Dec-09 2:00 
AnswerRe: How can I deploy an application using VISIFIRE Pin
vivek_daramwal16-Dec-09 2:28
vivek_daramwal16-Dec-09 2:28 
GeneralRe: How can I deploy an application using VISIFIRE Pin
cutudi16-Dec-09 2:32
cutudi16-Dec-09 2:32 
GeneralRe: How can I deploy an application using VISIFIRE Pin
Pete O'Hanlon16-Dec-09 2:57
mvePete O'Hanlon16-Dec-09 2:57 
GeneralRe: How can I deploy an application using VISIFIRE [modified] Pin
cutudi16-Dec-09 3:59
cutudi16-Dec-09 3:59 
QuestionRe: How can I deploy an application using VISIFIRE Pin
Mark Salsbery16-Dec-09 5:47
Mark Salsbery16-Dec-09 5:47 
AnswerRe: How can I deploy an application using VISIFIRE Pin
cutudi16-Dec-09 20:50
cutudi16-Dec-09 20:50 
QuestionHow can I deploy an application using VISIFIRE Pin
cutudi16-Dec-09 1:58
cutudi16-Dec-09 1:58 

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.