|
I don't see any candidate for a regex here, what are you trying to do ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
|
I think I found the answer, let me know if its wrong:
Search pattern: \bfor\b \((.*?);\s(.*?)\;(.*?)\)
Replace pattern: while($2)
RegOption.Singleline = on
With greate code, comes greate complexity, so keep it simple stupid...
|
|
|
|
|
Is it possible to create a installer/setup file and make it as a CD and we should use this CD in one PC. If that CD is already used in particular PC and that CD should not support other PC. Is this possible.
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
1. That is no possibilities to write to CD (except if you have a CD Recorder)...
2. It's like Mission Impossible ... this CD will be explode in 5 sec..
Change your application, that the user must be register first.
If you create a serial number for that PC, you must take for example MAC-Address for the serial number.
That means, that serial number is valid only for that MAC-Address. Not for other PC.
|
|
|
|
|
I have saw some software CD's that can be used in only one PC. If that CD is used in one machine you cannot use that CD in another machine. I heared that they have used embedded systems. I did not find any clue please advice
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
I found one implementation here[^]. But I need similar functionality in C#.
Any Ideas?
Thanks
Sukhjinder...
|
|
|
|
|
|
Another Link I found on the above mentioned page http://msdn.microsoft.com/en-us/library/ms996463.aspx[^]
It seems I need to work with low level implementations (Windows Messages/Hooks, etc.). I'm looking for something which works well with MS .NET runtime and possibly with Mono as well.
It would be great if I can find some custom (not extended) implementation of OpenFileDialog with Preview box...
Thanks for all the information...
Looking for help on my OpenSource Media Player LetsYo
|
|
|
|
|
The OpenFileDialog Class is also using Windows API.
That means, you must search it again. Until now, I don't found any 100% .NET Codes of FileDialog.
|
|
|
|
|
Hi All
Already developed client(Developing for OPC) I am having code like below
1. OPCserverObj = Activator.CreateInstance( typeofOPCserver );
2. ifServer = (IOPCServer) OPCserverObj;
// connect all interfaces
3. ifCommon = (IOPCCommon) OPCserverObj;
4.ifBrowse = (IOPCBrowseServerAddressSpace) ifServer;
5.ifItmProps = (IOPCItemProperties) ifServer;
6.cpointcontainer= (UCOMIConnectionPointContainer) OPCserverObj;
Create different types of objects(type castings) with the same source object.
Note: IOPCServer, IOPCCommon, IOPCBrowseServerAddressSpace ..etc are different Interfaces.
How to achive this? How to decalre to object to get all 6 points.
Thanks in advance for your help
Satya
|
|
|
|
|
How about:
typeofOPCserver OPCserverObj = (typeofOPCserver)Activator.CreateInstance( typeofOPCserver ); ??
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
AFAIK, there is no method to do what you are asking. If you know the instance OPCserverObj has all the interfaces implemented, why not use the OPCserverObj instead of casting to each type ?
|
|
|
|
|
Or create an interface that includes all the others and try to cast to that?
|
|
|
|
|
I have the usual layers UI, objects, DAL and SQL Server.
In VB I instantiate the DAL in the object layer using a friend variable in a module. This allows me to use the DAL in any class in the object layer without exposing the DAL to the UI. DAL stays alive as long as the app is in process.
Now C# does not have the module concept and I do not want to pass the DAL to the UI to pass to each class in the object layer. I assume it is done with a static class but I am struggling to get it just right.
[edit] What you can do is to create a public static variable on a class and use it like...
The only problem is static classes cannot have constructors, so can I declare the static class, pass values to a method that instantiates the static DAL? Then use the static DAL var in the other classes
[/edit]
Never underestimate the power of human stupidity
RAH
modified on Tuesday, July 29, 2008 2:17 AM
|
|
|
|
|
I guess C# equivalent for friend is internal .
Mycroft Holmes wrote: Now C# does not have the module concept and I do not want to pass the DAL to the UI to pass to each class in the object layer
So multiple classes in the object layer shares a same DAL ? Your question is not clear. Posting some code would be helpful.
|
|
|
|
|
Thanks - I got it.
Declare a static class (clsMain) in the object layer with a static method to accept the credentails. Static method instantiates the DAL (gDBO) as internal using the creds.
ORM classes get at the at the DAL by using the clsMain.gDBO.????. Untested yet but it compiles
public static class clsMain
{
internal static dbOps.clsDBOps gDBO;
public static void SetCredentials(Credentials oCreds)
{
dbOps.Credentials _Creds = new dbOps.Credentials();
_Creds.Server = oCreds.Server;
_Creds.Database = oCreds.Database;
_Creds.UserID = oCreds.UserID;
_Creds.Password = oCreds.Password;
gDBO = new dbOps.clsDBOps(_Creds);
}
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You can also use static constructors in c#.
public class foo { static foo() { init stuff; }}
|
|
|
|
|
Hi All,
I have one class derived from ContentControl.
And inside it's content I have ImageSource and a TextBlock, I want to bind the Text property of TextBlock to the Name proeprty of an object but it's not working.Below is the code snippet:
public void AddBitmapToCanvas(System.Drawing.Bitmap bitmap, string pageName,int width,int height,HorizonPage hpage)
{
Binding txtBinding=new Binding("Name");
txtBinding.Source=hpage;
try
{
_pageImage = new PageImage {PageName = pageName};
content = new StringBuilder();
content.Append("<StackPanel xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" Height=\"");
content.Append(_pageImage.Height);
content.AppendFormat("\" Width=\"");
content.Append(_pageImage.Width);
content.Append("\"><Image Source=\"\" Height=\"");
content.Append(height);
content.Append("\" Width=\"");
content.Append(_pageImage.Width);
content.Append("\"></Image><TextBlock Text=\"\" TextAlignment=\"Left\" Height=\"");
content.Append(_textBlockHeight);
content.Append("\" Width=\"");
content.Append(_pageImage.Width);
content.Append("\" Foreground=\"Black\"></TextBlock></StackPanel> ");
ui = (UIElement)XamlReader.Load(xmlReader);
//Setting Image Source property
((Image)((StackPanel)ui).Children[0]).Source = WpfBitmap;
//Setting TextBlock Text property
((TextBlock)((StackPanel)ui).Children[1]).Text = pageName;
((TextBlock)((StackPanel)ui).Children[1]).SetBinding(TextBlock.TextProperty,txtBinding);
_pageImage.Content = ui;
}
}
Any help will be much appreciated..
Praveen Sharma
|
|
|
|
|
Hello,
How is it possible to determine which operating system is in use on the computer? XP Home or Professional or Vista Basic/Home Premium/Business etc.
Similarly, how is it possible to determine which version of office is installed Home and Student, Professional, Ultimate etc..
Thanks
|
|
|
|
|
|
That shows you the version numbers but i cannot find how to locate or determine whether it is home or professional for xp or any of the different versions for vista.
That class doesn't contain any other specifics.
|
|
|
|
|
|
Hi,
I saw an MSDN web page on the subject; it waw terribly complex, checking lots of things, and
switching; I did not note the link.
And then there is the registry key
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName"
which is good enough for me.
|
|
|
|
|
Hi All,
Can someone give me some hint on how to generate web services code from C# CodeDom?
most appreciated.
Andie
|
|
|
|