|
I am having a class as below
My settings file is as below
using System;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System.Configuration;
namespace
Core
{
public class FormSettings : ApplicationSettingsBase
{
private static FormSettings _frmSettings = new FormSettings();
[
UserScopedSetting()]
[
DefaultSettingValueAttribute("0, 0")]
public Point FormLocation
{
get { return (Point)(this["FormLocation"]); }
set { this["FormLocation"] = value; }
}
[
UserScopedSetting()]
[
DefaultSettingValueAttribute("0,0")]
public Size FormSize
{
get { return (Size)this["FormSize"]; }
set { this["FormSize"] = value; }
}
[
UserScopedSetting()]
[
DefaultSettingValueAttribute("225, 200")]
public Size RHSPanelSize
{
get {return (Size)this["RHSPanelSize"]; }
set { this["RHSPanelSize"] = value;}
}
[
UserScopedSetting()]
[
DefaultSettingValueAttribute("Vertical")]
public Orientation TabOrientation
{
get { return (Orientation)this["TabOrientation"]; }
set { this["TabOrientation"] = value; }
}
public static Outpost.Core.FormSettings MyFormSettings
{
get { return _frmSettings; }
}
public static void SaveOrientation(string p, Orientation orientation)
{
MyFormSettings.SettingsKey = p.TrimEnd();
Outpost.Core.
FormSettings theSettings = (FormSettings)MyFormSettings;
theSettings.TabOrientation = orientation;
MyFormSettings.Save();
}
public static Orientation GetOrientation(string p)
{
MyFormSettings.SettingsKey = p.TrimEnd();
Outpost.Core.
FormSettings theSettings = (FormSettings)MyFormSettings;
return theSettings.TabOrientation;
}
}
}
And from my control having a tab,i am calling the method
this._dashboardPage.Orientation = Core.FormSettings.GetOrientation(this._dashboardPage.Name);
I dont seem to get the actual value,But i only get the default.I see the config and the correct values were saved.
What am i doing wrong???
Please help
Thanks
A
|
|
|
|
|
I want to implement a REST web service using VS 2005 & 3.0 framework.are any plugins required for the same?
(WCF service template is not available in VS2005.)
if not how do i create a service file for the same?
|
|
|
|
|
It's called .Net 3.0
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You'll need the WCF/WPF extensions for VS2005[^]. Be warned, these tools area bit flaky. It is best if you move to VS2008
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
why can't i import these dlls through 'add reference'? it makes some error when i do that.
once, i saw a code and the programmer was using them within his codes. i mean he was not imported them through 'add reference', he was using them with following codes:
class CLocker
{
[DllImport("user32.dll")] static extern int GetThreadDesktop(int dwThread);
[DllImport("kernel32.dll")] static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, int dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, ref PROCESS_INFORMATION lpProcessInformation);
}
and finally my question is how did he understand that he has to identify those 'CreateProcees(...)' and 'GetThreadDesktop(...)' methods with those kind of parameters?
for this question, i pasted just two of methods, there are some other methods like this,too.
|
|
|
|
|
Sajjad Izadi wrote: why can't i import these dlls through 'add reference'?
Because they are not .NET assemblies.
Sajjad Izadi wrote: finally my question is how did he understand that he has to identify those 'CreateProcees(...)' and 'GetThreadDesktop(...)' methods with those kind of parameters?
www.Pinvoke.net[^] may help
|
|
|
|
|
|
You asked this yesterday! Did you delete all your code and start over?
|
|
|
|
|
|
vinaykskvs wrote: Its very urgent..
Now you've done it...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
How wide is this sine wave? Because if your drawing from 0-720 degrees, then your wasting time because the wave repeats every 360.
Also, if your wave doesn't change (or doesn't change very often) then it might be better to draw the wave onto a separate bitmap and then just draw the bitmap.
GDI+ is slow, mostly because it seems to do everything with transparency/alpha and if you have AA or smoothing its going to go very slow. So plotting your points is going to be a killer - what with all the separate lines being drawn, calculations to get a smooth curve, smoothing to make the actual line look nice etc. But if you only plot the points once (on to a Bitmap) and then just draw the image, it should be much faster.
EDIT: Oh yeah, and if your problem was that it ran slowly and the curve looked crappy, then you would have been much better saying that in your topic, and telling us what you already tried. Possibly saying thanks for the help in the other topic to keep the other members happy. They do love to complain y'know.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
vinaykskvs,
Repost[^]
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Maybe he deleted all his code
|
|
|
|
|
I'm sure I saw a very similar question not so long ago, and it got replies too! So I hope your not the same person.
Anyway, a Graphics object has the method DrawCurve which takes a Pen and a PointF[] as parameters, so you can probably use that.
PointF[] myPoints;
...
void MainFormPaint(object sender, PaintEventArgs e)
{
e.Graphics.DrawCurve(Pens.Black, myPoints);
}
EDIT: Wow, so many replies in a few moments! And you are the same person, for shame.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I'm using datagrid in a web page, i want to add new records in the database using this grid, can I?
Thanks for help
|
|
|
|
|
|
hi,
i'm trying to write a compact file sharing application- server side and client.
client connect to the server given port and ip (for searching files)and at the same time listening on a different port to other clients trying to connect (file transfering requests).
while connected to the server and listening for incoming clients requests he can connect to other clients (for receiving files).
i have problem testing this application on my computer:
after connecting to server and starting to listen, when the client trying to create a new TcpClient connection object i get the TcpClient Exception:"The requested address is not valid in its context"
thanks in advance
yohay
modified on Thursday, June 5, 2008 8:29 AM
|
|
|
|
|
This usually results from an attempt to bind a listening socket to an IP address that's not valid for the local machine.
Are you using 127.0.0.1 as your ip address in the client (on the local machine)?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
yes..(or tcpClient=new TcpClient("localhost", 9355);)
|
|
|
|
|
Hi,
I'm new to C# and am having an issue understanding how to easily handle something that should be straightforward.
That is, I have an array of a fixed length. At each iteration a new double is added to the array and the oldest is to be removed. How do I do this, and re-index all of the other elements in the array accordingly, without rebuilding the entire array each time?
Regards,
Dave
|
|
|
|
|
DwR wrote: the oldest is to be removed.
How do you keep track what is the oldest?
|
|
|
|
|
New values are time dependant. So, the first entry in the array is always the oldest.
Regards,
Dave
|
|
|
|
|
A queue will be best here, refer to Ashfield's reply.
|
|
|
|
|
|
int i=0;
try // you can try if there is an array index and catch it if you are going out of your array bound
{
for(i=0;i<doublearray.legnth;i++)>
{
//it replaces the next index with the current index
doubleArray[i]=doubleArray[i+1];
}
}
// if you call doubleArray[doubleArray.Legnth], actully you have called an out of bound index, so you have made an exception and you can solve it with a try-catch statement
catch
{
//now your newValue is replace as doubleArray[doubleArray.Legnth-1]
doubleArray[i]=newValue;
}
|
|
|
|