(Machine translation)
Hi
When I mix a source file of cobra with source file of C# and compile it,
is a class of C# an unseen class from cobra class?
e.g. partial class.
Forums
Is C# class unseen?
8 posts
• Page 1 of 1
Re: Is C# class unseen?
Correct, Cobra cannot see C#, but you can make Cobra see it like this:
Now Cobra "knows" what's in "MySharpClass". I haven't yet tried combining "fake" and "partial". Let me know how it goes!
- Code: Select all
// MySharpClass.cs
class MySharpClass {
public string Foo(int i) {
// ...
}
}
class MySharpClass
is fake
def foo(i as int) as String
pass
# ...
Now Cobra "knows" what's in "MySharpClass". I haven't yet tried combining "fake" and "partial". Let me know how it goes!
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Is C# class unseen?
if my method is not clumsy...
A fake class seems to pursue all the main bodies in the C# class.
Therefore, "fake" and "partial" are not compatible ?
A fake class seems to pursue all the main bodies in the C# class.
Therefore, "fake" and "partial" are not compatible ?
- arisawa
- Posts: 51
Re: Is C# class unseen?
Yes, I tried "fake" and "partial" together this morning and they aren't compatible.
Can you get by with a non-partial class? Also, what kind of code would you write in C#? Can it be written in Cobra?
Can you get by with a non-partial class? Also, what kind of code would you write in C#? Can it be written in Cobra?
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Is C# class unseen?
Thank you, I am not troubled right now.
It is corner-cutting to want to do me.
Visual Studio(or Mono Develop) designer generated Form class is partial.
I think so easy, form design.
If that class apply in my cobra project.
It is corner-cutting to want to do me.
Visual Studio(or Mono Develop) designer generated Form class is partial.
I think so easy, form design.
If that class apply in my cobra project.
- arisawa
- Posts: 51
Re: Is C# class unseen?
To connect the C# to the Cobra, some ideas come to mind:
-- Perhaps the Visual Studio or Mono project could produce a DLL instead of an EXE. Then a Cobra program could reference it and use it. Make the C# methods virtual. Then in Cobra make a subclass and override that method. When creating the form, instantiate the Cobra class, not the C# class.
-- Make a DLL with Cobra that contains your application logic. Have your C# program reference the Cobra-based DLL. Have your C# forms instantiate the Cobra helper classes and invoke methods on them as needed. This might get awkward if you need to pass in numerous references to controls.
-- Write a Cobra plugin for one of the IDEs.
-- Perhaps the Visual Studio or Mono project could produce a DLL instead of an EXE. Then a Cobra program could reference it and use it. Make the C# methods virtual. Then in Cobra make a subclass and override that method. When creating the form, instantiate the Cobra class, not the C# class.
-- Make a DLL with Cobra that contains your application logic. Have your C# program reference the Cobra-based DLL. Have your C# forms instantiate the Cobra helper classes and invoke methods on them as needed. This might get awkward if you need to pass in numerous references to controls.
-- Write a Cobra plugin for one of the IDEs.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Is C# class unseen?
Thank you.
Two first ideas served as a good reference.
The one of the remainder is the most amazing, but it look like to be McKinley for me.
Squeeze an else idea.
1) Do you know Glade3?
Glade3 does a design output XML.
I tried it many times, but did not get along well.
(This may be a thing by my failure.The connection of the signature did not go well.)
2) Useing WPF which new Windows has.
But this idea became out of control.
Two first ideas served as a good reference.
The one of the remainder is the most amazing, but it look like to be McKinley for me.
Squeeze an else idea.
1) Do you know Glade3?
Glade3 does a design output XML.
I tried it many times, but did not get along well.
(This may be a thing by my failure.The connection of the signature did not go well.)
2) Useing WPF which new Windows has.
But this idea became out of control.
- arisawa
- Posts: 51
Re: Is C# class unseen?
I've seen Glade. So a possibility is to read Glade files or to build something like it for Cobra and .NET.
Another possibility is to code the GUI yourself without using a designer. This approach is described in Programming Microsoft Windows Forms.
Also, see WinForms How To and ObjectExplorer-WinForms.cobra.
Another possibility is to code the GUI yourself without using a designer. This approach is described in Programming Microsoft Windows Forms.
Also, see WinForms How To and ObjectExplorer-WinForms.cobra.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 83 guests