コード例 #1
0
ファイル: EventBinding.cs プロジェクト: jart/freeswitch
 public static IDisposable Bind(string id, switch_event_types_t event_types, string subclass_name, Action<EventBindingArgs> f, bool dupe)
 {
     switch_event_callback_delegate boundFunc;
     if (dupe)
     {
         boundFunc = (eventObj) =>
         {
             var args = new EventBindingArgs { EventObj = SwitchEventDupe(new switch_event(eventObj,false)) };
             f(args);
         };
     }
     else
     {
         boundFunc = (eventObj) =>
         {
             var args = new EventBindingArgs { EventObj = new switch_event(eventObj, false) };
             f(args);
         };
     }
     var fp = Marshal.GetFunctionPointerForDelegate(boundFunc);
     var swigFp = new SWIGTYPE_p_f_p_switch_event__void(fp, false);
     var res = freeswitch.switch_event_bind(id, event_types, subclass_name, swigFp, null);
     if (res != switch_status_t.SWITCH_STATUS_SUCCESS)
     {
         throw new InvalidOperationException("Call to switch_event_bind failed, result: " + res + ".");
     }
     return new EventBinding(swigFp, boundFunc);
 }
コード例 #2
0
ファイル: EventBinding.cs プロジェクト: fbasar/c.FreeSWITCH
        public static IDisposable Bind(string id, switch_event_types_t event_types, string subclass_name, Action <EventBindingArgs> f, bool dupe)
        {
            switch_event_callback_delegate boundFunc;

            if (dupe)
            {
                boundFunc = (eventObj) =>
                {
                    var args = new EventBindingArgs {
                        EventObj = SwitchEventDupe(new switch_event(eventObj, false))
                    };
                    f(args);
                };
            }
            else
            {
                boundFunc = (eventObj) =>
                {
                    var args = new EventBindingArgs {
                        EventObj = new switch_event(eventObj, false)
                    };
                    f(args);
                };
            }
            var fp     = Marshal.GetFunctionPointerForDelegate(boundFunc);
            var swigFp = new SWIGTYPE_p_f_p_switch_event__void(fp, false);
            var res    = freeswitch.switch_event_bind(id, event_types, subclass_name, swigFp, null);

            if (res != switch_status_t.SWITCH_STATUS_SUCCESS)
            {
                throw new InvalidOperationException("Call to switch_event_bind failed, result: " + res + ".");
            }
            return(new EventBinding(swigFp, boundFunc));
        }
コード例 #3
0
ファイル: swig.2010.cs プロジェクト: newfront/FreeSWITCH
 public static string switch_event_name(switch_event_types_t arg0)
 {
     string ret = freeswitchPINVOKE.switch_event_name((int)arg0);
     return ret;
 }
コード例 #4
0
ファイル: swig.2010.cs プロジェクト: newfront/FreeSWITCH
 public static switch_status_t switch_event_create_subclass_detailed(string file, string func, int line, SWIGTYPE_p_p_switch_event arg3, switch_event_types_t event_id, string subclass_name)
 {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_create_subclass_detailed(file, func, line, SWIGTYPE_p_p_switch_event.getCPtr(arg3), (int)event_id, subclass_name);
     return ret;
 }
コード例 #5
0
ファイル: swig.2010.cs プロジェクト: newfront/FreeSWITCH
 public static switch_status_t switch_event_create_plain(SWIGTYPE_p_p_switch_event arg0, switch_event_types_t event_id)
 {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_create_plain(SWIGTYPE_p_p_switch_event.getCPtr(arg0), (int)event_id);
     return ret;
 }
コード例 #6
0
ファイル: swig.2010.cs プロジェクト: newfront/FreeSWITCH
 public static switch_status_t switch_event_bind_removable(string id, switch_event_types_t arg1, string subclass_name, SWIGTYPE_p_f_p_switch_event__void callback, SWIGTYPE_p_void user_data, SWIGTYPE_p_p_switch_event_node node)
 {
     switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_bind_removable(id, (int)arg1, subclass_name, SWIGTYPE_p_f_p_switch_event__void.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data), SWIGTYPE_p_p_switch_event_node.getCPtr(node));
     return ret;
 }