Convert objective C code to C# [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i came across some Objective C code as follows
-(void)sChart:(ShinobiChart *)chart alterLabel:(UILabel *)label forDatapoint: (SChartDataPoint *)datapoint atSliceIndex:(int)index inRadialSeries:(SChartRadialSeries*)series// End
I want to convert it to C# for use in Xamarin. I havent been able to try as I dont know any objective C.
What would be the equivalent C# code?
thanks in advance.

You can't just grab and use an Objective-C library with Xamarin/C#. To use 3rd party native Objective-C code with Xamarin, you need to have bindings available for that library or you need to create bindings by yourself.
When creating binding you have luxury to decide how your C# equivalent code is going to look like. Though it should resemble original Objective-C library as much as possible while keeping in mind C# coding conventions and best practices.
Here is more info about creating Xamarin bindings for an Objective-C library.
http://docs.xamarin.com/guides/ios/advanced_topics/binding_objective-c/binding_objc_libs/

Related

How to use native c++ template class in c++/cli [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a native c++ dll which contains some templates classes. And I need this dll in my c# code.
So I am using managed c++ for the c++ dll in order to use it in the c# code, but I have a big problem on how using the template classes in .Net.
Please if you guys have some solutions to this, it will very helpful.
Thanks!
read C++ instantiate template class from DLL to make sure you're not falling down a common rabbit hole.
Read about IntPtr and Interoperability
Try putting it all together, and then post a new question which has a specific problem.

Best practice for creating a C++ Dll to be marshalled in C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have to write a C++ Dll to wrap an existing C++ Dll so it can be declared in C# because the existing C++ API is just too complicated (functions returning pointers to unions within structs within structs). Is there any best practice for this? For instance:
What's the best way of declaring a string from C++ to C#?
Is it better to have C++ functions using pointers or references?
It depends on how many functions you wish to export and if you wish to export them only to c#.
If you answer yes to one of these then I recommend using swig as functions will get generated for you automatically
Here is a link
http://www.swig.org/tutorial.html

How does one implement a c++ wrapper into C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am working on a project where I need to use a wrapper written in C++ to transfer messages across servers through c# code. The client applications are written in c#, but the message bus that I have to use doesn't work directly with .NET, so C++ wrapper to the rescue.
I hope that this makes sense, and any help would be great. Thanks
You can call C++ contained in a dll from C# using Platform Invoke. http://msdn.microsoft.com/en-us/library/aa288468%28v=vs.71%29.aspx. In this case it is actually the C# code wrapping the C++ code.

Is there anything that I can do with Perl/Python but C# would not do? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have done some development in C# and I love the language and the environment. I am taking a Perl class, and yes it sounds like easy learning curve, but there are some questions which I think need to be asked essentially as a server-side developer.
So far, if I want to create a stripped-down program which runs on a Windows machine then I can create a console application. C# + .NET are good enough that I can achieve most of the functionality.
Now, when scripting languages come into picture, I agree that they are easy to use and easy to write. The languages have super-rich functional libraries. But is is just a choice that we make to use a scripting language as opposed to a fully-fledged framework like .NET? Or are there some things that only scripting languages can do, and would be very difficult to achieve from languages like C# and Java?
C# is Turing-complete, so the answer to your question is "no".
.NET has nothing to do with your question; other languages have their own "full fledged framework"s (or more than one).

How to create a browser plug-in using C#? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
how to create a browser plug in using C#? (something like Flash Player or Unity3d)
This cannot be done using C# only.
WebKit is C++-based, so you'd need at least a C++ wrapper in order to let the browser communicate with your code. Using a mixed-mode C++ DLL that talks to WebKit on one side and to your C# code on the other side should be considered.
The WebKit site does not contain much docs (don't want to criticize, but I couldn't find much there when working with Chromium). Only Apple docs explain plug-ins, but it looks very Apple-oriented. Sorry, not very helpful.

Categories

Resources