예제 #1
0
 public override string ToString()
 {
     return("VID = " + Vid.ToString("X4") +
            " PID = " + Pid.ToString("X4") +
            " Product: " + Product +
            " Path " + Path);
 }
예제 #2
0
        private void VideoData(string link, bool playlist = false)
        {
            var video       = youTube.GetAllVideos(link); // gets a Video object with info about the video
            var resolutions = video.Where(j => j.AdaptiveKind == AdaptiveKind.Video && j.Format == VideoFormat.Mp4).Select(j => j.Resolution);
            var bitRates    = video.Where(j => j.AdaptiveKind == AdaptiveKind.Audio).Select(j => j.AudioBitrate);

            foreach (var val in resolutions)
            {
                Quality.Invoke((MethodInvoker)(() => Quality.Items.Add(val)));
            }
            foreach (var val in bitRates)
            {
                AudioQuality.Invoke((MethodInvoker)(() => AudioQuality.Items.Add(val)));
            }

            if (Quality.Items.Count > 0)
            {
                Quality.Invoke((MethodInvoker)(() => Quality.Sorted = true));
                Quality.Invoke((MethodInvoker)(() => Quality.SelectedIndex = 0));
                AudioQuality.Invoke((MethodInvoker)(() => AudioQuality.Sorted = true));
                AudioQuality.Invoke((MethodInvoker)(() => AudioQuality.SelectedIndex = 0));
                Vid.Invoke((MethodInvoker)(() => Vid.Enabled = true));
                VidTitle.Invoke((MethodInvoker)(() => VidTitle.Text = video.ToList()[0].Title));
            }
            if (playlist)
            {
                Status.Text = listVidsIds.Count + " Videos";
            }
            else
            {
                Status.Text = "Single Video";
            }
        }
예제 #3
0
        private void btnVideoBrowse_Click(object sender, RoutedEventArgs e)
        {
            // Create OpenFileDialog
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();

            // Set filter for file extension and default file extension
            dlg.DefaultExt = ".mp4";
            //dlg.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";

            // Display OpenFileDialog by calling ShowDialog method
            Nullable <bool> result = dlg.ShowDialog();

            // Get the selected file name and display in a TextBox
            if (result == true)
            {
                try
                {
                    // Open document
                    string filename = dlg.FileName;
                    txtVideoPath.Text = filename;
                    Vid.Stop();
                    Vid.Source = new Uri(filename);
                    RestartVideo(Vid);
                }
                catch { }
            }
        }
예제 #4
0
        /// <summary> creates a copy of this view</summary>
        /// <returns> a copy of this view
        /// </returns>
        public override object Clone()
        {
            ViewId vid2 = Vid != null ? (ViewId)Vid.Clone() : null;

            System.Collections.ArrayList members2   = Members != null?(System.Collections.ArrayList)Members.Clone():null;
            System.Collections.ArrayList subgroups2 = subgroups != null?(System.Collections.ArrayList)subgroups.Clone():null;
            return(new MergeView(vid2, members2, subgroups2));
        }
예제 #5
0
 private void disableVid()
 {
     Quality.Invoke((MethodInvoker)(() => Quality.Items.Clear()));
     AudioQuality.Invoke((MethodInvoker)(() => AudioQuality.Items.Clear()));
     Vid.Invoke((MethodInvoker)(() => Vid.Enabled = false));
     Vid.Invoke((MethodInvoker)(() => VidTitle.Text = ""));
     selectedAudioQuality = "";
     selectedVideoQality  = "";
 }
예제 #6
0
 public Vegetables(int n)
 {
     vid  = Proveri(n);
     kind = Check(n);
     makeImg();
     this.speed     = 0;
     this.isAlive   = false;
     this.direction = false;
     this.speedleft = 0;
 }
예제 #7
0
            /// <summary>
            /// Short string general information about this device.
            /// </summary>
            public override string ToString()
            {
                string __desc = Description.Truncate(25);

                if (Description == "")
                {
                    __desc = Type.Truncate(25);
                }
                return($"V/PID: {Vid.ToString("X4")}-{Pid.ToString("X4")} [{__desc}] SN: {Serial}"
                       .Truncate(Const.DEV_STR_MAX_LEN));
            }
예제 #8
0
        private void SetMainAndScanningVideos()
        {
            try
            {
                // Open document
                string filename = txtVideoFolderPath.Text + @"\Pergola Main.mp4";
                Vid.Stop();
                Vid.Source = new Uri(filename);
                RestartVideo(Vid);

                // Open document
                filename = txtVideoFolderPath.Text + @"\Pergola Scanning.mp4";
                ScanningVid.Stop();
                ScanningVid.Source = new Uri(filename);
                RestartVideo(ScanningVid);

                //start sound
                SoundComplete(true);
            }
            catch { }
        }
예제 #9
0
 ///<summary>
 ///Returns a <see cref="T:System.String"/> that represents the current <see cref="UsbSymbolicName"/>.
 ///</summary>
 ///
 ///<returns>
 ///A <see cref="System.String"/> that represents the current <see cref="UsbSymbolicName"/>.
 ///</returns>
 public override string ToString()
 {
     object[] o = new object[] { FullName, Vid.ToString("X4"), Pid.ToString("X4"), SerialNumber, ClassGuid };
     return(string.Format("FullName:{0}\r\nVid:0x{1}\r\nPid:0x{2}\r\nSerialNumber:{3}\r\nClassGuid:{4}\r\n", o));
 }
예제 #10
0
 /// <summary>
 /// Short string general information about this device.
 /// </summary>
 public override string ToString()
 {
     return($"V/PID: {Vid.ToString("X4")}-{Pid.ToString("X4")} [{Manufacturer.Truncate(25)}] SN: {Serial}"
            .Truncate(Const.DEV_STR_MAX_LEN));
 }
예제 #11
0
 /// <summary>
 /// Short string general information about this device.
 /// </summary>
 public override string ToString()
 {
     return($"V/PID: {Vid.ToString("X4")}-{Pid.ToString("X4")}".Truncate(Const.DEV_STR_MAX_LEN));
 }
예제 #12
0
 public Лизинг(int pCost, Valuta pV, Srochnost pS, DateTime pD, Vid pVid) : base(pCost, pV, pS, pD)
 {
     Вид = pVid;
 }
예제 #13
0
 public Лизинг() : base()
 {
     Вид = Vid.Никакой;
 }
        private void Search(Object o)
        {
            ManagementScope            connectionScope = new ManagementScope();
            SelectQuery                mosQuery        = new SelectQuery($@"SELECT * FROM Win32_PnPEntity where DeviceID like '%VID_{Vid.ToString("X4")}&PID_{Pid.ToString("X4")}%'");
            ManagementObjectSearcher   searcher        = new ManagementObjectSearcher(connectionScope, mosQuery);
            ManagementObjectCollection results         = searcher.Get();

            ManagementObjectCollection.ManagementObjectEnumerator enumerator = results.GetEnumerator();

            DeviceCount = results.Count;
            if (DeviceCount > 0)
            {
                enumerator.MoveNext();
                InitDevice((ManagementObject)enumerator.Current);
            }

            if (DeviceCount == 0 && !String.IsNullOrWhiteSpace(DeviceId))
            {
                Disconnect();
            }
        }