|
It is a public class that I got from code project actually.
A New Task Scheduler Class Library for .NET[^]
There is probably an easy way to modify this class code, I'm just not able to do it due to experience. Do you still feel the properties are hidden, or since this is a public class, I could expose them?
|
|
|
|
|
IF the properties are public, you can access them directly (or cast them into appropriate value).
|
|
|
|
|
Would you consider those public, if they are exposed by the IDE?
I'm able to cast this way
IEnumerable<Object> stList = serverTaskList.Cast<Object>();
but still not able to get intellisense to recognize the property names
|
|
|
|
|
The TaskList class only implements IEnumerable , not IEnumerable<T> . As a result, the implicit type of your task variable is Object , and you would need to cast it as a Task before you could access the properties.
The simplest solution is to specify the type name in your foreach loop:
foreach (Task task in serverTaskList)
{
...
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard. You're the man, you nailed it with that simple statement ... ugh I feel so foolish!
How did you know it only implemented IEnumerable and not IEnumerable<t> ?
|
|
|
|
|
turbosupramk3 wrote: How did you know it only implemented IEnumerable and not IEnumerable<T>?
I looked at the code[^] in the article[^] you linked to.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hello
I don't understand this, my app is perfectly not leaking memory and responsively and Task Manager "Detail" tab shows my app is consuming stead 350MB (I checked, update speed is Normal, so I am not looking at some stale counter) on this machine with 3900MB (i.e. almost 4GB)
Now, how come, when I close my process, the memory usage drops from 70% to 30%!?! Right away! as reported on Task Manager!? A 40% drop on this 3900GB machine is 1560MB - that's four times memory I am using. What am I reading here...?
Thanks in Advance
dev
|
|
|
|
|
First, STOP using Task Manager to tell you how much memory your .NET app is using.
It's telling you how much memory the .NET CLR has RESERVED for your app, not how much it's actually using.
This has been documented countless thousands of times all over the web. I know I've posted the explanation dozens of times here on CP.
.net memory task manager[^]
|
|
|
|
|
|
devvvy wrote: and second? This is not a C# question.
Veni, vidi, abiit domum
|
|
|
|
|
you have just contributed to the generally well being of code project Rich
dev
|
|
|
|
|
Just? That was nearly a week ago.
Veni, vidi, abiit domum
|
|
|
|
|
You already got the "second", I just didn't specify it.
|
|
|
|
|
dude, if google is more useful than you what good are you
dev
|
|
|
|
|
Google is only as useful as the person using (or NOT using) it.
If you can't do research and teach yourself, you're screwed in this business.
|
|
|
|
|
eat some icecream sour old man
dev
|
|
|
|
|
Funny you should say that...but it has nothing to do with ME being a sour old man.
|
|
|
|
|
Hey, I only speak the truth. If you can't handle it, don't be whiny about it and go get some ice cream yourself.
|
|
|
|
|
Good day
I a use a plugin interface to load a screen from a dll module. I created a thread to load a User Control from a separate dll. The user control form the plugin dll uses WPF to display some charts as a dashboard. When I use a normal WinForm user control it works fine but with the WPF user control I get a thread access error. Is there a way to allow access to the thread of a WPF form?
Here is my thread code that gets the uc from the dll
public void constructStartScreen()
{
ucSystemStartScreen _ucSystemStartScreen = new ucSystemStartScreen();
foreach (PluginInterface Plugin in TPlugins.PluginList)
{
if (Plugin.getSystemTag() == TPlugins.theSelectedPlugin)
{
ucBaseUserControl theStartScreen = new ucBaseUserControl();
theStartScreen = Plugin.getStartScreen();
if (theStartScreen != null)
{
theStartScreen.Dock = DockStyle.Fill;
theStartScreen.UserCurrentInfo.SetUserInfo(TUserInfo.UserID);
theStartScreen.UserCurrentInfo.IsLogedOn = TUserInfo.IsLogedOn;
theStartScreen.UserCurrentInfo.Connection = TUserInfo.Connection;
theStartScreen.theSystemDBTag = Plugin.getSystemDBTag();
_ucSystemStartScreen.setStartScreen(theStartScreen);
_ucSystemStartScreen.Dock = DockStyle.Fill;
DataTable RecentList = _MenuSystemDAO.getRecentList(TUserInfo.UserID);
_ucSystemStartScreen.loadRecentList(RecentList);
_ucSystemStartScreen.CanClose = true;
_ucSystemStartScreen.UserCurrentInfo.SetUserInfo(TUserInfo.UserID);
_ucSystemStartScreen.UserCurrentInfo.IsLogedOn = TUserInfo.IsLogedOn;
_ucSystemStartScreen.UserCurrentInfo.Connection = TUserInfo.Connection;
_ucSystemStartScreen.theSystemDBTag = Plugin.getSystemDBTag();
addStartScreen(_ucSystemStartScreen);
}
break;
}
}
}
The code in the DLL
public ucBaseUserControl getStartScreen()
{
ucHRStartScreen _ucHRStartScreen = new ucHRStartScreen();
return _ucHRStartScreen;
}
The
ucHRStartScreen has a elementhost control that loads the WPF screens.
|
|
|
|
|
There isn't enough code to see exactly what your doing, but the general problem is that you cannot touch/create/use/modify/whatever UI controls from anything other than the UI (startup) thread. Doing this stuff from any other thread will lead to the problems you're seeing, and more. This applies to both WPF and WinForms.
|
|
|
|
|
Please help me on this .... its very urgent and trying from last 10 days, otherwise tell me how save the file directly to disk using web browser control.
|
|
|
|
|
You can't do it directly. Check the documentation[^] to see which methods or properties can get the page content. My guess would be one of the DocumentXxx properties.
Veni, vidi, abiit domum
|
|
|
|
|
You can't do it using the WebBrowser control.
You CAN do it using the WebClient[^] class.
|
|
|
|
|
Hello All,
I've written a Windows application for adding data into an existing XML file that has the following schema:
<lectures>
<lecture>
<speakername>
</speakername>
<subject>
</subject>
<date>
</date>
<time>
</time>
<location>
</location>
</lecture>
</lectures>
There are more than one < lecture > node in the file, the above code just shows the schema of the file. The user adds data to an existing XML file by entering values into textboxes which correspond to the various child nodes of the < lecture > nodes in the XML file. Then when the user is done he/she can simply click the submit button to add data to the existing XML file. As it is, the app works but the data are not sorted. I would like to sort the XML file by date so that the dates are in ascending order. Please point me to a web page that discusses how this can be done or show me an example. Thanks in advance for your help.
modified 24-Nov-13 3:21am.
|
|
|
|
|
ASPnoob wrote: Please point me to a web page Google is very good at doing that.
A fairly simple solution would be to deserialize the XML data into a collection class[^], then sort it before rewriting it back to the XML file.
Veni, vidi, abiit domum
|
|
|
|