|
Hi,
1) I am sure that you can use your own images on installation screens. It is pretty easy in Vs Wizard to customize your installation forms.
2) As far as I know licensing is kinda different platform, it requires additional tools. Well I am not sure but I think you cannot handle licensing only with VS setup wizard. I suggest googling on this issue...
Hope this helps.
|
|
|
|
|
I was given the following class to C# clean up. It's a mess.
****
using System;
private enum sections
{
section1 = 1,
section2 = 2,
section3 = 3
}
namespace My.Name.Space{
public class UppperClass
{
abstract public void NoClass();
private string upper
public string Upper
{
get
{
Upper = value;
}
Put
{
return(Upper);
}
private void UpperDiv(interface number1, number2)
{
private int upperResult;
upperResult==number1/number2;
return result;
}
}
public class MiddleClass : UppperClass
{
UpperClass[] upperArray;
upperArray = new UpperClass[5];
for(int i=0; int<= upperArray.length; i+)
{
upperArray[int] = new UpperClass();
}
public void MiddleDiv()
{
int middleResult = 0;
int sumOfAllResults;
middleResult=UpperDiv(1,2);
sumOfAllResults= ++middleResult;
}
}
public class LowerClass : UpperClass
{
string lowerString;
private Boolean initialized = false;
public void LowerClass(int paramInt) //Base Method overload 1, return nothing
{
initialized=1;
}
public string LowerClass(int paramInt) //Base Method Overload 2, return string
{
lowerString = paraamInt.ToString;
return lowerString;
}
public override void NoClass()
{
MiddleDiv(3,4);
}
}
********
|
|
|
|
|
You best get started then, it shouldn't take too long
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hey,
I am trying to multithread my xml parsing routine but it seems that there are some issues with accessing attributes.
I have created a recursive xml parser using the composite pattern. So it means that I have a state class (a node in the xml file) which parses itself and depending on the child it creates another state and tells it to parse itself in a seperate thread and passes it the child node containing its data. The parse function for all my classes do not modify the xml node, they only read attributes. None of the functions should end up with the same xml node.
However when I run it in threaded mode... all my parse functions end up with the same xml node even if i am passing them a different node. If i set a break on each parse function the xml will be loaded correctly (i guess because it has time to finish the thread) but otherwise they end up parsing the same thing somehow.
mRootState = ParseContext(mNode);
mRootState.IsRoot = true;
foreach (XmlNode mChildNode in mNode.ChildNodes)
{
if (mChildNode.Name == "State")
{
if (mChildNode.Attributes["type"].Value == "Context")
{
Context mNewContext = new Context();
mRootState.Children.Add(mNewContext);
Thread t = new Thread(delegate() { mNewContext.Parse(mChildNode); });
t.Start();
mThreads.Add(t);
}
}
}
I am not sure why the keep ending up with the same xml node because they are supposed to be passed a different child node each time. Do I need to lock something? Or what is the problem?
|
|
|
|
|
I want to create a control on the form when the MouseDown event on the form fires and then use the MouseMove event on the newly created control to drag the control around the form. Unfortunately the MouseMove event doesn't appear to fire on the new control until the mouse button is released! ... This is the simplest cut down of the issue I could create.
private void button1_MouseMove(object sender, MouseEventArgs e)
{
this.Text = "Button: e.x=" + e.X.ToString() + " e.y=" + e.Y;
}
private void Form2_MouseMove(object sender, MouseEventArgs e)
{
this.Text = "Form: e.x=" + e.X.ToString() + " e.y=" + e.Y;
}
private void Form2_MouseDown(object sender, MouseEventArgs e)
{
Button button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
this.Controls.Add(button1);
this.ResumeLayout(false);
}
Is it possible to 'wire up' the MouseMove event so that it will fire on the new control before the mouse button is released ?
Michael
modified on Tuesday, July 22, 2008 11:35 AM
|
|
|
|
|
private bool Draged = false;
private int clickOffsetX;
private int clickOffsetY;
private void Sensor_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.Draged = true;
clickOffsetX = e.X;
clickOffsetY = e.Y;
}
}
private void Sensor_MouseMove(object sender, MouseEventArgs e)
{
if (this.Draged && e.Button.Equals(MouseButtons.Left))
{
this.Left += e.X - this.clickOffsetX;
this.Top += e.Y - this.clickOffsetY;
}
}
use the above
it works fine to me with a user control i've built that acts like a sensor
and can be moved around in an area of deployment
hope it helps
Have Fun
Never forget it
|
|
|
|
|
Thanks for sharing your code Half-life! thats the most elegant implementation of the 'moving control' solution I have seen It still doesn't solve my problem though, which is getting that MouseMove event to fire on the newly created control before the Mouse button has been released
|
|
|
|
|
I figured it out!
My problem had nothing to do with the control being new at all. When you MouseDown on the form, the form 'Captures' all subsequent mouse events until the next MouseUp... That is why my button control was not getting any events, the Form was stealing them!
The solution was to force the parent form to 'release' the capture so that the new button could receive the MouseMove event...
private void Form2_MouseDown(object sender, MouseEventArgs e)
{
Button button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
this.Controls.Add(button1);
button1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button1_MouseMove);
this.Capture = false;
this.ResumeLayout(false);
}
|
|
|
|
|
HI All,
Sorry for the vague title, but I have a scenario as below, which I am hoping to automate – but not really sure where to begin!
We have two c# windows applications:-
1) Creates XML files for order entry & places them on the network.
2) A user manually navigates to a section in another c# windows app to see if there are any xml orders to import.
I am wanting to write a new routine, which could be running in the background, that would check to see if any new xml files are placed on the network - if so can it mimic the steps which the user takes to import these xml orders?
I'm sure it can - I just dont know what to search for on google - any help would be much appreciated
Lady Programmers are a rare breed!
|
|
|
|
|
Hi,
FileSystemWatcher class would help in detecting new files automatically.
Easiest would be to amend your second program, so it gets the option to import
automatically. Creating a third program that manipulates the second's GUI is doable
but could be tricky, depends on what Controls the user has to manipulate when doing
it interactively. If the source of program 2 is available, I would modify it, and
not create a third program.
|
|
|
|
|
Thx - FileSystemWatcher certainly sounds like the way to go. And, yes I do have the source for the 2nd solution, so I am able to modify it.
Lady Programmers are a rare breed!
|
|
|
|
|
Well if you want this code to run in the background, the best solution is to create a service (New Project -> C# -> Windows -> 'Windows Service' template). The most robust way to get your service to 'watch' for new files is to employ a kind of 'find, move and process' strategy.
you need a
1) a 'drop' folder where the files will be initially written.
2) a 'process' folder where the files will sit between being found and being processed
3) an 'archive' folder where the files will go when your finished processing
The pseudo code for this looks a bit like this...
- list files in the 'drop' folder (keep this 'list' in memory somehow)
- move any found files to the 'process' folder
- process each found file in turn and move to the 'archive' folder when finished.
This is just one approach. Hope this helps.
Michael
|
|
|
|
|
Thx for this - I will prob implement FileSystemWatcher following your steps for moving and archiving.
Janet
Lady Programmers are a rare breed!
|
|
|
|
|
Hi,
I have managed to populated a treeview with items and subitems.
Icons are used for items and subitems...
i.e.
item1
subitemA
SubitemB
subitemC
item2
subitemA
SubitemB
subitemC
item3
subitemA
SubitemB
subitemC
...
...
...
How is it possible to allow the results in this treeview control to be viewed/ordered either by items or by subitems. So that one can see all subitems for a particular item, or all items for a particular subitem?
Thanks
|
|
|
|
|
u will need to clear the tree view each time u change the view type
and save all item in a hashtables that has
hastable 1 view type 1
[key = subitem ,value array list of ref to items ]
and :
hastable 2 view type 2
[key = item ,value array list of ref to subitems ]
this is called mirroring
and then re insert them your self using those hastables
Have Fun
Never forget it
|
|
|
|
|
I see.
How about using a dataset or a datatable instead?
Thanks
|
|
|
|
|
u can but why?
hashtable gives u the ultimate key to value without "asking"
the datatable inside a dataset to give u information
here u just get the value u want from the hashtable Like :
hastable[key] and that it
where in a datatable u need to u use the select method
hastable are designed to be fast and one way in purpose
Have Fun
Never forget it
|
|
|
|
|
In that case, would a generic collection be a good decision for this purpose?
Thanks
|
|
|
|
|
|
Hi guys,
I'm trying to do a very simple project where I can turn a light on and off via a software component. For example, when a mail message is received in a critical queue a light mounted on the ceiling blinks on and off in a certain pattern.
It sounds so easy but I have no idea where to start. I'm not sure how I can connect a tangible object with physical mass (Light fixture) to a logical object such as software (PC).
Can anyone recommend a kit or something like that where I could have a USB or Serial port connected to a circuit board which then in turn connects to a light switch or something to that effect?
I think codeproject has some articles on how to talk to a serial port in c#.
Thanks
|
|
|
|
|
|
|
Since most PCs nowadays don't have a parallel port any more, it may be useful to know
you can do similar things with a serial port; on a typical DB9 connector there are
some 5 so called control lines; some are inputs to the PC, others are outputs.
And you can observe the inputs and control the outputs using the SerialPort class,
once you have opened the appropriate port.
You will find several relevant articles on CP about this.
BTW: if you are not really familiar with electronics, I strongly recommend you
experiment with a USB-to-serial cable; that way, when you damage the goods, it is
just that cable that has to be replaced, not your I/O card or mother board.
|
|
|
|
|
Ah.. great advise. Any chance there is an aftermarket kit that I could purchase on the hardware side that could demonstrate how this 120v lamp connects to a circuit board and then from the circuit board to the serial/parallel/usb port on the PC?
|
|
|
|
|
Hi,
don't know what is available in your area.
the link Alex provided also has "high voltage" stuff, things that would control
120/230V equipment.
DIY stuff would be cheaper, provided you get it right from the beginning...
|
|
|
|