|
What I don't understand is that by not overriding GetStandardValuesSupported and GetStandardValues I suspect the base class to take care of them.
Why doesn't the base class make PropertyGrid show a drop down list while without applying my derived class at all it works?
Ciao,
luker
|
|
|
|
|
lukeer wrote: What I don't understand is that by not overriding GetStandardValuesSupported and GetStandardValues I suspect the base class to take care of them.
If you want a dropdownlist, you'll need to override them. Check the example on the MSDN-page that I linked.
lukeer wrote: Why doesn't the base class make PropertyGrid show a drop down list while without applying my derived class at all it works?
Because a property-grid is intelligent, and it knows that it should use an EnumConverter[^] if nothing is provided
I are Troll
|
|
|
|
|
Thanks a lot.
With overriding the following 6 methods
GetStandardValuesSupported()<br />
GetStandardValues()<br />
CanConvertFrom()<br />
ConvertFrom()<br />
CanConvertTo()<br />
ConvertTo()
everything works as expected.
Ciao,
luker
|
|
|
|
|
Folks
Engaging in a project as a newbie in soundscan, encountered problems while implementing this simple piece of code. It's my appreciation if you lead me through this dense un-documented forest by microsoft !!
P.S.1 : Please introduce me a cook-book or any useful tutorial or documentation in directsound what i couldn't find it anywhere!!!
P.S.2:You can also find the code here:http://www.4shared.com/get/j0J8g6wA/SSM-VBNET-DirectSound.html[^]
Tnx .
#Region "References"
Imports Microsoft.DirectX
Imports Microsoft.DirectX.DirectSound
Imports System.Threading
#End Region
Friend Class frm_main
...
#Region "Command Button"
Private Sub cmd_capture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_capture.Click
Try
If Not devices_waveformat() Then Return
DSBuffer.Start(False)
Thread.Sleep((DSSamples / DSFrequency) * 1000)
'Containing Input Data
Dim DSArray As Array = DSBuffer.Read(0, Type.GetType("Integer"), LockFlag.FromWriteCursor, DSFormatArray)
DSBuffer.Stop()
Catch ex As Exception
Debug.WriteLine(ex.Message)
Debug.WriteLine(ex.ToString)
End Try
End Sub
#End Region
...
End Class
|
|
|
|
|
A quick internet search for this gave me over 25,000 hits.
If you cannot find anything in that lot to help you, how on earth do you expect anyone here to be able to?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Hello everyone.
Sorry for my english but it isn't my first language. I'm goint to try to explain the best as i can.
My Problem is:
I'm building a project using entity framework. The data base is generate by a edmx(database project). To implement business logic i use stored procedures, but i only con map the to parent entity funcions. I can't map stored procedures to an associated table.
Thanks
|
|
|
|
|
You might stand more chance of getting an answer if you ask this in the Database Forum[^].
If you do, point out that you have asked it here already but are asking there because I suggested that you should. (Otherwise someone might shout at you. )
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
|
I am trying to add the Application version (not the Installer version) to the
Welcome box using CustomActionData in VB.NET to create a variable in a field
such as /MY_CA="[MyCustomVersion]", but need to know how to extract and display
such a value at install time, ie where would the following line go?
Context.Properties.Item("MY_CA") = "Version 4002"
in order to populate the first line in the Welcome text property such as
"...will guide you through the installation of[ProductName] [MyCustomVersion]"
|
|
|
|
|
There is a debate going on at work right now. Basically we are going to be creating some new tier objects; for the sake of simplicity, just assume basic stuff like a business tier, data tier, etc). The business tier will have objects like a Orders object (that will return order info) a customer object (that will return customers), etc, etc.
Is it typical for someone to want to create tier objects as an executable vs. using .dlls? What would be the pros to using an executable in a tier instead of a .dll?
Also, can you pass back collections, datasets, etc from an .exe to another .exe? Admittedly, I've never tried.
The proposed architecture:
Client.exe
would call a tierobject.exe
would call a datalayer.dll
I can think of many reasons why I would think doing this would be a bad idea, but I am also trying to remain open-minded.
Thanks for any insights to the gurus out here.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Your business model objects will be in a separate project. As an stand alone exe, it will have nothing to offer. No Main method, no UI etc. I see no point in making it an exe.
Jon_Boy wrote: Also, can you pass back collections, datasets, etc from an .exe to another .exe? Admittedly, I've never tried
Yes. If they are public or are returned by some public method yes. You will just need to add reference to that exe in calling project.
|
|
|
|
|
With .NET, you can use an EXE just like a DLL... So there's nothing stopping you from doing it this way.
Of course, there doesn't seem to be much of a point to it, in your situation.
I actually did something like that, but my situation was a bit different... It went something like this:
ScriptingInterface.exe
Application.exe
BusinessLayer.dll
...
For normal use, you would just run the Application.exe... But there were certain tasks, intended to run once a day or in special situations, that were located in the Application.exe (Though they mostly wrapped routines and models from the business layers). Initially, they were being triggered from menu options, but eventually we wanted to automate them by hooking them up to a scheduler...
So basically, the ScriptingInterface.exe would reference Application.exe, and use command line arguments to perform one of those menu-driven tasks, without actually opening up the GUI.
C:\> ScriptingInterface.exe Maintenance DailyRoutines RunSomething
translated to...
namespace My.Namespace.Maintenance
{
public static class DailyRoutines
{
public static void RunSomething()
{
}
}
}
So, there are scenarios where you might want to use an EXE like a library, but for a business layer? Probably no point.
|
|
|
|
|
Agreed with the comments above. Just wanted to get a feel for if I was way off base.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
The only point i can see of making the different layers into exe's is if they're running as a service and you want to have one point (bottleneck?) of entry. This would naturally be the case if the client resides on one box while the server (tierobject) resides on another. That doesn't mean there won't be dlls involved for the interfaces between the layers though.
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
Hi ! Firest, sorry for my bad english.
I try to create a simple 2D graph scene for learning purpose. A very great article from Bob Powel
(http://www.bobpowell.net/graphicsstack.aspx) who gave me a bese to start.
So, I understand that to draw an "objects chain" (like bones chain), I must start with an identity matrix and rotate/translate it with the local transform of the bone to draw. At the end of a chain, I reset my "drawing matrix" and I can draw others bones chains.
So, the Bone class only store a local matrix and the drawing method of my Renderer control only use this local transform to draw an object relatively from its parent.
All is good. I can modify and read the local translation or rotation for each bone easilly.
Now, my problem is, I want to be able to read/modify the absolute position or rotation of a nested object. The reason is simple.
Imagine I have a root bone with one child. The root bone have an absolute position (10, 10) and an absolute rotation of 45°. The child bone has a local translation of (30, 0) and a rotation of 45°. We can easilly say that this child bone has an absolute rotation of 90°. I can easilly compute the absolute transform from the local one.
So now I can get/set local transform and get absolute transform, but I can't find a way to set the absolute transform.
I understand I must translate an absolute matrix to a local matrix, but what could be the pseudo code or steps to achieve this ?
|
|
|
|
|
Are you aware of the Graphics.Transform property? and the Graphics.ResetTransform() method?
I'm not sure what your code organization is, I don't think I would need any of those when painting a hierarchical object: the root of the drawing should just get the original Graphic from the PaintEventArgs parameter, then adapt and pass on to its children, each of them undoing their transformation change when they are done.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Yes, I know Graphics.Transform / ResetTransform and Save / Restore
This is a pseudo code for my main drawing function ...
Private Sub MainDrawing
For each bone in bones list (bone class inherits TreeNode.)
-Save the Graphics tranform (Graphics.Save)
-Call a recursive function (DrawBonesRecursively)
->DrawBonesRecursively(e.Graphics, bone)
-Restore the original Graphics tranform (Graphics.Restore)
End For
End Sub
Private Sub DrawBonesRecursively(g as Graphics,bone as Bone)
-Get the LOCAL matrix of the bone
-Rotate and Translate Graphics transform with LOCAL matrix values
-Get the untransformed GraphicsPath of my bone
-Draw it
For each childBone in bone.Nodes
-Call this sub itself for recursion. For "bone" argument, I pass "bone.
End For
End Sub
My drawing function only need the local coordinates of each bone. So, I can get/set easilly the LOCAL transform, and I'm only able to compute the absolute transform and read it, but if I want to set it with absolute values, I must convert it with local values to make my function drawing.
Do you understand my problem ? Sorry I'm not very comfortable with the kind of explanations in english
|
|
|
|
|
The transformations you get from ScaleTransform and the like are cumulative, so child bones get their parent's matrix automatically; you do need to add an undo, so just before End Sub insert
Undo Rotate and Translate Graphics transform with LOCAL matrix values
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Question:
My company has recently bought some fancy usercontrols on the net.
These controls can do a lot, but some of them require databinding.
This is something I am not familiar with and neither is my company.
I am quite convinced of the advantages of databinding, but not when it's done in the designer. The designer generates a lot of code, both in VB and SQL and puts lots of items in your toolbox and componentstray. Bottomline is that I have no idea what I'm doing in the designer. But this is also because I'm not familiar with creating datasets in the designer.
So what do you say? Should I just keep on trying and make my dataset, tables and binds in the designer or is programming the whole thing easier/more scalable/better maintainable etc.? What are the pro's and cons, code vs. designer.
|
|
|
|
|
IMHO, using the designer limits your options and creates a ton of "mystery" code that goes in places you're not aware of.
I never use the designers for datasets. I prefer to write my own code for simplicity and maintainability.
BTW: Databind is done all the time without using the deisgners. When you set a DataSource property to some collection or DataTable or DataSet, you're doing databinding. I can't believe nobody in your company knows about this.
|
|
|
|
|
We never use the datasource property.
We always fill every cell in a datagrid or every textbox on a form programatically.
There's a bit more to it than that, and there's some benefits to it.
But let's just say we really never use databinding
Databinding has always been a kind of taboo. Until now.
And the more I do with it (design-time), the more it becomes taboo for me again
|
|
|
|
|
If/when I use datagrids I make them readonly, and bind(set the datasource) to a
list/array/collection of something. And edit/modify the data through dedicated popup windows/user controls.
All the best,
Dan
|
|
|
|
|
Naerling wrote: We always fill every cell in a datagrid or every textbox on a form programatically
Wow. Talk about a ton of code that's slow to fill a grid and could all be replaced with a single assignment statement.
|
|
|
|
|
Sorry for the long answer but here goes.
If you ask me don't use design time databing, hell even better(or worse depends on taste) don't
use datasets/datatables.
I had some experinces with datagrids and automated vodoo magic that were very unpleasant. I
just didn't have a clue at was the error was.
Since then I always create classes or structs/enumns depends on the job ata hand.
Anywho I always create classes that map the tables and/or business model and use
Datareaders to get the datas in those customized object models. It takes a little longer to code
but the benefits of debugging itself not to mention maintanability/scalability...
are totally worth it.
- You are in control.
- You tell it(the app/progra) what to do. Not some vodoo magic and pray to god it all goes well.
Maybe I'm beeing a little extreme but I wouldn't use for anything in the world in a real world app.
Sure some quick and dirty tests and the likes, yeah go ahead saves time. But real world apps NO.
Just my thoughts.
All the best,
Dan
|
|
|
|
|
I was kind of thinking the same thing. But I do want to give datatables/sets a try.
We are now working with lots of classes and properties.
But it's a lot of work, especially if you have some master detail stuff.
Actually we're all kind of tired of having to type:
Textbox1.Text = datarow("field1")
Textbox2.Text = datarow("field2")
Textbox3.Text = datarow("field3")
...
Textbox50.Text = datarow("field50")
You get the idea
|
|
|
|