|
Hello
Is there anyone out there that knows how to develop the connection points that indicate relational mappings between two objects.. example: C# dataset designer can indicate foreign key relationships, or MSSQL diagrams also have the same connecting points that are adjustable. Adjustable by means of it not always being a straight line at all times..
So i'm building a busines object modeller and require the ability to show relational connection points on my business objects on a designer canvas. This leads my to believe that a implentation of maybe IDesignerHost is valid, but i would not know where to start with those connecter objects..
The connecting points must indicate what type of relationship it it and also must be adjustable when moved by using the mouse..
any ideas where to start.. please help.
Regards
|
|
|
|
|
You could always start by downloading Netron[^], and having a look to see how this was solved there.
"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
|
|
|
|
|
Hi All,
In my text box i need to allow alphanumerics and some special characters. Below is the code i used in Regular expression valiadator -it works perfectly fine.
"^[0-9a-zA-Z,@&_.-]+$"
I need to allow spaces in textbox. so can anyone please help me how to add it. I tried to add a space in the above existing validation but throws an error. Help required in this. Thanks in advance.
Thanks,
Santa.
|
|
|
|
|
Did you try with \s for the white space?
How does your code look like?
|
|
|
|
|
How to add the \s in the above expression. I added in many ways and saw it was not working.
Thanks,
Santa
|
|
|
|
|
can anyone plese help me in this issue.
i am struck here ..
requirement --- need to allow spaces text box so to need to add code for it in the regular expression validator.
Thanks,
Santa
|
|
|
|
|
This code:
Regex rx = new Regex(@"\s");
string test = "1234 abc";
if (rx.IsMatch(test))
Console.WriteLine("White space");
else
Console.WriteLine("No white space");
gives the output: White space for me.
|
|
|
|
|
can you please tell me how to add this \s in this expression
"^[0-9a-zA-Z,@&_.-]+$".
Thanks in advance.
Thanks ,
Santa
|
|
|
|
|
I think you need to learn a little bit about regular expressions, as it is simple to add the \s to your expression. Try looking at Expresso[^] which is a tool for creating, testing and examining regular expressions.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
suppose i have one form with one button and i want when i will click the button then mouse will go to a folder and double click on it to open. so please someone tell me how can i do this programatically.
i need this type of idea for developing screen sharing apps. i can develop apps with remoting that which run in client machine and capture client screen and send the scree to my apps and then my apps paint its screen with that image. it is easy but suppose client desktop has one folder called test and when i will click on the picture of that test folder from my end then what i need to send as a result apps in client end can programatically open that folder.
please i need good idea to move in right direction to develop a screen share apps. please give me the idea that how to open folder of client machine after clicking on the image of client desktop transferred by apps sitting in client machine.
i will be highly obliged if anyone can help me to develop this apps with idea and also can tell me if is there any site available from where i can download the sample code.
Thanks in advance
tbhattacharjee
|
|
|
|
|
i written following code under printDocument1_PrintPage event
Font f = new Font("Arial", 14, FontStyle.Regular);
Brush b = Brushes.Black;
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
for (int j = 0; j < dataGridView1.Columns.Count; j++)
{
e.Graphics.DrawString(this.dataGridView1(i, j) + " ", f, b, j * 5, i * 5);
}
}
i am getting error this.dataGridView1(i, j)
error message isError 1 Non-invocable member FormsApplication2.Form1.dataGridView1' cannot be used like a method.
please help me .
|
|
|
|
|
The part of your code that is giving the error is
e.Graphics.DrawString(<big>this.dataGridView1(i, j)</big> + " ", f, b, j * 5, i * 5);
You are using this.dataGridView1(i, j) as if there were a DataGridView method that takes a row index and a column index and returns the value stored there. There is no such method.
You need to use square brackets '[]'.
Like this:
e.Graphics.DrawString(<big>this.dataGridView1[i, j]</big> + " ", f, b, j * 5, i * 5);
but as you have it you will get incorrect results, as it is dgrid[colindex, rowindex] and you are using dgrid[rowindex, colindex]
You can use something like
e.Graphics.DrawString(this.dataGridView1.Rows[i].Cells[j].Value.ToString() + " ", f, b, j * 5, i * 5);
so that you do not get confused about cols and rows.
Note also the .Value.ToString() in the last bit of code, you may, or may not need to use it in your code.
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.”
|
|
|
|
|
Hi,
I developped a windows service and I'd like to retrieve its own credentials (the "Run As" credentials, not the WindowsIdentity). Is it possible?
If yes, can those credentials be converted to NetworkCredentials? (for webservices calls)
thanks
|
|
|
|
|
Hi,
I have a scenario where I'm validating the data in a text box for special character.
The user can enter the data through keyboard, Copy & paste data using Ctrl+C and Ctrl+V from keyboard, or right click and paste using mouse.
I have to validate the data before it is pasted to the textbox. I'm validating the data for first two scenarios, i.e., validating while user enteres the data, or pasting the data using Ctrl+C and Ctrl+V from keyboard.
I'm not able to find any events which triggers contextmenu_paste_click event.
I'm not allowed to create a context menu for the textbox, that is I have to use the default context menu and I cannot create a new class which inherits the textBox class.
How can I implement this?
Any suggestion is appreciated.
Thank you.
|
|
|
|
|
Handle the textchange event, it will be triggered by the paste
only two letters away from being an asset
|
|
|
|
|
Thank you Mark Nischalke for your suggestion.
It works as far as validation is concerned, but doesn't serve my requirement completely, because for the following reason:
suppose the user pastes some text and it he tries to add some thing to same text, then the onTextchanged event is triggered and copies the same text again to the text box. and for other events like cut this event is triggered.
So, I would like to is there any way to access the paste_click event in the default context menu.
|
|
|
|
|
Pavan Navali wrote: onTextchanged event is triggered and copies the same text again to the text box
Why would it do this?
only two letters away from being an asset
|
|
|
|
|
Hello,
i have a problem using IE7.
i have 4 text button (hyperLink) that should working after the user logged in with user and password.
the problem is that: if the hyperlink is disabled the mouse arrow is pointer and not write arrow as it should be in IE7, but in IE8 it's ok.
what can i do using css to fix it ???
10x for all.
Ido.
|
|
|
|
|
Idosha wrote: what can i do using css to fix it ???
First, choose the correct forum. This question would be better posed in the ASP.NET or Web Development forums, it has nothing to do with C#.
Change the CSS on those elements to an appropriate cursor setting.
only two letters away from being an asset
|
|
|
|
|
Hi
I'm trying to measure data from a multicast udp address.
To do this, i use a socket added to multicastgroup and this code:
while (!b)
{
byte[] buffer = new byte[udpReceiver.Available];
udpReceiver.Receive(buffer, 0, buffer.Length, SocketFlags.None, out err);
if ((DateTime.Now - starttime).TotalSeconds < ((double)elem.timetowatch_ms / 1000))
{
newvalue += (ulong)buffer.Length;
}
else
{
newvalue += (ulong)buffer.Length;
receivedByteNumber = ((Convert.ToUInt64((double)newvalue / (DateTime.Now - starttime).TotalSeconds)) / 128);
newvalue = 0;
starttime = DateTime.Now;
b = true;
}
}
my problem that it is using about 50% of cpu time and if i place it in a thread
it shows less data (~4000kbits/sec) than if it is placed on a main thread (~7000) - possibly because of system time management, but i'm unsure.
Any better suggestion on data measuring on multicast udp with less cpu and regardless of this threadproblem?
Thanks in advance:
Collapo
modified on Thursday, September 17, 2009 7:14 AM
|
|
|
|
|
I see you have a dual-core system.
The code you created is basically a polling loop: you are repeating the same thing over and over, without waiting for anything, so the core that executes it will spin around as fast as it can: assume Available is zero, Receive sees zero-length buffer, returns immediately, timespan is very small, loop iteration done, on to the next loop wasting even more cycles.
You need to fix this in one of several ways:
- include a Thread.Sleep(x) in your code, where x>0; say x=33; that way your code will run at most 30 times per second, and your CPU usage will go way down. However you now may miss some packets.
- use a fixed-length buffer, say 2048B; that way Receive will have to wait for data; drawback is it will not report smaller packets until the buffer gets full, so there is a lag.
- use asynchronous I/O, look for BeginReceive. IMO that would be the correct way.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Thanks Luc!
Yeapp, it seem reasonable...
- Thread.Sleep(x) is loosing too much packets, so it won't be good for me i guess
- fixed buffer might be good, I'll try it in a short time
- I'll try BeginReceive as well, though i am not familiar with callbacks, so i would be really thankful if you could enlighten me on that
collapo
|
|
|
|
|
collapo wrote: enlighten me
read the documentation, it probably holds an example.
and learn to use Google, it knows more than 6 million CPians combined.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
|
i'm working C#
I don,t know API very well
please help me how can i learn API in C#?
Also, i,m very thankful if introduce me some good book about API
|
|
|
|
|