|
|
I have now developed a simple console app based on the example:
|
|
|
|
|
Now you have a Windows service (that is actually a console application) that manages your queue, and a console application that exposes a WCF service.
What you have to do is to put the two things together: include the code of the new console app into the code of your Window Service and make sure that both reference the same queue instance.
Then, when you start the Windows service, it will also expose the WCF service that you can call from Silverlight.
|
|
|
|
|
Hi,
I don't think I have "and a console application that exposes a WCF service"
I only have a windows service.
|
|
|
|
|
You said "I have now developed a simple console app based on the example".
So I thought that you had put the WCF service on a separate Console Application.
If you have already put the WCF service into the Windows service, you should be able to browse it from IE on the url you specified when coding it (the example I gave you uses http://localhost:8080/hello).
You have only to add a service reference to your WCF service in the Silverlight application so that it can communicate with the Windows service.
|
|
|
|
|
|
Hi!
Currently my server application runs in the context of the User, that is logged on.
The application is able to create a screenshot and send it to the client and receive input data to perform on the server.
So far this works on XP to Win 2008 R2...
Now, this application should be able to take screenshots and perform user input, even before any user is logged on (similar to RealVNC) or the user decides to look the session, or switch the user...
Is there any way to accomplish this?
I read, that there are some difficulties with Session 0 Isolation on Windows Versions above Vista...
Any ideas
Thank You
Neo
|
|
|
|
|
Hi,
below is my XML file:
<Course>
<CourseInfo>
<Id>3000</Id>
<Name type="BTECH">Bachelor of Technology</Name>
<CourseInfo>
</Course>
I would like to deserialize this XML. I created classes for Course and CourseInfo.
When I tried to deserialize the xml using below code, I got Id as "3000" and Name as "Bachelor of Technology". But didn't get the type attribute. Please guide me to get the value of type attribute. Thanks in advance
public class AwardInfo
{
public string m_Id;
[XmlElement("Id")]
public string Id
{
get { return m_Id; }
set { m_Id = value; }
}
public string m_Name;
[XmlElement("Name")]
public string Name
{
get { return m_Name; }
set { m_Name = value; }
}
}
|
|
|
|
|
"Name" is not a simple type.
Create a class like this :
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class CourseInfoName {
private string typeField;
private string valueField;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string type {
get {
return this.typeField;
}
set {
this.typeField = value;
}
}
[System.Xml.Serialization.XmlTextAttribute()]
public string Value {
get {
return this.valueField;
}
set {
this.valueField = value;
}
}
}
In you original class replace m_name and Name by
private CourseInfoName nameField;
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
public CourseInfoName Name {
get {
return this.nameField;
}
set {
this.nameField = value;
}
}
Cheers
If you can read this, you don't have Papyrus installed
|
|
|
|
|
|
You're welcome. Have fun with it.
Cheers
If you can read this, you don't have Papyrus installed
|
|
|
|
|
Is there some kind of a rule where global variables should have "_" before their names. For example: _MyGlobalVar
|
|
|
|
|
No. It's just one of many different conventions that have come and gone. For a while, this was suggested as a standard by Microsoft, but they no longer recommend this.
|
|
|
|
|
To add to Petes' answer: there are no global variables in C# anyway. Every variable is part of a class...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Absolutely not, I would never do that. IMO identifier names should be easily readable and pronounceable, no special characters, no Hungarian notation.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Contrarywise; there is a rule against global variables.
But to heck with what other people call "rules"; do whatever you darn well please. Just be consistent.
And if your organization has a coding standard, follow it.
|
|
|
|
|
TCPMem wrote: Is there some kind of a rule where global variables should have "_" before their names
No there is no some kind of rule where global variables should have "_".
"_" is one of the symbol which can be used defining variable name.
you need to only follow the standard rule made for declaring Variable Name.
|
|
|
|
|
I have a Windows Forms ListBox object showing items that originate in a dictionary.
To apply different coloring etc to some of the entries I have set
dropDownListBox.DrawMode = DrawMode.OwnerDrawFixed
and handling the listbox DrawItem and MeasureItem events.
The different colored items are basically additional choices or items I add or remove depending on other factors.
These are commands if you like eg. "Advanced Filter", "Remove This Filter" etc and always appear at the top of the listbox items, and are highlighted to separate them from the normal data values.
When I show the listbox I set the dropDownListBox.SelectedItem to the previously selected item which may be well down the list.
I would like to be able to "freeze" the required top row(s) or commands eg "Advanced Filter", so that as I scroll down, or the listbox shows with the previously selected item, the required rows are always visible.
This would save scrolling back right back to the start to select "Advanced Filter".
Not having much joy so far, can anyone assist?
Thanks
AussieLew
DrawItem and MeasureItem handlers below...
void dropDownListBox_DrawItem(object sender, DrawItemEventArgs e)
{
Brush myBrush = Brushes.Green;
Brush backBrush = Brushes.Red;
string listString = dropDownListBox.Items[e.Index].ToString();
e.DrawBackground();
switch (listString)
{
case "Advanced Filter...":
myBrush = Brushes.DarkGreen;
backBrush = Brushes.PaleGreen;
e.Graphics.FillRectangle(backBrush, e.Bounds);
if (filterCommandFlag == 2)
{
e.Graphics.DrawLine(Pens.Green, e.Bounds.Left, e.Bounds.Bottom - 1, e.Bounds.Right, e.Bounds.Bottom - 1);
}
break;
case "Remove This Filter":
myBrush = Brushes.DarkGreen;
backBrush = Brushes.PaleGreen;
e.Graphics.FillRectangle(backBrush, e.Bounds);
break;
case "Remove All Filters":
myBrush = Brushes.OrangeRed;
backBrush = Brushes.PaleGreen;
e.Graphics.FillRectangle(backBrush, e.Bounds);
if (filterCommandFlag > 3 && filterCommandFlag < 8)
{
e.Graphics.DrawLine(Pens.Green, e.Bounds.Left, e.Bounds.Bottom - 1, e.Bounds.Right, e.Bounds.Bottom - 1);
}
break;
case "Blanks":
myBrush = Brushes.OrangeRed;
backBrush = Brushes.PaleGreen;
e.Graphics.FillRectangle(backBrush, e.Bounds);
break;
case "NonBlanks":
myBrush = Brushes.OrangeRed;
backBrush = Brushes.PaleGreen;
e.Graphics.FillRectangle(backBrush, e.Bounds);
if (filterCommandFlag > 7)
{
e.Graphics.DrawLine(Pens.Green, e.Bounds.Left, e.Bounds.Bottom - 1, e.Bounds.Right, e.Bounds.Bottom - 1);
}
break;
}
if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
{
e.Graphics.FillRectangle(Brushes.SpringGreen, e.Bounds);
}
e.Graphics.DrawString(listString, e.Font, myBrush, e.Bounds, StringFormat.GenericDefault);
}
private void dropDownListBox_MeasureItem(object sender, MeasureItemEventArgs e)
{
Font font = dropDownListBox.Font;
SizeF stringSize = e.Graphics.MeasureString(font.Name, font);
e.ItemHeight = (int)stringSize.Height;
}
|
|
|
|
|
AFAIK the Windows ListBox does not support what you want. It insists on positioning the items itself, at best it will let you decide the height of an item, and let you draw the items. However to my knowledge it always scrolls everything. You may or may not paint your items outside the intended rectangle (part of the EventArgs), however I don't expect that to work properly.
I basically see two ways to get what you want, both taking more effort than you would hope:
1.
use a second ListBox, on top of the first, just showing the fixed items. And if their number and/or height isn't constant, that also means resizing/repositioning the ListBoxes.
2.
don't use a ListBox at all, in other words create your own.
And then of course there are companies that specialize in Controls (CodeProject is showing some ads for such companies) and may offer exactly what you want, but I'm not familiar with their offerings.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hey guys, I need to Develop a control that presents yearly calendar. that calender should show holidays and weekends each with a deferent color.
any body have a suggestion?
|
|
|
|
|
Before you begin you need to think!
Calendars are extremely complicated.
For a start you have to decide which calendar to use, what sort of information you require and how to lay it out.
Then you have the problems of fixed holidays, moveable feasts, leap years, etc.
Once you have decided, use the Calendar Control.
There are a few items in CP Archives...
Here is one[^].
Here is another[^].
Microsoft Page[^] on Calendar Control.
There are lots of options you can use, so be clear before you start what you need it for.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
Thanks Dalek, but i was talking about a windows Form Control.
|
|
|
|
|
Didn't see that requirement in the original question
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
Sorry Sir, It was my bad. But I thought that it was clear enough.
|
|
|
|
|
If you haven't already seen it, you might look at Another Month Calendar[^], for inspiration.
There is always the built-in MonthCalendar but highlighting in different colours is problematic.
In my experience Yearly Calendars are never the prettiest things, so if you do manage to produce something you are pleased with, you might consider writing an article about it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|