Control & System.Design

  • Thread starter Thread starter wavemill
  • Start date Start date
W

wavemill

Hello!

I have created a control and i would have add filename:

[Editor(typeof(FileNameEditor), typeof(UITypeEditor)),Description("The
file name"),Category("Data")]
public string _fileName;
public string FileName
{
get {
return _fileName;
}

set {
_fileName = value;
}

}

The FileNameEditor is impossible because i can't have the System.Design.

Did you know how can i do?

Best regards,

Wavemill
 
Hello!

Thank you for your answer!

I have try this without success:
Description("The file name")
Category("Data")
Editor("typeof("System.Windows.Forms.Design.FileNameEditor")","
typeof("System.Drawing.Design.UITypeEditor")")

If you have any idea!

Thank you,

Wavemill
 
Try this. Note that everything after "Editor" should be on the same line.

Category("Data")
Description("The file name.")
Editor("System.Windows.Forms.Design.FileNameEditor, System.Design,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a","System.Drawing.Design.UITypeEditor,
System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a")
 
Hello!

I have try this, i have no error , but it's always the same thing.

It's very easy to do this!

if you have an other idea!

wavemill
 
What is happening? What is your control project type (Windows CE, Pocket PC,
Smartphone)? This type must be the same as the application type. If you look
in the control project you'll see a file with an xmta extension. VS builds a
metadata assembly using this file during the build process. If you look in
the control project output directory, on your dev machine, you should see at
least two assemblies - one for the control and another that has "asmmeta" in
the name. This assembly should also have the project type in the name as
well. The metadata assembly is loaded based on the application type. So if
you built the control as a Pocket PC project, then you'll need to test the
control in a Pocket PC application project otherwise the proper metadata
will not be found, and it's in the metadata that you have indicated that
you'd like the FileNameEditor to be used with the FileName property.
 
Hello!

Thank you for your help, in my last post i've wanted write "It's not
very easy to do this!" and not "It's very easy to do this!"

My project control is for Pocket PC
I have a solution with 2 project, my control and an other to test my
control.
In a bin directory of my i have the two file
-ButtonControl.dll
-ButtonControl.PocketPC.asmmeta.dll

When i add in custom attibutes filename there is not error.

After, when i see in the designer the property, filename is not an
editor.

A great thanks for your help,

Wavemill
 
Hello!

Now it's ok.
When i add in custom attributes "editor....", i had multiline, with few
line with error.
now it's ok:
<Property Name="FileName">
<Category>Data</Category>
<Description>The file name.</Description>
<Editor>
<Type>System.Windows.Forms.Design.FileNameEditor,
System.Design,Version=2.0.0.0,
Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a</Type>
<BaseType>System.Drawing.Design.UITypeEditor,System.Drawing,
Version=2.0.0.0,
Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a</BaseType>
</Editor>
</Property>

Thank you very much for your help and patience!

Wavemill
 
Back
Top