예제 #1
0
        private static Boolean GetRadioInstance(out IRadioInstance Radio)
        {
            Boolean Result = false;

            Radio = null;

            IMediaRadioManager RadioMan;
            Guid  Iid = typeof(IMediaRadioManager).GUID;
            Int32 Res = CoCreateInstance(ref CLSID_BluetoothRadioManager, IntPtr.Zero,
                                         CLSCTX_INPROC_SERVER, ref Iid, out RadioMan);

            if (Succeeded(Res))
            {
                IRadioInstanceCollection Instances;

                if (Succeeded(RadioMan.GetRadioInstances(out Instances)))
                {
                    UInt32 Cnt;
                    if (Succeeded(Instances.GetCount(out Cnt)) && Cnt > 0)
                    {
                        Result = Succeeded(Instances.GetAt(0, out Radio));
                    }

                    Instances = null;
                }

                RadioMan = null;
            }

            return(Result);
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "ID,FirstName,LastName")] RadioMan radioMan)
 {
     if (ModelState.IsValid)
     {
         repository.Update(radioMan);
         repository.Save();
         return(RedirectToAction("Index", "Admin", ""));
     }
     return(View(radioMan));
 }
예제 #3
0
        // GET: RadioMen/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RadioMan radioMan = repository.GetByID(id);

            if (radioMan == null)
            {
                return(HttpNotFound());
            }
            return(View(radioMan));
        }