Beispiel #1
0
		private void backWorkGetData_DoWork(object sender, DoWorkEventArgs e)
		{
			bool hadData = false;
			while (!isClosing)
			{
				try
				{
					if (LstGetInfo.Count > 0)
					{
						clData cur = LstGetInfo[0];
						LstGetInfo.RemoveAt(0);
						cur.updateInfo();
						isDirty = true;
						hadData = true;
						VideoTotalSize += cur.SizeMb;
						backWorkGetData.ReportProgress(0);
					}
					else
					{
						if (hadData)
						{
							hadData = false;
							backWorkGetData.ReportProgress(0);
						}

						System.Threading.Thread.Sleep(500);
					}
				}
				catch (Exception ex)
				{
					GenFunc.LogAdd(ex);
				}

			}
		}
Beispiel #2
0
		private void encodeToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				if (data.SelectedRows.Count == 0)
				{
					if (data.SelectedCells.Count == 1)
					{
						clData cur = (clData)data.SelectedCells[0].OwningRow.DataBoundItem;
						cur.AskEncoding();
					}
				}
				else
				{
					for (int i = 0; i < data.SelectedRows.Count; i++)
					{
						clData cur = (clData)data.SelectedRows[i].DataBoundItem;
						cur.AskEncoding();
					}
				}
			}
			catch (Exception ex)
			{
				GenFunc.LogAdd(ex);
			}




		}
Beispiel #3
0
		private void moveToWithStructureToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				FolderBrowserDialog dlg = new FolderBrowserDialog();
				dlg.SelectedPath = txtPath.Text;
				dlg.ShowNewFolderButton = true;
				if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
				{
					for (int i = 0; i < data.SelectedRows.Count; i++)
					{
						try
						{
							clData cur = (clData)data.SelectedRows[i].Tag;
							string movePath = dlg.SelectedPath + "\\" + cur.fileInfo.FullName.Substring(txtPath.Text.Length);
							Directory.CreateDirectory(FileFunc.GetDirOfFullName(movePath));
							cur.fileInfo.MoveTo(movePath);
						}
						catch (Exception ex)
						{
							MessageBox.Show(ex.Message);
						}
					}
				}
			}
			catch (Exception ex)
			{
				GenFunc.LogAdd(ex);
			}
		}
Beispiel #4
0
		private void backWorkFindFiles_ProgressChanged(object sender, ProgressChangedEventArgs e)
		{
			try
			{
				switch (e.ProgressPercentage)
				{
					case 0:
						if (e.UserState.GetType().Name == "String")
						{
							MessageBox.Show(e.UserState.ToString());
							return;
						}
						break;
					case 1:
						lblScanStatus.Text = "Scanning: " + e.UserState.ToString();
						break;
					case 2:
						clData item = (clData)e.UserState;
						bindingData.Add(item);
						LstGetInfo.Add(item);
						lblVideoFound.Text = bindingData.Count.ToString();
						break;
					default:
						break;
				}


			}
			catch (Exception ex)
			{
				GenFunc.LogAdd(ex);
			}

		}
Beispiel #5
0
		private void data_CellClick(object sender, DataGridViewCellEventArgs e)
		{
			if (e.RowIndex == -1)
				return;
			clData cur = (clData)data.Rows[e.RowIndex].DataBoundItem;

			if (cur.EncodingLog != null && cur.EncodingLog.Length > 0)
				rtbLog.Text = cur.EncodingLog.ToString();
		}
Beispiel #6
0
		private void playBackupToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				for (int i = 0; i < data.SelectedCells.Count; i++)
				{
					clData cur = (clData)data.SelectedCells[i].OwningRow.DataBoundItem;

					Process.Start(cur.pathBackup);
				}
			}
			catch (Exception ex)
			{
				GenFunc.LogAdd(ex);
			}
		}
Beispiel #7
0
		private void backWorkEncode_DoWork(object sender, DoWorkEventArgs e)
		{
			while (!isClosing)
			{
				try
				{
					for (int i = 0; i < bindingData.Count; i++)
					{
						clData cur = (clData)bindingData[i];
						if (cur.Status == EnEncoding.Pending)
						{
							cur.EncodeVideo();
						}
					}
				}
				catch (Exception)
				{
				}
				System.Threading.Thread.Sleep(5000);
			}
		}
Beispiel #8
0
		private void moveToToolStripMenuItem_Click(object sender, EventArgs e)
		{
			try
			{
				FolderBrowserDialog dlg = new FolderBrowserDialog();
				dlg.SelectedPath = txtPath.Text;
				dlg.ShowNewFolderButton = true;
				if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
				{
					for (int i = 0; i < data.SelectedRows.Count; i++)
					{
						clData cur = (clData)data.SelectedRows[i].Tag;
						cur.fileInfo.MoveTo(dlg.SelectedPath + "\\" + cur.fileInfo.Name);
					}
				}
			}
			catch (Exception ex)
			{
				GenFunc.LogAdd(ex);
			}

		}