|
Sounds to me like a use for several of the windows application blocks in the Enterprise library, specifically the logging application block and maybe some custom code built on that.
Also maybe making use of performance counters?
http://msdn2.microsoft.com/en-us/library/aa480453.aspx[^]
|
|
|
|
|
|
This might be a different approach to the problem, but...
What immediately comes to mind is the use of some custom attributes. You might also want to check out the Spring.NET framework. There's a lot you could do with some of the functionality in that framework. This very much sounds like a cross-cutting concern, for which aspect-oriented programming would be well suited.
BW
|
|
|
|
|
Hi,
i have one windows service & i created one setup for windows service using VS.NET 2005. After adding project output getting following error.
"The following files may have dependencies that cannot be determined automatically.
Please confirm that all dependencies have been added to the project.
c:\winnt\system32\shdocvw.dll"
If i build setup getting build error Error
"'shdocvw.dll' should be excluded because its source file 'C:\WINNT\system32\shdocvw.dll' is under Windows System File Protection."
How to resolve please help me.....
Ramana
|
|
|
|
|
Hi everybody!
This is my question (may be a very unprofessional one): when I make a project in Visual Studio and add a reference to some dll file and complete the project( by here every thing is OK!),so the program runs in my system as I want,BUT! as you know if I want to pick the project up and run it in another system so I should add and reference the dlls again. Is there some professional way to add dlls once and the program could be run on every system whitout being worry about adding dlls?
thanks in advance
|
|
|
|
|
Well what dlls are you referencing? If they're part of the .NET framework then they will come with the framework.
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
I assume you're talking about your own dlls, not framework ones. The professional way is to ship the dlls with the product.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thank you for your reply
as you mentioned, I am talking about my own dlls (sorry for forgotting to say it. it would be very kind of you if you say what do you exactly mean with "ship the dlls in the product", whould you please explain it a little more.
I thank you again.
|
|
|
|
|
It's pretty straightforward. You choose to write code in a dll, or within the main app. If it's in a dll, then whoever runs the app, needs that dll. So, you have to make sure all your users have the dll. If you don't want it to be a dll, you need to move the code into your exe itself.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi all,
I'm trying to find a way to draw a sort of section of a pie.
Check this image:
http://img186.imageshack.us/img186/9095/piesectionsqv7.png[^]
I'm trying to draw an antialiased line around the blue section.
I have filled that blue section by adding a pie to a path, then adding another pie using the size of the inner circle, which effectively removes the inner ellipse area.
I can't get the same code working for drawing a border line.
The only other way I can think of is using regions and Exclude, but this will break antialiasing. Am I missing something here?
PS. I can't change my draw order, because the image could contain transparent sections.
Thanks in advance
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
Err, sorry I didn't see GDI+ when I hovered over the Graphics section
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
 Hmmm. This is a tad messy, but it works:
<br />
public class PieWithExclusionEllipse : IDisposable {<br />
private GraphicsPath path;<br />
public GraphicsPath Path { get { return this.path; } }<br />
public PieWithExclusionEllipse(Rectangle pie, float startAngle, float sweepAngle, Rectangle exclusionEllipse) {<br />
GraphicsPath outerLine = new GraphicsPath();<br />
GraphicsPath innerLine = new GraphicsPath();<br />
<br />
outerLine = new GraphicsPath();<br />
outerLine.AddPie(pie, startAngle, sweepAngle);<br />
<br />
if ((exclusionEllipse.Width != 0) && (exclusionEllipse.Height != 0)) {<br />
outerLine = this.removePointFromPath(outerLine, 0);<br />
outerLine = this.changePathPointType(outerLine, outerLine.PointCount - 1, PathPointType.Bezier);<br />
innerLine.AddPie(exclusionEllipse, startAngle, sweepAngle);<br />
innerLine = this.removePointFromPath(innerLine, 0);<br />
innerLine = this.changePathPointType(innerLine, innerLine.PointCount - 1, PathPointType.Bezier);<br />
innerLine.Reverse();<br />
outerLine.AddPath(innerLine, true);<br />
outerLine.CloseFigure();<br />
}<br />
<br />
this.path = outerLine;<br />
}<br />
private GraphicsPath changePathPointType(GraphicsPath path, int pointIndex, PathPointType pointType) {<br />
List<pointf> points = new List<pointf>();<br />
List<byte> pointTypes = new List<byte>();<br />
<br />
for (int index = 0; index < path.PointCount; index++) {<br />
points.Add(path.PathPoints[index]);<br />
<br />
if (index == pointIndex) {<br />
pointTypes.Add((byte)pointType);<br />
}<br />
else {<br />
pointTypes.Add(path.PathTypes[index]);<br />
}<br />
}<br />
return new GraphicsPath(points.ToArray(), pointTypes.ToArray());<br />
}<br />
<br />
private GraphicsPath removePointFromPath(GraphicsPath path, int removeIndex) {<br />
List<pointf> points = new List<pointf>();<br />
List<byte> pointTypes = new List<byte>();<br />
<br />
for (int index = 0; index < path.PointCount; index++) {<br />
if (index != removeIndex) {<br />
points.Add(path.PathPoints[index]);<br />
pointTypes.Add(path.PathTypes[index]);<br />
}<br />
}<br />
return new GraphicsPath(points.ToArray(), pointTypes.ToArray());<br />
}<br />
<br />
#region IDisposable Members<br />
<br />
public void Dispose() {<br />
if (this.path != null) {<br />
this.path.Dispose();<br />
}<br />
}<br />
<br />
#endregion<br />
}<br />
</byte></byte></pointf></pointf></byte></byte></pointf></pointf>
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
Why don't you use ZedGraph? there's an article posted on CP about it.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
How can I have the results from a GridView or DetailsView e-mailed when the user inserts or updates their record?
Thanks for the help
|
|
|
|
|
I guess by building a table out of the data source and sending a HTML mail
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do you mean sending rendred output of gridview/details view ? You need to work with RenderControl() method. Here[^] is an article.
|
|
|
|
|
I had not seen this article but it sounds like what I need.
Thanks for the help!
|
|
|
|
|
Hi,
I'm writing a program on the .NET compact framework to connect to the MPD musicplayer via a wifi connection. When I run the program from the simulator it runs fine. However when I deploy the software on the real device, I see the strange fenomenom, that I get the same data back from the the Networkstream object twice (even when connected through the active sync app). I checked the network traffic and I can see no errors there, the messages are correctly in sync. The stream.read method however returns the same data twice, when I do a re-read the correct message is received and the software runs smoothly furtheron. I disabled the optimizer, played around with the socket options, without any result. Adding delays between send and receive doesn't help either, however I do see a difference in debug and release versions. Stepping through the code does not show the problem anymore.
// the code i use to send and receive
protected void sendCommand(string command)
{
if (stream != null)
{
mLock.WaitOne();
OnLog(">>" + command + "\r\n");
byte[] sendBytes = System.Text.Encoding.ASCII.GetBytes(command + "\r\n");
connection.GetStream().Write(sendBytes, 0, sendBytes.Length);
}
}
protected string readResponse(bool check)
{
if (stream != null)
{
byte[] myReadBuffer = new byte[connection.ReceiveBufferSize];
NetworkStream myStream = connection.GetStream();
StringBuilder response = new StringBuilder();
int numberOfBytesRead = 0;
if (stream.CanRead)
{
do
{
numberOfBytesRead = myStream.Read(myReadBuffer, 0, myReadBuffer.Length);
response.Append(Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead));
commander.addDatatrafic(numberOfBytesRead);
}
while (myStream.DataAvailable && numberOfBytesRead > 0);
OnLog("<<" + Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead) + "\r\n");
response.Replace("\n", "\r\n");
if (check)
{
if (!checkOK(response.ToString()) && !checkFailed(response.ToString()))
{
response.Append(readResponse());
}
}
mLock.ReleaseMutex();
//lastresponse = response.ToString();
return response.ToString();
}
return "";
}
else
{
return "";
}
}
Anybody any ideas?
Regrards,
eric
modified on Monday, April 14, 2008 4:45 PM
|
|
|
|
|
Hi there,
i have an application developed for Windows Xp on VS2003 which uses Microsoft.ApplicationBlocks.Data.dll. Now i wish to migrate the application to windows vista for which i first need to migrate my code to VS2005. i want to know whether Microsoft.ApplicationBlocks.Data.dll is compatible to VS2005 and subsequently Vista. If no, then what are the workarounds or what else should i do.
Hope for help
Best Regards,
Mustanseer
|
|
|
|
|
It depends on the version of the ApplicationBlock you're using, not the name of the .DLL. But, generally speaking, yes, it'll work.
|
|
|
|
|
Well, he asked in three forums, and finally got an answer
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Well, he asked in three forums, and finally got an answer
Damn - he broke the duck.
|
|
|
|
|
Bugger! I didn't even bother to look before responding... Too late to smack him around now...
|
|
|
|
|
I want to create a method that maked the scrollbars of a textbox control visible only if needed.
I tried to use the following method but it doesn't always work, because some times is the control's width much bigger than the Height (I am talking when the WordWrap is set to False):
Private Sub TextBox1_TextChanged(ByVal sender As TextBox, ByVal e As System.EventArgs) _<br />
Handles TextBox1.TextChanged, TextBox1.Resize, TextBox1.FontChanged<br />
<br />
Dim fS As Size = TextRenderer.MeasureText(sender.Text, sender.Font)<br />
Dim cS As Integer = fS.Height * fS.Width<br />
Dim dS As Integer = sender.Size.Height * sender.Size.Width<br />
If dS < cS Then<br />
sender.ScrollBars = ScrollBars.Both<br />
Else<br />
sender.ScrollBars = ScrollBars.None<br />
End If <br />
End Sub
so here is some findings about the text box's control behaviour, maybe it's gonna be useful:
these numbers just bellow (123456) charachterize th number of lines
1 2 3 4 5 6
10 6 22 38 54 70 86 16^
11 6 24 42 60 78 96 18^
12 6 26 46 66 86 106 20^
13 6 28 50 72 94 126 22^
0 2 4 6 8 10 ^the numbers in this col. are the control's increment per font against line
^this column is the textbox's font's size
the numbers within the table (6,22,38~72,94,126) are the Size.Height of the control, corresponding to font size and line numbers.
well I don't want to waste your time,
does any body have any solution?
thanks for your time.
Shimi
|
|
|
|
|
this what I have made, and it does the trick (my WrapLines is set to false I didn't check when true):
private void tbScroll(object sender, EventArgs e)<br />
{<br />
TextBox tb = (TextBox)sender;<br />
Size tS = TextRenderer.MeasureText(tb.Text, tb.Font);<br />
bool Hsb = tb.ClientSize.Height < tS.Height + int.Parse(tb.Font.Size);<br />
bool Vsb = tb.ClientSize.Width < tS.Width;<br />
<br />
<br />
if (Hsb && Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.Both;<br />
}<br />
else if (!Hsb && !Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.None;<br />
}<br />
else if (Hsb && !Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.Vertical;<br />
}<br />
else if (!Hsb && Vsb)<br />
{<br />
tb.ScrollBars = ScrollBars.Horizontal;<br />
}<br />
<br />
sender = (object)tb;<br />
}
this event is raised at TextChanged and at ClientSizeChanged
Shimi
|
|
|
|