|
If you want to integrate with Visual Studio, you should check out the Visual Studio Extensibility Center/[^], there is all kinds of documentation for writing add-in's for Visual Studio there.
|
|
|
|
|
I have singleton server object that is published:
RemotingServices.Marshal(myObject, "myObj.rem");
And that object is connected to by clients:
IServerObj = RemotingServices.Connect("tcp://.../myObj.rem");
My question is, should I connect to IServerObj one time only and keep it alive until the client closes? Or is it better to connect to the IServerObj each time the client wants to communicate with it?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
I see it going both ways..
Leaving the connection open with clients that use it once in the morning and don't touch it again may not be the best choice.
Making connections as neccessary could result in a number of hits on the server depening on your clients usage.
I would probably look at keeping the connection open for a timed period then terminate it on expiration.
|
|
|
|
|
The usage is typically many messages get sent, then the user logs out. There's only brief periods when the connection is idle. However, using my "keep it always opened" technique, I've run into problems over WAN/internet where the connection gets disconnected for no apparent reason.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Hello,
I was wondering, how do you people update you UI such as controls, menu items and tool bar buttons?
I'd like to have something like ON_UPDATE_UI in MFC, but there's nothing in .NET. Currently I've used a timer every 1/4 of a second and it seems to work ok, without using much CPU time.
I know I could use MenuPopup events (it won't work since I have toolbar buttons for menu items), SelectedIndexChanged events and so on, but I would like a general approach.
Any ideas?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
To simply refresh the form (to redraw it's self) use: this.invalidate;
Please correct me if i'm wrong on this.
|
|
|
|
|
It works as you say, but is not what I'm looking for.
I'm asking about ideas to implement an update mechanism for user interface elements (menu items, toolbar buttons, controls).
For example, you only want the Delete button enabled if an item is selected in the list view control. You could use the SelectedIndexChanged event, but that would be particular for that list view control. What I want is a generalized mechanism for doing this.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
From reading that page, it seems a little too complicated for a general solution for a small app, isn't it?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Luis Alonso Ramos wrote:
From reading that page, it seems a little too complicated for a general solution for a small app, isn't it?
True, it all depends on how small the app really is.
|
|
|
|
|
Does the Application.Idle event serve your purpose?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Okay, so I'm just starting to work with AJAX, and I've run into one small problem. I have a .Net dropdownlist control with an "onChange" javascript event and an "OnSelectedIndexChanged" .Net event. When the selection is changed, I am populating another dropdownlist. Everything with AJAX seems to be working. The problem is, the dropdownlist is defaulted to one value. If I select a new value, everything works. But, if I then go back and select the original value, it does not work. The reason is that because I'm not doing an actual "PostBack", the selected value never really changes. So, when I go back to select the original value, .Net does not fire the "OnSelectedIndexChanged" event. Does this make sense? If so, does anybody know how I can fix this? Or something I could try? I've been racking my brain for hours to no avail. I can post code, but I'm pretty sure that won't make much of a difference. Thanks for any help.
Ex.
DEFAULT: LISTBOX1: A LISTBOX2: A, B, C, D
CHANGE : LISTBOX1: B LISTBOX2: E, F, G, H
CHANGE : LISTBOX1: A LISTBOX2: E, F, G, H (because .Net event didn't fire)
|
|
|
|
|
You might try posting this in the ASP.NET[^] forum.
|
|
|
|
|
Hello,
Is there a way to display a full row from a dataset, using some command,
or do I have to use sort of this statement where I have to list every column I want to be displayed.
Debug.WriteLine ("Row: "+myRows[0]["ProjectID"]+","+myRows[0]["ProjectTypeID"]+","+myRows[0]["EmployeeID"]+","+myRows[0]["VersionNumber"]);
Thank you
|
|
|
|
|
You could use WriteRow
<code>void WriteRow(DataRow row)
{
string str = "Row: ";
for(int i = 0; i < row.Table.Columns.Count; i++)
str += row[i].ToString();
Debug.WriteLine(str);
} I haven't tested this code, but it should work OK. I know a StringBuilder would be more efficent, but that's left as an excerise for the reader. (You could also output column names this way.)
Good luck!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hi friends,
I'm trying to detect locking of my workstation. so far I've worked a lot on it and the result of it is as following...
protected override void WndProc(ref System.Windows.Forms.Message m)<br />
{<br />
<br />
<br />
switch(m.Msg) <br />
{<br />
case WM_WTSSESSION_CHANGE:<br />
MessageBox.Show("Entered Session Change");<br />
switch((int)m.WParam)<br />
{<br />
case WTS_CONSOLE_CONNECT:<br />
MessageBox.Show("WTS_CONSOLE_CONNECT","WM_WTSSESSION_CHANGE");<br />
break;<br />
case WTS_CONSOLE_DISCONNECT:<br />
MessageBox.Show("WTS_CONSOLE_DISCONNECT","WM_WTSSESSION_CHANGE");<br />
break;<br />
case WTS_SESSION_LOCK:<br />
MessageBox.Show("WTS_SESSION_LOCK","WM_WTSSESSION_CHANGE");<br />
break;<br />
case WTS_SESSION_UNLOCK:<br />
MessageBox.Show("WTS_SESSION_UNLOCK","WM_WTSSESSION_CHANGE"); <br />
break;<br />
default:<br />
break;<br />
}<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
base.WndProc(ref m);<br />
}
The Messages like WTS_SESSION_LOCK and etc are also defined/declared in the application, as their values are found in windows.h;
Friends, my problem is that my application is running but it is neither responding to the code written above neither is generates any errors.
Please help me solve this problem. I want my system to respond to the above written code. Do I need to change it or any suggestions????? Please reply As Soon As Possible.
Thank u very much all in advance.
|
|
|
|
|
I've read a bunch of hubbub about side-by-side versioning in .NET, but what I haven't seen so far is a "live patching" mechanism. Specifically, I work with lots of ASP.NET applications, and we've had many many cases where we've ended up having to do complete releases to change one line of code. Surely there's a better way... In the old days' we'd have some sort of binary diff program we'd run on the executable... what's the right way to go here? And what's the right way to go specific to ASP.NET, where there are a lot of runtime generated assemblies?
Ian
|
|
|
|
|
If all you change is an aspx, you can just upload that file. If you change the code, then you need to upload the dll. You don't need to upload all your aspxs, just because you changed a line of codebehind.
I'm sure a binary diff ( being just a binary process ) will work just as well in .NET as it did in C++.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello,
I have the statement as indicated below, after I find the appropriate the row in my dataset, I want to duplicate this whole row, but change the values of 2 row element. How can I do that?
foreach (DataRow row in dataset.Tables["Versions"].Rows) {
if ((row["ProjectID"].ToString() == currProjID) && (row
["VersionNumber"].ToString() == currentVersion)) {
string verID = row["VersionID"].ToString();
if (row["IsProjectSetupComplete"].Equals(true)) {
WHAT GOES IN HERE?
}
}
}
Thank you.
|
|
|
|
|
row["col"] = new value;
dataset.Tables["Versions"].Rows.Add(row.ItemArray);
|
|
|
|
|
Im unable to find an error with this supposedly incorrect snippet that appeared in an aptitude test..please help me ASAP!!
i'd be very greatful...Thanx!
class Singleton
{
public static Singleton Instance() {
if (_instance == null)
_instance = new Singleton();
return _instance;
}
protected Singleton() {}
private static Singleton _instance = null;
}
Rohit(Mumbai)
|
|
|
|
|
I think the only thing I can see that is wrong is that the constructor is protected. Therefore if a second class derived from this class then it would be able to call the base() call from it's constructor. The class itself would need to be set as FINAL so that no derived classes could be created.
Anybody else spot anything else????
|
|
|
|
|
The singleton code is not thread safe. If it is guaranteed to run in a single threaded fashion, then I don't see any problem. But if two threads happen to call Instance() at the same time, there is a chance that there would be two separate Singleton objects, which defeats the very purpose of having a singleton.
The right way to do it is to protect the Instance() method with a lock. Something like
private static object syncObject = new object();
public static Singleton Instance()
{
lock(syncObject)
{
if (_instance == null)
_instance = new Singleton();
return _instance;
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Does anyone here know where to find and how to use Microsoft's timezone control (the one where you set your time zone from Control Panel/Date & Time; shows a flat projection of the globe)?
Ideally, I'd like something like .NET's fontDialog() or colorDialog().
|
|
|
|
|
If you don't care about the return value, you can just shell to
c:\winnt\system32\timedate.cpl
to pop up the date/time control panel applet.
Sean
|
|
|
|