|
You are right, sorry.......
|
|
|
|
|
I've created a program that does all the parsing that I want and need in c#. the parsed information is bassically a bunch of xy coordanates and some other information. What i need to do next is take that information and create an animation for a robot simulator. Now someone mentioned to me flash would be the easiest and have the smoothiest animations, much smoother then c# can offer for sure. I tend to agree. Now Im not sure how I would integrate the two programs, c# parsing, flash animating. Now that same person who suggested flash also suggested i abandon c# and start using a program called autoit as it has a very simple function that allows autoit and flash to communicate. Ive taken a look at autoit and so far just cant seem to get much out it. Very frustrating as I have a working program already and keep looking back at c#.
Now what Im asking is any opinions on my situation? Is there any easy way to pass information from c# to flash or is autoit worth the time learning?
|
|
|
|
|
You may use Windows Presentation Foundation (WPF) instead of Flash, and you can use your C# code in WPF application.
Calin
|
|
|
|
|
where would you put the skill level required to get a WPF app up and running?
|
|
|
|
|
It's not all that bad if you have something like ASP.NET programming in your background where you have some XML that dictates the look-and-feel of your application and some code in a "code-behind" class that controls the app.
You can find information at this site: WindowsClient.net[^].
Of course, if you have access to a Sam's Teach Yourself WPF in 24 Hours kind of book, that might make more sense in bringing you up to speed on the philosophy behind the design of WPF.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi
as u know, in Visual Studio DataSet Designer, each column of table is a DataColumn object and DataColumn object has a property named Caption. when i change this property of columns in dataSet designer and bind my datagridview.DataSource to that DataTable object, it does not display Caption text in DataGridView.Column.HeaderText (it display Name property from DataColumn object), wheras i want to display it's Caption.
my problem is that, is there any way to map DataGridView.Column.HeaderText to DataColumn.Caption property automatically ?
Thanks
|
|
|
|
|
Hello All,
I have a particular problem that I am hoping someone can give me a better way of acheiving something.
I have a web page with some predefined search options. I want to give the user a way to create an adHoc search that could have up to 5 elements for the criteria.
So I thought of associating a numeric or alpha character to each element and then do check for a pattern on the postback. This option is becoming cumbersome and I know there has got to be a better way of doing this.
Any suggestions would be greatly appreciated. For those who don't answer, have a great day.
Fred
|
|
|
|
|
|
I did create 5 fields but what if the user doesn't want to utilize all the fields. For example they might want to use "Create Date" and "User". Another user might want to search by "Status", "User" and "Create Date".
|
|
|
|
|
Then what is the problem. Pass the parameters to your stored procedure if they are provided, null if not, and then use the appropriate where clause to restrict the results. If you aren't using a database, LINQ will do the same thing in its where clause.
|
|
|
|
|
Sorry to have been a bother. I just wasn't thinking for some reason. Thanks!
|
|
|
|
|
This may sound dumb but I will try anyway. I am trying to pass a delegate with variable parameters (params object[] {"1", "2"}) as a parameter to another delegate. What I am trying is below but it won't compile:
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
TestManager tManager = new TestManager();
int iRet = tManager.TestMethod1(tManager.TestMethod5 (new List<string> {"2", "1"} ));
Console.WriteLine("Result: " + iRet.ToString());
Console.ReadLine();
}
}
}
namespace ConsoleApplication1
{
delegate object TestDelegate (params object[] list);
delegate object ContaineOne (TestDelegate test);
class TestManager
{
public int TestMethod1(ContaineOne TestMethod3)
{
TestDelegate td = new TestDelegate();
td = TestMethod3.Method;
int iRet = (1 + td(list));
return iRet;
}
public int TestMethod5(params object[] list)
{
return Convert.ToInt32(list["zero"]);
}
}
}
</string>
Anyway, if you think I am an dumb and this can't be done please let me know.
Thanks,
Steve
|
|
|
|
|
Note: I know the code is incorrect, wrong type of parameters, etc. but you get the main Idea. I hope.
|
|
|
|
|
This is how it is done:
using System;
namespace ConsoleApplication1
{
public class Program
{
public delegate int OuterDelegate(object[] o);
public delegate int InnerDelegate(object[] o);
public int MyMethod(object[] o)
{
int t = 0;
foreach (object io in o)
{
t += (int)io;
}
return t;
}
static void Main(string[] args)
{
Program p = new Program();
InnerDelegate oInnerDelegate = new InnerDelegate(p.MyMethod);
OuterDelegate oOuterDelegate = new OuterDelegate(oInnerDelegate);
int i = oOuterDelegate(new object[] { 1, 2, 3, 4 });
Console.WriteLine(i.ToString());
Console.WriteLine("done");
Console.Read();
}
}
}
Now, the question I still have is how could I change the OuterDelegate to execute some code on what was returned from the InnerDelegate?
Thanks,
Steve
modified on Thursday, February 26, 2009 2:34 PM
|
|
|
|
|
Hi,
Steve Holdorf wrote: Now, the question I still have is how could I change the OuterDelegate to execute some code on what was returned from the InnerDelegate?
You could restructure slightly and write a method that invokes two delegates sequentially. I can't see any way out of passing all the arguments required for the first delegate as arguments to the invoker.
Also the invoker would need code to format or translate the first delegate's output into something the second can accept.
delegate int D1(params int[] list);
delegate void D2(int p);
class DeliDelegate {
internal void Run(){
InvokeBoth(ShowInt, Sum, 1, 2, 3, 4, 5);
InvokeBothAndSome(ShowInt, Sum, 1, 2, 3, 4, 5);
}
void InvokeBoth(D2 outer, D1 inner, params int[] p) {
outer(inner(p));
}
void InvokeBothAndSome(D2 outer, D1 inner, params int[] p) {
int res = inner(p);
res = res * 6;
outer(res);
}
int Sum(params int[] i) {
int result = 0;
foreach (int j in i) {
result += j;
}
return result;
}
void ShowInt(int i) {
Console.WriteLine("Value is {0}", i);
}
}
|
|
|
|
|
Thanks Man! You made my day a lot better.
Steve
|
|
|
|
|
 Finished code:
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
TestManager tManager = new TestManager();
Console.WriteLine("ProcessRequest1");
tManager.Run1();
Console.WriteLine("ProcessRequest2, returned value is: " + tManager.Run2());
Console.ReadLine();
}
}
}
namespace ConsoleApplication1
{
delegate object OuterDelegate (int p);
delegate object InnerDelegate (params string[] list);
class TestManager
{
public int ProcessRequest1(OuterDelegate DoSomethingWithResults, InnerDelegate GetData, params string[] sParams)
{
int iRet = Convert.ToInt32(GetData(sParams));
iRet += 1;
return Convert.ToInt32(DoSomethingWithResults(iRet));
}
public string DoSomethingWithResults(int i)
{
i += 4;
return i.ToString();
}
public string DoNothingWithResults(int i)
{
return i.ToString();
}
public object GetData(params string[] list)
{
int iReturn;
iReturn = (Convert.ToInt32(list.GetValue(0))) + (Convert.ToInt32(list.GetValue(1)));
return iReturn;
}
public int ProcessRequest2(OuterDelegate DoNothingWithResults, InnerDelegate GetData, params string[] sParams)
{
int iRet = Convert.ToInt32(GetData(sParams));
return iRet;
}
internal void Run1()
{
string [] sArray = { "1", "2" };
Console.WriteLine("Not returning anything, results: " + ProcessRequest1(DoSomethingWithResults, GetData, sArray));
}
internal string Run2()
{
string[] sArray = { "4", "5" };
return Convert.ToString(ProcessRequest2(DoNothingWithResults, GetData, sArray));
}
}
}
|
|
|
|
|
Delegates are not used to pass parameters. You are trying to pass parameters to the delegate, ie the result of the method, and the delegate at the same time which would not be correct.
I don't think you are dumb but I think your approach is flawed.
|
|
|
|
|
|
Hi,
the params keyword tells the compiler it should collect the remaining arguments and turn them into an object array; yes, you can use params with a delegate; here is an example:
delegate void TestDelegate(params object[] list);
event TestDelegate aha;
public override void Test(int arg) {
aha+=new TestDelegate(showArgCount);
aha.Invoke(1);
aha.Invoke(1, 2, 3, 4);
}
public void showArgCount(object[] args) {
log("showArgCount: "+args.Length);
}
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:41 AM
|
|
|
|
|
Thank you for your help and I will try to have it more together on my next question. Please understand that my boss is asking me to do something very difficult and pushing me to get it done. I am under a lot of pressure and I did spend a lot of time doing research without luck. It has been a tough morning. The bottom line is that I am sorry for the question.
Steve
|
|
|
|
|
You're welcome.
And I saw nothing wrong with your question.(if I did, I would have told you!)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hi friends am using usercontrol as drawing area to draw graphics...so now i want to apply zoom factor to usercontrol(not to image)...plzzzzzz help me..
txs in advance...
|
|
|
|
|
usercontrol zoom? Basically this will increase/decrease the size of the control?
why do you want to do that? what controls is your usercontrol containing?
you cannot apply zoom transformations on controls, at least in standard windows applications.
You may use a workaround, to apply a zoom factor to the size/location of each children controls.
Calin
modified on Thursday, February 26, 2009 11:31 AM
|
|
|
|
|
iam drawing shapes using graphics..so i want to apply zoomfactor to dt usercontrol...
|
|
|
|