Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

si24803

@si24803
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Accessing form controls from WCF service
    S si24803

    Hi again, Well, start by creating a method in your Forms project that does just that, recieves the time info, and updates the controls. You can do this with

    public void updateTime(int timeSpan){
    for each(Control c in this.Controls){
    c.doSomething();
    }
    }

    then, all you need to do is spawn a thread that wakes up every few minutes (or whatever period of time you want) and access the web service and retrieve the time information from your server. When it wakes up, it calls the method mentioned earlier. The code i'm about to throw in here is by no means a product of good coding practices and will definitelly have bugs as i'm writing it directly on the reply from here at CodeProject, but might just do the trick.

    public class Scheduler : Thread {
    private Form parentForm;
    private "WebServiceProxy" webServiceProxy;

    public Scheduler(Form mainForm){
    this.parentForm = mainForm;
    this.webServiceProxy = new "WebServiceProxy"();
    }

    public override void Run() {
    while(true) {
    int timeSpan = webServiceProxy.getTimeSpan(); // get the time elapsed
    sleep(5000); // will suspend thread execution for 5 seconds
    }
    }
    }

    Now add an instance of the Scheduler to your main form. In the constructor of your form (or at the InitializeComponent method) initialize the Scheduler field and call the Run() method on it. Try it for yourself. Hope it helps

    C# csharp wcf question

  • Accessing form controls from WCF service
    S si24803

    Hi, First of all, are you sure that's what you want to do? Why? Sorry for asking this, but I believe it's not, and unless you provide a context, I don't know if i'm helping or throwing you a rope to hang yourself. But to answer your question, you can create an instance of the form in the service's class, and it will be available in that service's context. Now, I believe you want to publish the form data on the web. Here's how i'd go about it: 1. Keep both projects separated (not in the solution, just reference wise); 2. Implement methods on the web service that let you submit form data through them; 3. Make your forms application a client of the webservice; 4. As the controls on the form are filled, send changes to the web service; 5. All clients of the web service will be able to see those changes. Hope i helped. Regards

    C# csharp wcf question

  • Background worker thread to process many request asynchronously
    S si24803

    Hi, I believe that the answer is by using the singleton pattern. Just create a singleton class for the process queue (with the put method and a permanently alive thread or threads that block when the queue is empty and resumes execution when the queue receives a put) and use it in your ASP application.

    ASP.NET csharp asp-net design data-structures question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups