|
Got it,
I'm sorry before...
the class I used only handle WM_LBUTTONDOWN / WMLBUTTONUP and WM_RBUTTONDOWN / WMRBUTTONUP..
so just modify the class a little bit and add WM_MBUTTONDOWN / MBUTTONUP and maybe the double click handler to modify it.
yeah..
thankz a lot..
|
|
|
|
|
Hi,
I am currently returning an XmlDocument from a webservice using the following:
<br />
[OperationContract]<br />
[FaultContract(typeof(Anaqua.Domain.AnaquaServiceError))]<br />
[XmlSerializerFormat]<br />
public XmlDocument GetLawUpdateGenerationXML(short versionNum)<br />
{<br />
}<br />
Then in my page that consumes the webservice I did the following:
<br />
XmlDocument doc = (XmlDocument)svc.GetLawUpdateGenerationXML(internalVersionNumber);<br />
However it is saying:
Cannot convert type 'System.Xml.XmlElement' to 'System.Xml.XmlDocument'
Now I think this is because of the serialization using[XmlSerializerFormat]
So how would I go about reading the XML into and XML Document?
Regards
Paul Custance
|
|
|
|
|
This link[^] should answer your question.
Paul
|
|
|
|
|
If you wish to append a child node to the document root of an already created XML file then
be sure to have using System.Xml;
then the following will add a node:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("path to your xml file that already had a root document node");
XmlNode newXmlNode = xmlDoc.CreateElement("tagname");
newXmlNode.AppendChild(xmlDoc.CreateTextElement("The tag's text node Value"));
xmlDoc.DocumentElement.AppendChild(newXmlNode);
|
|
|
|
|
Hi All,
Will anyone help in opening a View which is having its own Interface and Presenter. I want to open this view from base presenter in ModalWindow style. I need a sample application so that i can understand better..
Thanks in advance
Umashanker.K
|
|
|
|
|
umashankergr8 wrote: I need a sample application so that i can understand better..
Sorry. I can't create or upload the sample for you but I will tell you the steps that you need to follow to open the view in popup form. (I believe that you have some ideas about CAB (Composite UI Application Block) Frameworks and terms.)
#1. First, you need to add the View in WorkItem or ModuleWorkItem.
Dim objMyView As MyView = WorkItem.SmartParts.AddNew(Of MyView)(MyNamespace.Constants.SmartPartNames.MYVIEWID)
Note: If you are using SCSF, you can write the code above in AddView() methods.
#2. Add a form to your project and put the DeckWorkSpace in this form.
#3. Write the code below in your presenter when the view raise the event of presenter.
Dim formPopUp As New Infrastructure.UI.Form()<br />
formPopUp.Title = "MyView"<br />
formPopUp.StartPosition = FormStartPosition.CenterScreen<br />
formPopUp.FormBorderStyle = FormBorderStyle.FixedDialog<br />
formPopUp.MaximizeBox = False<br />
formPopUp.MinimizeBox = False<br />
formPopUp.ShowDialog()<br />
<br />
Note: Infrastructure.UI.Form should have one more constructor like that
<br />
Public Sub New(ByVal view As Control)<br />
Public Sub New(ByVal view As Control)<br />
InitializeComponent()<br />
<br />
Me.ClientSize = New System.Drawing.Size(view.Width, view.Height)<br />
Me.SuspendLayout()<br />
view.Dock = DockStyle.Fill<br />
<br />
'Adding View to Form<br />
'---------------------------------<br />
Me._contentPanel.Controls.Add(view) '' Note: _contentPenel is deckworkspace control.<br />
Me.ResumeLayout()<br />
'---------------------------------<br />
End Sub<br />
That's all..
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
...you just wrote a VB sample in the C# forum. BLASPHEMER!!!
"I need build Skynet. Plz send code"
|
|
|
|
|
Alaric_ wrote: ..you just wrote a VB sample in the C# forum.
Hi Alaric_, VB.NET code and C# are very easy to change since there are a lot of auto-converters available on internet.. so, it doesn't really matter whether the code is written in C# or VB.NET.
Alaric_ wrote: BLASPHEMER
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
many thanks for your reply. If you have a sample application then it will be of more useful to me. If you have please give me, of even if you know the link from where i can download please provide me the link.
|
|
|
|
|
I have the following piece of code :
if (File.Exists(FilePath + FileName))
Where Filepath is : "E:\Images\"
and FileName is a random image file name : "03834634.tif"
However "E:\" is a mapped drive on a shared network folder eg. "\\192.168.253.12\images$\"
I write the "FilePath + FileName" to a file and use that in Windows Explorer and I can successfully open the file. So the path and file name is correct however the code returns that the file does not exists ??? If I however change the filepath to my local drive the code would return correctly when the file exists and when it does not exits. Can anybody give any assistance why "File.Exists()" does not work on a mapped network drive ???
|
|
|
|
|
Oederu,
I think it may be a permission issue. I have tried the following and received true on both accounts.
string filepath1 = @"z:\HoganBackup.rarr";
string filepath2 = @"\\monster\Shared Files\users\Hogan\HoganBackup.rar";
MessageBox.Show(File.Exists(filepath1).ToString());
MessageBox.Show(File.Exists(filepath2).ToString());
I have read that you should use the UNC name for network shares, so try that first. Most importantly is that you (your program) has permission to see the file.
Hogan
|
|
|
|
|
He said he was able to open it with Explorer, so it can't be a permission issue.
Cheers,
Vıkram.
Be yourself, no matter what they say.
- Sting, Englishman in New York.
|
|
|
|
|
are you certain that your code is referencing the resource correctly?
Oederu wrote: I write the "FilePath + FileName" to a file and use that in Windows Explorer and I can successfully open the file
That tells you that it's not a permissions issue
Here's a snippet from one of my current projects to show one way of handling this:
this.serverPath = @"\\"+serverUtility.OptimalServer.alias + serverUtility.OptimalServer.directoryPath;
Notice the '@' character. That is a special character that specifies that you are entering a verbatim string literal.
The '\' character usually triggers an escape sequence, but with the @ character in front of it, it is treated as any other character. This technique probably won't work for you though, because your '\'s are embedded inside your strings. You probably are going to want to do a string replace on the '\' to make it '\\' . That will specify that you are triggering an escape sequence and wanting to type a '\'
-- modified at 16:02 Wednesday 29th August, 2007
[Note] The "\\" included in my snippet is NOT the same "\\" that you will have to use. My "\\" indicates that I'm wanting to access an external resource(which works with the '@'). YOUR "\\" (without the @) will handle your first slash as an escape initiation and the second slash as a print
"I need build Skynet. Plz send code"
|
|
|
|
|
Are doing this in Vista?
I noticed that mapped drives in vista don't work with direct access via driver letter. I had to have the program resolve the full path
your example: @"\\192.168.253.12\images$\" you have to resolve their path that (like Alaric_ said)
-Spacix
All your skynet questions[^] belong to solved
|
|
|
|
|
Thank you for all your help. It turned out to be a permissions problem.
The user under which the application runs does not have the permission but I had. So with explorer I would be able to open the file but the programs user would not get access. Thanks for all the help.
|
|
|
|
|
I'm trying to read in and decrypt some encrypted data that is written to a file by an outside program. The program uses a form of rijndael encryption to encrypt the file. It uses a key, and I have the key, but I don't think it uses an initialization vector ..
this is what it uses:
// key - The 128/192/256-bit user-key to use.
// chain - initial chain block for CBC and CFB modes.
// keylength - 16, 24 or 32 bytes
// blockSize - The block size in bytes of this Rijndael (16, 24 or 32 bytes).
I'm not real solid on how Rijndael encryption works, obviously, so if anyone could help steer me in the right direction, that would help.
|
|
|
|
|
Rijndael is just another name for AES encryption(as it was the technique chosen for the standard). I would start by reading up on AES. ...Start with the sci.crypt newsgroup
"I need build Skynet. Plz send code"
|
|
|
|
|
|
Dear All,
The standard utility for creating Deployments.
I want my installation utility to be intelligent enough to install WebSites, Web Services and Files.
Next I need a few .exe to run during the setup.
Please Help!!
Thank you!
"Mess with the Best, Die like the rest"
|
|
|
|
|
|
I put an attribute declaration on the top of a private object (in my case, a method). Yet I find out no attributes added to this method. Then, I change the method to a public one and it works. Is it true that "custom attributes cannot be applied to a private object"? Or, I did anything wrong? Please advice me if there's a way to walk throu. Many thanks in advance.
CY
|
|
|
|
|
Did it find the method? I suspect that it hasn't found the method because the binding flags haven't included the BindingFlags.NonPublic flag. The following code finds a custom attribute on a private member with no problem.
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace SimpleTestApp
{
class Program
{
static void Main(string[] args)
{
BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
MethodInfo mi = typeof(Program).GetMethod("MyMethod", flags);
Attribute[] att = (Attribute[])mi.GetCustomAttributes(typeof(MyAttribute), true);
if (att != null)
{
}
}
[MyAttribute("Hello")]
private void MyMethod()
{
}
}
public class MyAttribute : Attribute
{
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
public MyAttribute(string name)
: base()
{
_name = name;
}
}
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Did it find the method? I suspect that it hasn't found the method because the binding flags haven't included the BindingFlags.NonPublic flag. The following code finds a custom attribute on a private member with no problem.
Yes, you're right. That's not the problem of attribute. The method wasn't found instead. Thanks a lot for your advice.
CY
|
|
|
|
|
Does anybody know the specifics of "Simplified menu options and defaults"?
The version comparison Microsoft publishes on Studio 2005 doesn't go into any detail on this that I could find. Is anybody familiar enough with Professional and Standard editions to know what differences "Simplified menu options and defaults" entails?
I'm looking at finally buying a copy , and this is the only thing I'm concerned with between them. I think Standard is good enough for me, but I'm not sure on this one point.
|
|
|
|
|
Hi Everyone,
Thanks for taking the time to read my question!
I have an old unmanaged DLL that will handle all of the low level bootloader communications to a device on the serial port, however most of the functions in the DLL require a handle to the serial port. I also want to communicate with the device on the serial port using another protocol first (to put the device into bootloader mode) and this would be easiest done using some command classes that have already been written for another project using the System.IO.Ports.SerialPort class. Does anybody know of any fancy footwork that will allow me to begin using the serial port with the SerialPort class and then obtain a corresponding handle and pass that into the DLL calls?
I'm definately not an expert in this area - it's been enough just looking into marshalling to use the unmanaged DLL, but I'm really stuck on this problem.
Any help is greatly appreciated!
Chris Chambers.
|
|
|
|