Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Mac OS X: convert C#.NET into Obj-C

PawarPawar Posts: 2New Users Noob
Hi... As i new in this platform.. i need your help...
I want to convert following C# code to Objective-C.

namespace IXyzReader
{

public class IXyzReaderFactory
{

#region Member Variables


private static IXyzReaderClass ObjXyzReaderClass;

// This variable is used as a lock for thread safety

private static object lockObject = new object();

private static log4net.ILog ObjLogger = log4net.LogManager.GetLogger("");

#endregion


public static IXyzReaderClass GetXyzReader(String AssemblyPath)
{
try
{

if (ObjXyzReaderClass == null)
{

if (String.IsNullOrEmpty(AssemblyPath))
{
ObjLogger.Error("IXyzReaderClass Class -> GetXyzReader :: AssemblyPath is null ");
return null;
}


Assembly assembly = Assembly.LoadFrom(AssemblyPath);

System.Type[] objTypes = assembly.GetTypes();

Type libType = null;


foreach (Type objType in objTypes)
{
if (objType.BaseType.Name == "IXyzReaderClass")
{
libType = objType;

break;
}
}
lock (lockObject)
{
ObjXyzReaderClass = (IXyzReaderClass)Activator.CreateInstance(libType);

}

if (ObjXyzReaderClass == null)
{
ObjLogger.Error("IXyzReaderClass Class -> GetXyzReader :: Unable to
instantiate IXyzReader class ");
return null;
}

}
}
catch (Exception ex)
{
ObjLogger.Error("IXyzReaderClass Class -> GetXyzReader :: " + ex.Message);
ObjLogger.Error("Stack Strace :: " + ex.StackTrace);

}
return ObjXyzReaderClass;

}

}
}


and also...

public delegate void XyzFound(XyzDetails ObjXyzDetails);
public event XyzFound eventXyzFound;


Thanks in advance...

Replies

  • givensurgivensur On the Information SuperhighwayPosts: 541Registered Users @ @ @
    You want somebody to just rewrite that for you for free?

    And you didn't even bother to use code tags to make it readable?

    Maybe you should check out the Help Wanted forum for your needs, and hire somebody to rewrite it for you.
    I make cake apps.
  • htappshtapps Posts: 105New Users @ @
    Just try out monotouch and see if that works, could save you a lot of time
Sign In or Register to comment.