|
I’m going to build an application that should be based on plugins that extend the core application with extra customer specific functions.
I like my plugins to have a common look, fell, and behaviour. I like tips on how to design my application to make it extendible. I like some tips on design patterns that could be useful.
I like to see my core-application as a framework for further development of plug-ins. I’ve read some articles on reflection and I get the point of it but I don’t really yet have the right thinking of how to apply common design patterns.
My other question is how I can get the look and fell of my plug-in dialogs like Visual Studios dockable windows. Is there any support for that in the .NET framework?
All tips on how I should start design my application and make it look good are welcomed!
_____________________________
...and justice for all
APe
|
|
|
|
|
Hi,
you could search for plugin[^] here on CodeProject to get a starting point.
There is no inbuilt support for dockings. Either have a look at this[^] or if you can afford to spend some money on it then here[^].
|
|
|
|
|
Thanks for your tips.
Robert Rohde wrote: can afford to spend some money on it then here[^].
...cool!! Hope my boss can aford that.
I also found this:
DockPanel by Weifen Luo
!!!!
_____________________________
...and justice for all
APe
|
|
|
|
|
Hello, in runtime I create compoments (labels, checkboxs) later I want to clear those, but method that i`m using remove only half of them. Here is that method:
foreach (Control ctrl in Controls)
{
if (ctrl is Label)
{
Controls.Remove(ctrl);
}
}
|
|
|
|
|
You are not allowed to remove elements of a list within a foreach on it. You should do it this way:
for (int i = Controls.Count - 1; i >= 0; i--) {
if (Controls[i] is Label)
Controls.Remove(Controls[i]);
}
|
|
|
|
|
now it`s working, thank you very much.
|
|
|
|
|
Hi all,
I have an Activex player.i need to download its dll in aspx page.For that I am using the following <object> tag.
<br />
<object ID="AxPlayer"<br />
classid="clsid:ARB6AA3F-5D76-41E4-B6D9-6AD25326A988"<br />
codebase="C:/Inetpub/wwwroot/AxPlayer/AxPlayer.dll#Version=1,0,0,3"<br />
hspace=0<br />
vspace=0 border=15><br />
</object><br />
Its working fine.But my problem is ,
While downloading the Dll,i need to show a flash movie.
(A movie, showing that the dll is downloading...)
I have included another <object> tag to get the flash.But both the Activex player and the flash is coming simultaneously..
I need to get the flash, only when the Activex player is downloading.
How can i do that.??
Please help me.its urgent
Thanks in advance.
puja
-- modified at 2:46 Saturday 29th April, 2006
|
|
|
|
|
I'm a newbie so excuse the simplicity of my question. I have to create a class which contains a total value sold in dollars and a total commission earned field that are intialized to 0 and a commissions rate field required by the class constructor. This is what I have:
public class AutoSalesperson
{
private double TotalValueNum = 0;
private double CommissionEarnedNum = 0;
private double CommissionRateNum;
I'm confused about the constructor especially
Thank you and have a good day
|
|
|
|
|
augie0216 wrote: a commissions rate field required by the class constructor
Do you mean that the class constructor takes this in as a parameter?
If so, try something like this:
public class AutoSalesperson
{
private double totalValueNum = 0;
private double commissionEarnedNum = 0;
private double commissionRateNum;
public AutoSalesperson(double commissionRateNum)
{
this.commissionRateNum = commissionRateNum;
}
}
Note: It is generally good practice to use camelCaseVariableNames (first char is lower case) for private fields of a class, local variables, and parameters.
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
I using theis code to disover new registre
**********************************************************************************8
if(OurKey !=null)
{
//find all the subkeys
daemonKey = OurKey.GetSubKeyNames();
//how many found?
numElements = daemonKey.Length.ToString();
count=Convert.ToInt32(numElements);
for(int i=0;i<=count-1; ++i)
{
newDKey=newDKey+daemonKey[i];
//label1.Text=newDKey; //LABEL 1
//reopen the registry with new path
RegistryKey OurKey1 = Registry.LocalMachine;
OurKey1=OurKey1.OpenSubKey(newDKey,true);
string status =(string)OurKey1.GetValue("Alive");/////line A
label1.Text = status; //Line B
}
***********************************************************************************************
The new path is read correct with (label1.Text=newDKey)
I am trying to read a DWORD value define by the DWORD key "Alive"
If I compile the program, no errors are reported but still cannot read the DWORD value into the label1.
Any help is greatly appreciated
|
|
|
|
|
Hello everybody !
Can you help me about that problem? Thanks to you ! I want to retrieve conversation text from Yahoo Messenger by APIs of C#. How can I do? Thanks
Phong
-- modified at 1:14 Saturday 29th April, 2006
|
|
|
|
|
I started developing a web part but am having some security issues with it. I am trying to do some really simple stuff as shown below.
<br />
SPWeb mySite = SPControl.GetContextWeb(Context);<br />
output.WriteLine(SPEncode.HtmlEncode(mySite.Users.Count.ToString()));
It is the SPWeb line that is giving me the security error which is:
Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed.
I started by making the webpart safe in the wss_minimaltrust.config file by using the Public key. That didn't work so I upgraded the trust level to Medium in the web.config file just to see what would happen. it still broke so I upgraded the trust level to Full. It still broke!
This code is used by many others all over the web but I haven't seen them having any issues. Full trust should allow everything so why am I still getting a security error?
Oh, and I did iisreset between each security change just to be sure it took hold.
Thanks for any help!
|
|
|
|
|
Ok, so duh...
I was editing the web.config located in Program Files\Common Files\Microsoft Shared\web server extensions\60\CONFIG when the web.config that needs to be edited is in the web root under Inetpub.
|
|
|
|
|
Hi,
I was just wondering if anybody else has same problem -> I can't seem to get this to work on other than UI thread. So this works if you call it directly on form
[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand,
string strReturn, int iReturnLength, IntPtr hwndCallback);
private void OnSomeButtonClick()
{
PlaySound(new object[] {"c:/sound.mp3", this.Handle});
}
private void PlaySound(object soundToPlay)
{
string soundToPlay = ((object[])data)[0];
Handle handle = ((object[])data)[1];
string sCommand = "open \"" + soundToPlay + "\" type mpegvideo alias MediaFile";
mciSendString(sCommand, null, 0, IntPtr.Zero);
sCommand = "play MediaFile wait";
mciSendString(sCommand, null, 0, handle);
string sCommand = "close MediaFile";
mciSendString(sCommand, null, 0, IntPtr.Zero);
}
But if you say:
private void OnSomeButtonClick()
{
ThreadPool.QueueUserWorkItem(new WaitCallback(PlaySound), new object[] {"c:/sound.mp3", this.Handle});
}
It won't play sound... anyone?
Tnx in advance
|
|
|
|
|
Hi!
I am trying to develop the messenger-like program and i need to make possible for clients to make the audio conversation to each other! Do i need to use RTSP or what? How is this option implemented in other popular messengers(MSN Messenger)!? Any help would be very very appreciated!
|
|
|
|
|
RTSP = TcpClient for control, UdpClient for communication is ql idea.
However you'll need a way to record wave and play it on other side... these two articles should help you do that pretty easily:
http://www.codeproject.com/cs/media/cswavrec.asp
http://www.eggheadcafe.com/articles/20050611.asp
Enjoy
|
|
|
|
|
But if i use TcpClient for control, doesn`t it mean i must use TCP for data transmition as well!?
And about recording and playback sounds, couldn`t that do with DirectX9 classes?
Thankx!
|
|
|
|
|
For TcpClient -> of course not. You can use TcpClient for recieving control commands ("START_SESSION", "END_SESSION"), and use UdpClient for data transport (it's faster)...
You can do recording with DX9.. but then all of your clients need to have DirectX 9 installed.
|
|
|
|
|
How can i implement RTP in c#!? I couldn`t find anybody to have done that! Why not use RTP protocol? I thought the RTP protocol was made for that kind of work!
|
|
|
|
|
|
Thanx!!! Where did you find this code!? Did you wrote it, maybe!? Thanx anyway!
|
|
|
|
|
Can you please tell me where I can find this C# RTP code?
The link posted here is not valid anymore
|
|
|
|
|
I have a C# 2005 program with Page Setup, Print & Preview Dialogs. Only problem is that if I invoke Page Setup repeatedly, (even without doing anything else) the margins are halved each time! If I run the print WITHOUT invoking Page Setup, it uses larger margins (on which I fail the print 'cos of insufficient space). I have downloaded and run a Microsoft MSDN example - and that does the same. I thought that Page Setup should start with the defaults and retain changes. What am I missing (please!)?
Pensioner Graham Dean
|
|
|
|
|
Nothing. That's a bug. I think it is culture dependant - are the borders displayd in millimeters instead of inch on your machine? The dialog is just not able to handle this cleanly.
Here is the workaround (with a slight rounding error):
PageSettings pageSettings;
PageSetupDialog dlg = new PageSetupDialog();
Margins curMargin = pageSettings.Margins;
pageSettings.Margins = new Margins(
ConvInchToMm(curMargin.Left), ConvInchToMm(curMargin.Right),
ConvInchToMm(curMargin.Top), ConvInchToMm(curMargin.Bottom));
dlg.PageSettings = pageSettings;
dlg.PrinterSettings = pageSettings.PrinterSettings;
if (dlg.ShowDialog() != DialogResult.OK)
{
pageSettings.Margins = curMargin;
}
Basically the dialog converts the metrics when leaving the dialog (only with Ok not with Cancel) but doesn't do it when entering which is causing the decrease.
If you have any other metric then millimeter you surely have to adjust the conversion:
private int ConvInchToMm(int hundrInch)
{
return (int)(hundrInch * 2.54);
}
|
|
|
|
|
Thanks a lot Robert - exlains everything, and I am glad it's Microsoft not me that got it wrong!
Yes, my machine settings are in mm. Problem is to know what the measurements are on the 'client' machine, and I also note that the Dialog has an Enable Metric property.
Gives me plenty to look at, and hopefully will now get everything working. Thanks again.
Pensioner Graham Dean
|
|
|
|