当前位置: 首页>>代码示例>>C#>>正文


C# Progress.Focus方法代码示例

本文整理汇总了C#中Progress.Focus方法的典型用法代码示例。如果您正苦于以下问题:C# Progress.Focus方法的具体用法?C# Progress.Focus怎么用?C# Progress.Focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Progress的用法示例。


在下文中一共展示了Progress.Focus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: B_MangleSource_Click

        private void B_MangleSource_Click(object sender, RoutedEventArgs e)
        {
            //validate input
            if (Text_RootFolder.Text.Length == 0)
            {
                MessageBox.Show("Please select a valid root folder", "", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            DirectoryInfo rootInfo = new DirectoryInfo(Text_RootFolder.Text);

            if (!rootInfo.Exists)
            {
                MessageBox.Show("Please select a valid root folder","",MessageBoxButton.OK,MessageBoxImage.Error);
                return;
            }

            if (Text_NewNotice.Text.Length == 0)
            {
                MessageBox.Show("Please enter a new copyright message", "", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (Text_FileTypes.Text.Length == 0)
            {
                MessageBox.Show("Please enter at least one file type to mangle", "", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            //build filetype list
            _fileTypes = Text_FileTypes.Text.Split(new[] { ' ', ','}, StringSplitOptions.RemoveEmptyEntries);

            //display UI

            _window = new Progress();

            _window.T_Current.Content = "Currently Mangling:";
            _window.T_Files.Content = "Files Mangled:";

            _window.Show();
            _window.Focus();

            //recurse

            long start;
            long stop;
            long frequency = Stopwatch.Frequency;
            //Activator
            start = Stopwatch.GetTimestamp();
            Recurse(rootInfo);
            stop = Stopwatch.GetTimestamp();
            double time = (double)(stop - start) / (double)frequency;

            //mangle files

            //Display results
            _window.Close();
            MessageBox.Show("Mangled " + _filesMangled + " source files in " + (time * 1000.0).ToString("F1") + " mS");
        }
开发者ID:64-bit,项目名称:CopyWriter,代码行数:58,代码来源:Copyrighter.xaml.cs

示例2: CalibrateSoundCard

        public bool CalibrateSoundCard(Progress progress, int card)
        {
            if(!chkPower.Checked)
            {
                MessageBox.Show("Power must be on in order to calibrate Soundcard.", "Power Is Off",
                    MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return false;
            }

            Audio.testing = true;
            progress.SetPercent(0.0f);

            double tx_volume = Audio.RadioVolume;	// save current TX volume
            double rx_volume = Audio.MonitorVolume;	// save current RX volume

            if(num_channels == 4 || num_channels == 6)
            {
                chkMOX.Checked = true;
                Thread.Sleep(200);
                Hdw.TransmitRelay = false;
                Audio.RadioVolume = 1.0;				// set volume to max
                Audio.MonitorVolume = 0.0;
            }
            else
            {
                Mixer.SetMainVolume(mixer_id1, 100);
                Mixer.SetWaveOutVolume(mixer_id1, 100);
                Audio.MonitorVolume = 1.0;
            }

            Audio.RX1OutputSignal = Audio.SignalSource.SINE;	// Start sending tone

            progress.Focus();

            while(progress.Visible == true)			// keep sending tone until abort is pressed
                Thread.Sleep(100);

            Audio.RX1OutputSignal = Audio.SignalSource.RADIO;		// stop sending tone

            if(num_channels > 2)
            {
                Thread.Sleep(200);
                chkMOX.Checked = false;
            }

            Audio.RadioVolume = tx_volume;			// restore TX volume
            Audio.MonitorVolume = rx_volume;		// restore RX volume
            Audio.testing = false;

            return true;
        }
开发者ID:ae6jl-mdd,项目名称:powersdr-iq,代码行数:51,代码来源:console.cs

示例3: CalibrateSoundCard

        public bool CalibrateSoundCard(Progress progress, int card)
        {
            if (!PowerOn)
            {
                MessageBox.Show("Power must be on in order to calibrate.", "Power Is Off",
                    MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return false;
            }

            Audio.testing = true;
            progress.SetPercent(0.0f);

            double tx_volume = Audio.RadioVolume;	        // save current TX volume
            double rx_volume = Audio.MonitorVolumeLeft;	    // save current RX volume
            bool twotone = Audio.two_tone;			        // save current two tone setting
            Audio.two_tone = false;

            if (num_channels == 4 || num_channels == 6)
            {
                chkMOX.Checked = true;
                Thread.Sleep(200);
                Audio.RadioVolume = 1.0;				// set volume to max
                Audio.MonitorVolumeLeft = 0.0;
                Audio.MonitorVolumeRight = 0.0;
            }
            else
            {
                switch (WinVer)
                {
                    case WindowsVersion.Windows7:
                    case WindowsVersion.Windows8:
                    case WindowsVersion.WindowsVista:
                        break;

                    default:
                        {
                            Mixer.SetMainVolume(mixer_id1, 100);
                            Mixer.SetWaveOutVolume(mixer_id1, 100);
                        }
                        break;
                }

                Audio.MonitorVolumeLeft = 1.0;
                Audio.MonitorVolumeRight = 1.0;
            }

            Audio.CurrentAudioState1 = Audio.AudioState.SINL_COSR;	// Start sending tone

            progress.Focus();

            while (progress.Visible == true)			            // keep sending tone until abort is pressed
                Thread.Sleep(100);

            Audio.CurrentAudioState1 = Audio.AudioState.DTTSP;		// stop sending tone

            if (num_channels > 2)
            {
                Thread.Sleep(200);
                chkMOX.Checked = false;
            }

            Audio.RadioVolume = tx_volume;			    // restore TX volume
            Audio.MonitorVolumeLeft = rx_volume;		// restore RX volume
            Audio.MonitorVolumeRight = rx_volume;		// restore RX volume
            Audio.two_tone = twotone;				    // restore two tone setting
            Audio.testing = false;

            return true;
        }
开发者ID:Dfinitski,项目名称:genesisradio,代码行数:69,代码来源:console.cs

示例4: ToBase

 public static bool ToBase(string firetakeNumber)
 {
     var res = true;
     var xml = XDocument.Load("firetakes.xml");
     var node = xml.Element("Firetakes").Element("Firetake");
     var progress = new Progress();
     progress.Show();
     progress.SetBarSize(node.Elements().Count<XElement>()+1);
     try
     {
         progress.Focus();
         for (int i = 0; i < int.Parse(firetakeNumber); i++)
         {
             node = node.NextNode as XElement;
         }
         foreach (XElement student in node.Elements())
         {
             var commandText = "INSERT INTO FIRETAKE(DATETAKEN,STATUS,GRADE,COMMENT,DELETED,STUDENT_ID,TEACHER_ID,SCORE) VALUES('" +
                 node.Attribute("Time").Value + "',0," + student.Attribute("Mark").Value + ",'',0," + student.Attribute("Id").Value + "," +
                 node.Attribute("Teacher").Value + "," + student.Attribute("Score").Value + ")";
             var con = new MySqlConnection(conStr);
             var com = new MySqlCommand(commandText, con);
             con.Open();
             com.ExecuteNonQuery();
             con.Close();
             progress.Increment();
             System.Threading.Thread.Sleep(200);
         }
     node.Remove();
     xml.Save("firetakes.xml");
     }
     catch
     {
         res = false;
     }
     progress.Close();
     return res;
 }
开发者ID:tirvoenka,项目名称:LaserGesture,代码行数:38,代码来源:Firetake.cs


注:本文中的Progress.Focus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。