Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

help me to Transfer VB.NET code from C# Code

1 REPLY 1
Reply
Message 1 of 2
Anonymous
313 Views, 1 Reply

help me to Transfer VB.NET code from C# Code

Hi

i am developing a revit plugin using VB.NET 2012. i have a code in C#, i don't program C#, i am I am newbie in programming. I need transfer this C# method to VB.NET. somebody help me?, this is the C# code 

 

 protected override void ApplySortCore(PropertyDescriptor prop, ListSortDirection direction)
        {
            List<T> itemsList = this.Items as List<T>;
            itemsList.Sort(delegate(T t1, T t2)
            {
                this.propertyDescriptor = prop;
                this.listSortDirection = direction;
                this.isSorted = true;

                int reverse = (direction == ListSortDirection.Ascending) ? 1 : -1;

                object value1 = prop.GetValue(t1);
                object value2 = prop.GetValue(t2);

                return reverse * Comparer.Default.Compare(value1, value2);
            });

            this.OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
        }

 

this is other C# code

 

namespace RevitAddinDocClos
{
  class App : IExternalApplication
  {
    public Result OnStartup(UIControlledApplication a)
    {
      a.ControlledApplication.DocumentClosing += ControlledApplication_DocumentClosing;
      return Result.Succeeded;
    }

    void ControlledApplication_DocumentClosing(object sender, Autodesk.Revit.DB.Events.DocumentClosingEventArgs e)
    {
      TaskDialog.Show("closing", "doc closing");
    }

    public Result OnShutdown(UIControlledApplication a)
    {
      return Result.Succeeded;
    }
  }
}

 

Regards

1 REPLY 1
Message 2 of 2
PhillipM
in reply to: Anonymous

Try using an online code converter tool like this.

http://converter.telerik.com/

Regards
Phillip

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report