iSpyApplication.MainForm.AddObjectExternal C# (CSharp) Method

AddObjectExternal() public method

public AddObjectExternal ( int objectTypeId, int sourceIndex, int width, int height, string name, string url ) : object
objectTypeId int
sourceIndex int
width int
height int
name string
url string
return object
        public object AddObjectExternal(int objectTypeId, int sourceIndex, int width, int height, string name, string url)
        {
            if (!VlcHelper.VlcInstalled && sourceIndex == 5)
                return null;
            object oret = null;
            switch (objectTypeId)
            {
                case 2:
                    if (Cameras.FirstOrDefault(p => p.settings.videosourcestring == url) == null)
                    {
                        if (name == "") name = "Camera " + NextCameraId;
                        if (InvokeRequired)
                            oret =  Invoke(new Delegates.AddObjectExternalDelegate(AddCameraExternal), sourceIndex, url, width, height,
                                   name);
                        else
                            oret = AddCameraExternal(sourceIndex, url, width, height, name);
                    }
                    break;
                case 1:
                    if (Microphones.FirstOrDefault(p => p.settings.sourcename == url) == null)
                    {
                        if (name == "") name = "Mic " + NextMicrophoneId;
                        if (InvokeRequired)
                            oret = Invoke(new Delegates.AddObjectExternalDelegate(AddMicrophoneExternal), sourceIndex, url, width, height,
                                   name);
                        else
                            oret = AddMicrophoneExternal(sourceIndex, url, width, height, name);
                    }
                    break;
            }
            NeedsSync = true;
            return oret;
        }
MainForm