|
i have a pool of threads (max is 20), what they do is every so often (at the moment its every second) they monitor an inbox (email) for new emails and if it finds one it processes it!!!
however i know need to incorporate a new requirement which introduces a time delay ie poll an inbox for new emails on the first of every month, or every day/hour or every 3rd week of the month.
now if i use a threadpool (max of concurrent threads is 20) i could have a thread sat on there till the first of the month waiting to be executed doing nothing, therefore preventing other threads from getting executed. the question then is "Now how can u monitor multiple inboxes using threadpools (or somethign else for that matter), for new emails , which would allow u to include a time delay and not have a big effect on CPU processing or on the overall performance of the architecture?"
any ideas would be welcome, this has been bashing my head for days
|
|
|
|
|
hi,
i'd like to write a control.name to a text file during designtime.
i cant find a property or function like "OnNameChanged" or something like that.
is there any idea to solve this problem.
background is to localize a project. i'm using global an local resources.
during designtime i'd like to write the names of the control to my local resx(txt).
if localization is enabled in the form, VS writes the changed name in the resx owned by the form. the same i'd like do to with my local.resx during designtime. at the moment only with the control.name.
at the moment i have a LocalizedButton derived fom Button.
How is it possible to write the changed name during designtime to a txt file?
hope someone knows what i mean......
greetz
|
|
|
|
|
hi,
You can monitor the chages provided you need to go for a custom event.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sreejith ss nair wrote:
You can monitor the chages provided you need to go for a custom event.
what do you mean? dont understand it.
sure i can write my custom event who is firering when the name is changed.
but i STILL DONT know when the name property is changing.
how can i monitor the value without polling.
is it possible to override the setter method of the name propertiy or something like that.
or use the internal functions like VS does?
greetz
|
|
|
|
|
come on....
no ideas??
it must be possible do design a button who has is own new name property....
plz guys, help me!
|
|
|
|
|
Well, I can't imagine why you would want to do this. But, I can imagine a ton of problems with your idea.
Anyway, in order to get a custom event to fire, you'll have to make your own button class, inheriting from the SYstem.Windows.Forms.Button class. You'll have to expose your own Name property that includes the code to expose an OnNameChanged event. You'll fire off the event inside the Set code for your Name property. Then, you just use your Button class in place of the Windows.Forms Button class.
Now, you're going to run into the huge problem of each button instance knows nothing of the environment in which it exists.
How is each button going to know into what file it has to put it's new name? How is this file going to be identified? Better yet, how is each button going to know about it? They're not, unless...
You'll have to supply a mechanism in your OnNameChanged event to communicate with a plugin you have to write for the IDE that will expose this kind of information and a user interface so you can specify this kind of information.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i need this for a localization project.
there ill have so called global localized controls with a global translated resx file.
but for the non global controls i'd like to have the possibility to write the name for
the Name.Text property in this txt. for later local translation of the controls.
hope someone can imagine what im trying.....
the file will always resist in the root directory of the project per default,
and is always called local.txt
so i only have to test if the file exists, if not i'll generate a blank txt file.
sounds simply in my ears.
but i think ive just found a solution for my problem.
if it's so i'll post here what i've done.
thx for your answer!
greetz
|
|
|
|
|
I want to change a RowState property of a DataRow from a DataTable manually.
in example , i want to change from "Unchanged" state to "Added" state.
thanks.
|
|
|
|
|
Hi
I don't think it is possible.Because RowState property of DataRow is a read only property.out side code can't change its value.
Public ReadOnly Property RowState() As System.Data.DataRowState
Member of: System.Data.DataRow
Just go and look at all members of DataRow using object browser.
(Use Alt+Ctrl+J shortcut in .NET IDE)
M.Sendilkumar
Chennai.
|
|
|
|
|
hi,
You wrote :
I want to change a RowState property of a DataRow from a DataTable manually.
RowState property is used to get the current state of row. And it is a read-only property. You can access but you can't set the value.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I'm new with programming winform. I want to know how to draw a new control or extend a control. Please help me. Thanks in advanced.
kunkun
|
|
|
|
|
Hi,
you can create new controls by
Inherit from an existing control or
Inherit from UserControl or
Inherit from Control.
Thanks,
SGS
|
|
|
|
|
Thanks a lot but can you give me some documents?
kunkun
|
|
|
|
|
hi,
In codeproject we have lot of articles with example which help to to design user controls. Please do some search for these sort of article here in codeproject.com
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I am using a datagrid in my form
sometimes when a child form of this datagrid form closed
an exception like "Column C does not belong to the table T" was thrown.
this exception is rarely occured so rarely and I can not find the way that
it was generated, so I can not debug the the exception.
does anybody know how to generate this exception and how to handle it.
|
|
|
|
|
hi,
The exception is because you are accessing some column which is doesn't belongs to that perticular table. Reason may you are using datatable which is in form1 to some other form. And the point your are closing the form. The entire object are disposed. See better try to catch your exception and getback to me.
try
{
//Put your logic here
}
catch(exception Ex)
{
MessageBox.Show(Ex.Message.ToString());
}
Check what are the avilable (members) which you are accessing outside your form1 class file.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Thanks for your guide.
I know how can I catch the exceptions in my codes. Also I know if a column does not belong to a table, I couldn't access the column.
But if you read my message again I describe that this error is appeared so rarely. So I couldn't catch it.
regards,
Mehdi
|
|
|
|
|
Control class has an intresting property like Anchor. The SDK Documentation says: "A bitwise combination of the AnchorStyles values. The default is Top and Left". Whatever that means. So what is it ? Some kind of a enumeration ? If I would want to make a property like Anchor then how could I declare it ?
Regards, Desmond
|
|
|
|
|
hi,
Anchoring means keeping the position of the control fixed no matter if the user try to resize the form. You will get the anchoring feature while inheriting any built-in control into your custom controls.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Like the documentation says: It's a combination of AnchorStyles (an enumeration) values.
The AnchorStyles enumeration has the [Flags] attribute set, this means arbitrary combinations of enumeration values can be combined using bitwise OR.
For example:
myControl.Anchor = AnchorStyles.Left|AnchorStyles.Top;
Setting a flag:
myControl.Anchor |= AnchorStyles.Bottom;
Clearing a flag:
myControl.Anchor &= ~AnchorStyles.Bottom;
Testing for a flag:
if ((myControl.Anchor & AnchorStyles.Top) == AnchorStyles.Top) ...
Regards,
mav
|
|
|
|
|
To add to everything else that was posted...
For example, In your class, AnchorStyles will become a data type for an Anchor property that your class exposes. Since you want your enumeration members to be used by outside code, you'll make sure they're public also. Now, when you define to class' Anchor property, you'll do it something like this:
public class myComponent
{
[FlagsAttribute]
public enum AnchorStyles
{
Left = 1,
Top = 2,
Right = 4,
Bottom = 8
};
private AnchorStyles m_Anchor;
public AnchorStyles Anchor
{
get
{
return m_Anchor;
}
set
{
m_Anchor = value;
}
}
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i have a button_Click function to add a row to a DataTable , the DataTable Defined in another function called addRC(), which called by the Form_Load
can i access that DataTable in the addRC() from the button_Click() function , and how ?
|
|
|
|
|
hi,
You can access your DataTable variable anywhere in your .cs file or out side. Provided you need to declare as public. say
namespace xxx
{
class form1
{
public Datatable YourDataTable;
}
form_load()
{
//Here declare
YourDataTable=new DataTable();
//then populate your content. i mean run your method.
}
}
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
hi again , i don't want to define a public DataTable any where i want to access that one in the addRC() function
|
|
|
|
|
hi,
addRC() is an user defined function right. Suppose if you want to access any variable inside this sort of user defined function then the variable must be private or protected. And if you want to access variable a variable outside your class then it muct be protected or public.
Other wise declare that member variable as private and use property to get the value. I mean only the Get modifier in your property.
We can't any of local variable which is declared inside a function. Why because it's accessability is only inside that function. Don't feel bad. We have remady for this.Remady is , you can use 'out' modifier to access the value of that local variable which is there in that function.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|