|
Hi,
1. rendering
depends on your environment. in WinForms, use Graphics.DrawLine() and the like. In other environments, use whatever is appropriate.
2. hit testing
in my view hit testing takes a method, maybe an int HitTest(Point p) , which exists in the base class, and needs to be overridden by the specialized shapes. There are many ways to implement it, it depends on what you want to call a hit. Here is one I like a lot, although it isn't the easiest one:
- it basically calculates the distance from the mouse position (the Point parameter) to the nearest segment of the shape, and returns that.
- it gets called for all shapes, and the closest one wins, with an upper bound on the distance.
This works very comfortably for the user, as there is no need to exactly hit a line, and it allows to "see through" hollow shapes, so you can hit a small circle overlayed by a large hollow (i.e. unfilled) rectangle.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Ok, but remember, i wanted to avoid overlapping effects. For example look at the following code:
Path path = new Path();<br />
path.Stroke = Brushes.IndianRed;<br />
path.StrokeThickness = 0.05;<br />
path.Opacity = 0.5;<br />
GeometryGroup geometryGroup = new GeometryGroup();<br />
<br />
for (int i = 0; i < 5000; i++)<br />
{<br />
PathGeometry pathGeometry = new PathGeometry();<br />
PathFigure pathFigure = new PathFigure();<br />
pathFigure.StartPoint = new Point(rand.Next(0, 50), rand.Next(0, 50));<br />
pathFigure.Segments.Add(new LineSegment(new Point(rand.Next(0, 50), rand.Next(0, 50)), true));<br />
pathGeometry.Figures.Add(pathFigure);<br />
geometryGroup.Children.Add(pathGeometry);<br />
}<br />
<br />
path.Data = geometryGroup;<br />
Children.Add(path);
I can't set the brush or dashstyles individually to a Line. Only setting the "global" path values is possible, so that each Line is rendered equal. Thats my problem. I can take all the code inside the for loop, but then i have the overlapping effekt again.
|
|
|
|
|
Sorry, I have no experience with all that. Transparency always complicates things; and getting dashed lines to render properly used to be hard already without transparency!
Maybe you will end up rendering each layer to a separate hidden bitmap, then render those with appropriate transparency on top of each other?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi
I am currently working on a solution for the asynchronous processing of xml messages.
The solution broadly works as follows:
1. Xml Messages are passed to me via a Web Service (volumes of around a few 100 per day).
2. The Web service posts each Xml message onto a private message Queue (MSMQ).
3. A 'listening' / 'polling' windoes service retrieves messages from the message queue and routes them for onward processing (this could be transforming / appending the XML before passing to an external web service) or simply saving the message in a local DB).
My query surrounds the most appropriate approach for dealing with failures during the processing stage. Ideally I'd like any messages that fail due to particular handled errors ( web service unavaible ect) to be returned to the message queue and retried later, but having read a little regarding transactions I am unsure as to the most effecticent and appropriate mechansism for carrying this out. I could just programatically add the item backl to the top of the queue, or wrap the processing code in a DTS transaction. I can see that MSMQ supports its own transactions too, but all the examples seem to relate to wrapping the "send" in a transaction rather than dealing with an item taken from the queue.
if anyone has some relevant experience that they can bring to bear on this, I would be v grateful.
cheers
|
|
|
|
|
hi all,
i have development team contains 3 developer they are develope an asp.net web application , all of my team memebers face the follwoing error:
Compiler Error Message: CS0006: Metadata file
>> 'c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net
>> files\mbccs\544aefc6\a95796a7\assembly\dl2\11dbf13d\35abbe2b _537bc501\[DLL
>> NAME HERE].dll' could not be found.
are there any one can help me to solve this error perminantly???
thanx alote
|
|
|
|
|
Remove the folders under c:\windows\microsoft.net\framework\v1.1.4322\temporary asp.net files
These are temporary files created by ASP.NET that have a habit of becoming corrupted during development with 1.1
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi
i try to delete it but a message shown to me,
message text is " can't delete file, access denied"
how to solve it, and why this error appear to me?
|
|
|
|
|
Stop and restart the web server using iisreset . Delete the folder before anybody attempts to access the web site.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
1)Here's another solution; check the permissions for the relevant ASPNET (worker process) account on the %systemroot%\Temp and the C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files directories.
Changing the permissions for the IIS_WPG group on the latter directory from Modify to Full corrected the issue without requiring a refresh of the worker processes in our case.
2)Set impersonate = false for your whole web application:
<system.web>
<identity impersonate="false"/>
…
</system.web>
Put all your code under a directory and set impersonate to true for that location.
Reasons are not Important but Results are Important.
http://www.sql4professional.blogspot.com
Swati Tripathi
|
|
|
|
|
Hello!
I wanna know window dll file's built in function.
Could u help me any links or any E-books?
I'll thz u very much..........
|
|
|
|
|
phowarso wrote: I wanna know window dll file's built in function.
I can't understand what exactly are you trying to do.
What kind of dll, what kind of window?
Could you be more specific please.
Life is a stage and we are all actors!
|
|
|
|
|
phowarso wrote: I wanna know window dll file's built in function.Could u help me any links or any E-books?
Anything specific? Windows is "huge" in terms of code, and there's no complete list with all functions.
If you're just interested in browsing then you might want to check out PInvoke.NET[^]
I are Troll
|
|
|
|
|
|
Hi,
First you need to create public methods in the DLL. if you don't have any public method then you can not call it.
1. To use any DLL in your project first you need to add it in the project in Solution Explorer-> Project -> References -> right click and select "Add References" and select dll you want to use.
2. Then in your form add create object of the dll class and then use its method.
ie. DllName obj = new DllName();
obj.MethodName();
Hope this will help you.
Regards,
Nilesh Shah
|
|
|
|
|
Suppose i have 2 .net exes test1.exe and test2.exe
is Garbage collector common for these two? Do we have separate garbage collector for each exe?
My small attempt...
|
|
|
|
|
Absolutely yes.
Garbage collector is only one for any number of applications.
However it will perform clearance based on application context.
And application context is different for each application.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
sujithkumarsl wrote: Suppose i have 2 .net exes test1.exe and test2.exe
I'd assume that it collects the garbage of text1.exe, and then moves on to the next building. Test1 and Test2 both got their own garbage, and their own garbage-can.
sujithkumarsl wrote: Do we have separate garbage collector for each exe?
The builtin GC can handle multiple .NET executable on the same machine without additional configuration. So, in short, no.
I are Troll
|
|
|
|
|
Greeting All,
I need to switch between calender type at Regional and Language options,
Any one has an example or link that define that
Thanks for all
jooooo
|
|
|
|
|
kindman_nb wrote: I need to switch between calender type at Regional and Language options,
I wouldn't be very happy if some application changed my regional options - it would upset all other applications on my system!
Having said that, there's an example on doing so here[^]
I are Troll
|
|
|
|
|
I have a project where the data is intended to be hierarchical in nature. The obvious solution seemed to be to create a hierarchical set of domain objects: when you instantiate the root object (with its key) it goes to the database to get its properties and a list of children. It then instantiates a child object for each and maintains them in a collection. As each child object is instantiated the process repeats itself recursively.
All well and good. Except it doesn’t follow the principles of SOLID: these domain objects contain data access code. What is the correct design (or design pattern) here?
- Do I ignore SOLID in this case?
- Have a parallel hierarchy of data access helper objects (one for each domain object)?
- Do I keep all the data access code in the object that created the root domain object (ensuring it is thread-safe) and reference it from the domain objects using callbacks?
- Encapsulate the data access code in a thread-safe singleton helper?
- Is my basic approach flawed?
- Something else?
(The database hasn’t been designed yet, and the domain objects will need to be able to save changes ... more data access code. These domain objects will be accessed a number of ways including via a treeview in the UI.)
Surely this is something that must have come up many times before.
|
|
|
|
|
If you implement the children objects as interfaces (and you should, for the D in SOLID) then you can just leave them as placeholders until they are accessed in the tree.
I have also worked on a couple projects where you push an IDataAccessSomethingOrOther into a presenter or controller layer. As the view events are raised that require loading, methods on the IDataThingyIMentionedEarlier are invoked by the presenter/controller that would load those child objects up.
My advice would be to keep your data out of your model objects.
Cheers,
|
|
|
|
|
Hi TCMMJ,
You appear to have provided an answer to an entirely different thread here.
|
|
|
|
|
Really? Are you seeing it wrapped across the forum page?
Maybe I'm seeing it wrong, but I think I contributed to part of the answer.
|
|
|
|
|
Sorry, I think your right, the forum was wrapping, making your answer appear under my question - bizzarre??
|
|
|
|
|
Hi,all
I am rebuilding an existing application and would like to know more about using net remoting. The application is currently a windows forms application (Net 3.5) that talks directly to database using ADO. I would like to know if any performance gains can be expected if I were to switch from the existing approach and build a client server type application? Clients would hold the application GUI and use NET remoting(tcp channel, binary serialization) to talk to a single server application instance that would handle database operations (N-1). The whole system would be deployed in an enterprise environment ( Database is in one, central location with several other physical locations connected to it via VPN ).
I hope that was clear and thanks in advance for your help.
|
|
|
|