Beispiel #1
0
        private void btn_ChangePIN_Click(object sender, EventArgs e)
        {
            Guid id   = Global.GlobalAccount.Id;
            bool flag = false;

            if (!string.IsNullOrEmpty(this.vTextBox_1.Text))
            {
                using (RPM_Account rPMAccount = new RPM_Account())
                {
                    flag = rPMAccount.UpdatePIN(id, this.vTextBox_0.Text, this.vTextBox_1.Text);
                }
                if (flag)
                {
                    MessageBox.Show(this, LangCtrl.GetString("txt_PINChanged", "PIN changed."), "PIN", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    FormCtrl.ClearForm(this.MainPanel);
                    return;
                }
                MessageBox.Show(this, LangCtrl.GetString("txt_PINnotChanged", "PIN NOT changed."), "PIN", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                this.vTextBox_1.Select();
            }
        }
Beispiel #2
0
 private void About_Load(object sender, EventArgs e)
 {
     if (Global.IS_WOLFCOM)
     {
         this.LogoPic.Image               = Properties.Resources.sm_wolfcom11;
         this.BrandPic.Visible            = false;
         this.LogoPanel.Visible           = true;
         this.lblHardware.ForeColor       = Color.White;
         this.MainPanel.BackgroundImage   = Properties.Resources.WCBG;
         this.btnCloseDlg.VIBlendTheme    = VIBLEND_THEME.NERO;
         this.lnk_License.LinkColor       = Color.Yellow;
         this.lbl_Version.ForeColor       = Color.White;
         this.Copyright.ForeColor         = Color.White;
         this.lbl_Version.Location        = new Point(270, 6);
         this.lnk_License.Location        = new Point(270, 33);
         this.HeaderPanel.BackgroundImage = Properties.Resources.topbar45;
     }
     this.GetMachineProfile();
     this.SetLanguage();
     this.lbl_Version.Text = string.Format(LangCtrl.GetString("lbl_Version", "Version {0}"), Application.ProductVersion);
 }
Beispiel #3
0
 private void CheckUnassigned()
 {
     using (RPM_Account rpmAccount = new RPM_Account())
     {
         if (rpmAccount.GetUnassignedList().Count <= 0)
         {
             return;
         }
         NodeRecord nodeRecord = new NodeRecord();
         nodeRecord.ImgIdx  = 3;
         nodeRecord.Name    = "Unassigned";
         nodeRecord.RecIdx  = Guid.Empty;
         nodeRecord.SubIdx  = Guid.Empty;
         nodeRecord.RecType = NodeType.UNASSIGNED;
         ROOT.Nodes.Add(new vTreeNode(LangCtrl.GetString("mnode_Unassigned", "Unassigned Accounts"))
         {
             Tag        = nodeRecord,
             ImageIndex = nodeRecord.ImgIdx
         });
     }
 }
Beispiel #4
0
        public AccountPanel(string name, string data, SECURITY security)
        {
            InitializeComponent();
            Dock                  = DockStyle.Top;
            AccountName.Text      = name;
            AccountRank.Text      = data;
            lblSecurity.BackColor = Color.Transparent;
            lblSecurity.Text      = LangCtrl.GetString("sec_Unclassified", "Unclassified");
            switch (security)
            {
            case SECURITY.TOPSECRET:
            {
                lblSecurity.ForeColor = Color.Yellow;
                lblSecurity.BackColor = Color.Red;
                lblSecurity.Text      = LangCtrl.GetString("sec_TopSecret", "Top Secret");
                return;
            }

            case SECURITY.SECRET:
            {
                lblSecurity.ForeColor = Color.White;
                lblSecurity.BackColor = Color.Orange;
                lblSecurity.Text      = LangCtrl.GetString("sec_Secret", "Secret");
                return;
            }

            case SECURITY.OFFICIAL:
            {
                lblSecurity.ForeColor = Color.Black;
                lblSecurity.BackColor = Color.Yellow;
                lblSecurity.Text      = LangCtrl.GetString("sec_Official", "Official");
                return;
            }

            default:
            {
                return;
            }
            }
        }
Beispiel #5
0
        public void OpenImage(string FileName, Snapshot sRec)
        {
            RecPanel.Visible = true;
            label1.Text      = string.Format(LangCtrl.GetString("iv_FrameNum", "Frame No.: {0}"), sRec.FrameNumber);
            Global.Log("IMAGE-VIEW", string.Format("Snapshot: {0}", FileName));
            ImageFileName = FileName;
            FileStream fileStream = new FileInfo(FileName).OpenRead();
            Bitmap     bitmap1    = new Bitmap(fileStream);

            sourceImage = (Bitmap)System.Drawing.Image.FromFile(FileName);
            if (sourceImage.PixelFormat != PixelFormat.Format24bppRgb)
            {
                Bitmap bitmap2 = AForge.Imaging.Image.Clone(sourceImage, PixelFormat.Format24bppRgb);
                sourceImage.Dispose();
                sourceImage = bitmap2;
            }
            ClearCurrentImage();
            pictureBox.Image = sourceImage;
            picImage.Image   = Utilities.resizeImage(110, 70, (System.Drawing.Image)bitmap1.Clone());
            fileStream.Close();
            Histogram();
        }
Beispiel #6
0
 private void ReportForm_Load(object sender, EventArgs e)
 {
     if (Global.IS_WOLFCOM)
     {
         this.HeaderPanel.BackgroundImage  = Properties.Resources.header80;
         this.btn_ClearReport.VIBlendTheme = VIBLEND_THEME.VISTABLUE;
     }
     this.Text = LangCtrl.GetString("dlg_ReportForm", "Account Reports");
     this.btn_ClearReport.Text      = LangCtrl.GetString("btn_ClearReport", "Clear Report");
     this.cboSysReports.DefaultText = LangCtrl.GetString("cboSysReports", "Select System Report...");
     this.cboReports.DefaultText    = LangCtrl.GetString("cboReports", "Select Account Report...");
     this.HeaderPanel.Height        = 40;
     this.AccountID           = Global.GlobalAccount.Id;
     this.lblUserAccount.Text = string.Format("Account: {0} • {1}", Global.GlobalAccount.ToString(), Global.GlobalAccount.BadgeNumber);
     if (Global.GlobalAccount.SystemRole == SYSTEM_ROLE.ADMIN || Global.GlobalAccount.SystemRole == SYSTEM_ROLE.DELEGATE)
     {
         this.cboSysReports.Visible = true;
         this.HeaderPanel.Height    = 61;
         this.IsAdmin = true;
     }
     try
     {
         this.rDoc = new ReportDocument();
         this.LoadConfig();
         this.timer = new System.Timers.Timer(1000)
         {
             Enabled = true
         };
         this.timer.Elapsed -= new ElapsedEventHandler(this.timer_Elapsed);
         this.timer.Elapsed += new ElapsedEventHandler(this.timer_Elapsed);
         this.timer.Start();
     }
     catch (Exception exception1)
     {
         Exception exception = exception1;
         MessageBox.Show(this, exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     this.LoadRegData();
 }
Beispiel #7
0
 private void DeleteTags()
 {
     if (vListBox.Items.Count <= 0 || MessageBox.Show(this, LangCtrl.GetString("tp_DeleteMarks", "Delete checked Marks?"), "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
     {
         return;
     }
     foreach (ListItem listItem in vListBox.Items)
     {
         using (RPM_VideoTag rpmVideoTag = new RPM_VideoTag())
         {
             if (listItem.IsChecked.Value)
             {
                 VideoTag tag1 = (VideoTag)listItem.Tag;
                 VideoTag tag2 = rpmVideoTag.GetTag(tag1.Id);
                 rpmVideoTag.DeleteVideoTag(tag2);
                 rpmVideoTag.Save();
                 Global.Log("MARK-DELETE", string.Format("Delete: {0} / {1} for {2}", listItem.Text.ToUpper(), listItem.Description, FileName));
             }
         }
     }
     ListTags(File_ID);
 }
Beispiel #8
0
        public void InitTree()
        {
            SetLanguage();
            vTree.Nodes.Clear();
            vAcctList.Items.Clear();
            NodeRecord nodeRecord = new NodeRecord();

            nodeRecord.Name    = LangCtrl.GetString("mnode_Dept", "Departments");
            nodeRecord.RecType = NodeType.ROOT_NODE;
            nodeRecord.ImgIdx  = 0;
            nodeRecord.RecIdx  = Guid.Empty;
            ROOT            = new vTreeNode(nodeRecord.Name);
            ROOT.ImageIndex = 0;
            ROOT.Tag        = nodeRecord;
            vTree.Nodes.Add(ROOT);
            TreeNode = ROOT.Nodes;
            if (LoadDepartments() > 0)
            {
                btn_ResetList.Visible = false;
                CheckUnassigned();
            }
            vAcctList.SelectedIndex = -1;
        }
Beispiel #9
0
 private void InitTree()
 {
     try
     {
         this.vTree.Nodes.Clear();
         NodeRecord nodeRecord = new NodeRecord()
         {
             Name    = LangCtrl.GetString("node_CatSets", "Catalog Sets"),
             RecType = NodeType.ROOT_NODE,
             ImgIdx  = 0,
             RecIdx  = Guid.Empty
         };
         this.ROOT = new vTreeNode(nodeRecord.Name)
         {
             ImageIndex = 0,
             Tag        = nodeRecord
         };
         this.vTree.Nodes.Add(this.ROOT);
         this.TreeNode = this.ROOT.Nodes;
     }
     catch
     {
     }
 }
Beispiel #10
0
        private void UpdateCapacity()
        {
            if (this._totalDiscSize == 0L)
            {
                this.progSize.Text = "0MB";
                return;
            }
            this.progSize.Text = (this._totalDiscSize < 1000000000L ? string.Format("{0}MB", this._totalDiscSize / 1000000L) : string.Format("{0:F2}GB", (double)((float)this._totalDiscSize) / 1000000000));
            long sizeOnDisc = 0L;

            foreach (IMediaItem dirItem in this.DirItems)
            {
                sizeOnDisc += dirItem.SizeOnDisc;
            }
            if (sizeOnDisc == 0L)
            {
                this.progSize.Value       = 0;
                this.btn_BurnDisc.Text    = LangCtrl.GetString("btn_BurnDisc", "Burn Disc");
                this.btn_BurnDisc.Enabled = true;
                return;
            }
            int num = (int)(sizeOnDisc * 100L / this._totalDiscSize);

            if (num > 100)
            {
                this.progSize.Value       = 100;
                this.progSize.Text        = LangCtrl.GetString("DiscSize", "Disc Capacity Exceeded!");
                this.btn_BurnDisc.Enabled = false;
                return;
            }
            this.progSize.Value = num;
            TextProgressBar textProgressBar = this.progSize;

            textProgressBar.Text      = string.Concat(textProgressBar.Text, string.Format(" - {0}% Free", 100 - num));
            this.btn_BurnDisc.Enabled = true;
        }
Beispiel #11
0
 private void upload1_EVT_UploadComplete()
 {
     this.timer1.Stop();
     this.stopwatch.Stop();
     this.lblFileName.Text  = string.Empty;
     this.lblFileExt.Text   = string.Empty;
     this.lblTimestamp.Text = string.Empty;
     this.lblFileSize.Text  = string.Empty;
     try
     {
         if (!this.IsCancel)
         {
             if (!this.upload1.CancelFlag)
             {
                 MessageBox.Show(this, LangCtrl.GetString("txt_UploadComplete", "Upload Complete."), "UPLOAD", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
             else
             {
                 MessageBox.Show(this, LangCtrl.GetString("txt_UploadStopped", "Upload Stopped."), "UPLOAD", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
     catch
     {
     }
     try
     {
         CameraLog cameraLog = new CameraLog()
         {
             AssetTag     = "",
             LogTimestamp = new DateTime?(this.StartTimestamp),
             FileCount    = this.upload1.FileCount,
             Action       = "CAMERA UPLOAD"
         };
         if (string.IsNullOrEmpty(Global.Camera_SerialNum))
         {
             Global.Camera_SerialNum = Global.VisionSN;
         }
         cameraLog.SerialNumber = Global.Camera_SerialNum.TrimEnd(new char[0]);
         cameraLog.Battery      = Global.Camera_Battery;
         cameraLog.DiskSpace    = (double)Global.Camera_Disk;
         object[] text = new object[] { this.lblTimespan.Text, Environment.NewLine, Environment.NewLine, Environment.NewLine };
         cameraLog.Memo = string.Format("Elapsed Download Time: {0}{1}{2}CAMERA CONFIGURATION -------------------------------------{3}", text);
         CameraLog cameraLog1 = cameraLog;
         cameraLog1.Memo = string.Concat(cameraLog1.Memo, CiteCamera.CameraProfile(this.CameraDriveID));
         CameraLog cameraLog2 = cameraLog;
         cameraLog2.Memo = string.Concat(cameraLog2.Memo, string.Format("{0}CAMERA TRANSACTIONS -------------------------------------{1}", Environment.NewLine, Environment.NewLine));
         CameraLog cameraLog3 = cameraLog;
         cameraLog3.Memo       = string.Concat(cameraLog3.Memo, CiteCamera.DailyLog(this.CameraDriveID));
         cameraLog.AccountID   = Global.GlobalAccount.Id;
         cameraLog.AccountName = Global.GlobalAccount.ToString();
         cameraLog.BadgeNumber = Global.GlobalAccount.BadgeNumber;
         CamProfile camProfile = this.ReadAssetProfile(this.CameraDriveID);
         if (camProfile != null && camProfile.InventoryID != Guid.Empty)
         {
             try
             {
                 cameraLog.AssetTag = camProfile.AssetTag;
                 if (!string.IsNullOrEmpty(camProfile.TrackingID))
                 {
                     Guid empty = Guid.Empty;
                     using (RPM_Asset rPMAsset = new RPM_Asset())
                     {
                         empty = rPMAsset.GetAccountByTrackingID(camProfile.TrackingID);
                     }
                     if (empty != Guid.Empty)
                     {
                         using (RPM_Account rPMAccount = new RPM_Account())
                         {
                             Account account = rPMAccount.GetAccount(empty);
                             cameraLog.AccountID   = account.Id;
                             cameraLog.AccountName = account.ToString();
                             cameraLog.BadgeNumber = account.BadgeNumber;
                         }
                     }
                 }
             }
             catch
             {
             }
         }
         Global.Log(cameraLog);
     }
     catch
     {
     }
     this.upload1.ClearControl();
     base.Close();
 }
Beispiel #12
0
        private void Download_Load(object sender, EventArgs e)
        {
            if (Global.IS_WOLFCOM)
            {
                this.btn_Cancel.VIBlendTheme     = VIBLEND_THEME.NERO;
                this.HeaderPanel.BackgroundImage = Properties.Resources.topbar45;
            }
            this.SetLanguage();
            this.lblSourcePath.Text = this.FolderPath;
            this.Text = string.Format(LangCtrl.GetString("txt_Download", "Download {0}"), this.FolderPath);
            this.Text = string.Format("Download {0}", this.FolderPath);
            this.upload1.EVT_UploadComplete -= new Upload.DEL_UploadComplete(this.upload1_EVT_UploadComplete);
            this.upload1.EVT_UploadCallback -= new Upload.DEL_UploadCallback(this.upload1_EVT_UploadCallback);
            this.upload1.EVT_UploadComplete += new Upload.DEL_UploadComplete(this.upload1_EVT_UploadComplete);
            this.upload1.EVT_UploadCallback += new Upload.DEL_UploadCallback(this.upload1_EVT_UploadCallback);
            this.upload1.DeleteSource        = true;
            this.upload1.ShowTimestamp       = true;
            DateTime now = DateTime.Now;

            object[] accountID = new object[] { this.Account_ID, now.Year, now.Month, now.Day };
            string   str       = string.Format("{0}\\{1}\\{2:00}\\{3:00}", accountID);
            string   str1      = Path.Combine(Global.UNCServer, Global.RelativePath);

            str1 = Path.Combine(str1, str);
            if (!str1.Contains(":"))
            {
                if (!str1.StartsWith("\\\\"))
                {
                    str1 = string.Concat("\\\\", str1);
                }
            }
            else if (str1.Contains(":") && !str1.Contains(":\\"))
            {
                str1 = str1.Replace(":", ":\\");
            }
            bool flag = false;

            try
            {
                if (!Directory.Exists(str1))
                {
                    Directory.CreateDirectory(str1);
                    Network.SetAcl(str1);
                }
            }
            catch (Exception exception)
            {
                flag = true;
                MessageBox.Show(this, string.Format(LangCtrl.GetString("txt_StorageErr", "The storage path is not available!\nPlease check your hard drive or network."), this.FolderPath), "Storage", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                base.Close();
            }
            if (!flag)
            {
                if (Directory.Exists(str1))
                {
                    this.CameraDriveID = Path.GetPathRoot(this.FolderPath);
                    Thread.Sleep(1000);
                    if (!this.upload1.StartUpload(this.FolderPath, Global.UNCServer, Global.RelativePath, str, this.Account_ID))
                    {
                        MessageBox.Show(string.Format(LangCtrl.GetString("txt_StorageErr2", "Storage Path not available at {0}"), this.FolderPath));
                    }
                    this.FileCount = this.upload1.FileCount;
                    return;
                }
                MessageBox.Show(string.Format(LangCtrl.GetString("txt_StorageErr2", "Storage Path not available at {0}"), this.FolderPath));
                base.Close();
            }
        }
Beispiel #13
0
        private void Run()
        {
            int num = 0;

            using (RPM_GlobalConfig rPMGlobalConfig = new RPM_GlobalConfig())
            {
                GlobalConfig configRecord = rPMGlobalConfig.GetConfigRecord("FILEDELETE_MINDAYS");
                if (configRecord != null)
                {
                    num = Convert.ToInt32(configRecord.Value);
                }
            }
            int num1 = 0;

            for (int i1 = 0; i1 < this.FilePanel.Controls.Count; i1++)
            {
                if (((Slide)this.FilePanel.Controls[i1]).sRecord.IsSelected)
                {
                    num1++;
                }
            }
            int num2 = 0;

            this.progBar.Maximum = num1;
            try
            {
                bool flag = false;
                if (num > 0)
                {
                    int num3 = 0;
                    base.BeginInvoke(new MethodInvoker(() => {
                        for (int i = this.FilePanel.Controls.Count - 1; i >= 0; i--)
                        {
                            Slide item = (Slide)this.FilePanel.Controls[i];
                            if (item.sRecord.IsSelected)
                            {
                                this.msgText.Text = item.sRecord.dRecord.ShortDesc;
                                this.pic.Image    = Utilities.ByteArrayToImage(item.sRecord.dRecord.Thumbnail);
                                num2++;
                                this.progBar.Value = num2;
                                flag = true;
                                if (!item.sRecord.dRecord.IsIndefinite & !item.sRecord.dRecord.IsEvidence && item.DeleteSlideFile(num))
                                {
                                    num3++;
                                    this.FilePanel.Controls.Remove(item);
                                }
                            }
                            if (this.IsCancel)
                            {
                                break;
                            }
                        }
                        string str = string.Format(LangCtrl.GetString("txt_FilesDeleted", "Files Deleted: {0}"), num3);
                        if (num2 != num3 && flag)
                        {
                            str = string.Concat(str, LangCtrl.GetString("txt_FilesDeleted2", "\nSome files could not be deleted. Minimum delete days."));
                        }
                        MessageBox.Show(this, str, "Files", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        base.Close();
                    }));
                }
            }
            catch (Exception exception)
            {
                Logger.Logging.WriteSystemLog(VMGlobal.LOG_ACTION.CODE_ERROR, exception.Message, this.Account_ID);
            }
            base.BeginInvoke(new MethodInvoker(() => base.Close()));
        }
Beispiel #14
0
 private void btn_Search_Click(object sender, EventArgs e)
 {
     try
     {
         int num1 = 0;
         int num2 = 0;
         if (ValidateSearch())
         {
             DataPanel.Controls.Clear();
             DataPanel.SuspendLayout();
             SECURITY        security      = Global.GlobalAccount.Security;
             Guid            guid          = Guid.Empty;
             List <DataFile> dataFileList1 = new List <DataFile>();
             string          str           = string.Empty;
             using (RPM_DataFile rpmDataFile = new RPM_DataFile())
             {
                 List <DataFile> dataFileList2 = rpmDataFile.QryGlobalCatalog(btnByFileDate.Checked, FromDate.Value.Value, ToDate.Value.Value, txtRMS.Text, txtCAD.Text, txtSet.Text, chk_FilterEvidence.Checked);
                 if (dataFileList2.Count > 0)
                 {
                     foreach (DataFile df in dataFileList2)
                     {
                         if (guid != df.AccountId)
                         {
                             guid = df.AccountId;
                             using (RPM_Account rpmAccount = new RPM_Account())
                             {
                                 Account account = rpmAccount.GetAccount(df.AccountId);
                                 str = string.Format("{0} • {1}", account.ToString(), account.BadgeNumber);
                                 string       data         = string.Format("Rank: {0}", account.Rank);
                                 AccountPanel accountPanel = new AccountPanel(str, data, account.Security);
                                 DataPanel.Controls.Add(accountPanel);
                                 DataPanel.Controls.SetChildIndex(accountPanel, 0);
                                 ++num2;
                             }
                         }
                         if (security <= df.Security)
                         {
                             CatalogObject catalogObject = new CatalogObject(num1 + 1, df, str);
                             DataPanel.Controls.Add(catalogObject);
                             DataPanel.Controls.SetChildIndex(catalogObject, 0);
                             ++num1;
                         }
                     }
                 }
                 else
                 {
                     Label label = new Label();
                     label.Dock = DockStyle.Top;
                     label.Font = new Font("Verdana", 16f);
                     label.Text = LangCtrl.GetString("gc_NoResults", "NO RESULTS FOUND");
                     DataPanel.Controls.Add(label);
                 }
             }
             gcFileCount.Text = string.Format(LangCtrl.GetString("gcFileCount", "Files: {0}"), num1);
             gc_Accounts.Text = string.Format(LangCtrl.GetString("gc_Accounts", "Accounts: {0}"), num2);
         }
         object[] objArray = new object[] { FromDate.Value.Value, ToDate.Value.Value, txtRMS.Text, txtCAD.Text, chk_FilterEvidence.Checked, num2, num1 };
         string   str2     = string.Format("{0} to {1} RMS: {2} CAD: {3} Evidence: {4}   RESULT> Accounts: {5} Files: {6}", objArray);
         Global.Log("SEARCH GC", string.Concat("Global Catalog> ", str2));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     DataPanel.ResumeLayout();
 }
Beispiel #15
0
 public static string DescString()
 {
     return(LangCtrl.GetString("enum_AccountSecurity", "Top Secret,Secret,Official,Unclassified"));
 }
Beispiel #16
0
 private void MapPanel_Load(object sender, EventArgs e)
 {
     chk_MapCompass.Text = LangCtrl.GetString("chk_MapCompass", "Map Compass");
 }
Beispiel #17
0
        private string WriteFileInfo(DataFile dRec)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_1", "File Is Evidence: {0}"), Environment.NewLine), dRec.IsEvidence));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_2", "File Name: {0}{1}"), Environment.NewLine), dRec.OriginalFileName, dRec.FileExtension));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_3", "File Timestamp: {0}"), Environment.NewLine), dRec.FileTimestamp));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_4", "File Uploaded: {0}"), Environment.NewLine), dRec.FileAddedTimestamp));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_5", "File Size: {0}"), Environment.NewLine), dRec.FileSize));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_6", "File Hash Code: {0}"), Environment.NewLine), dRec.FileHashCode));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_7", "Short Desc: {0}"), Environment.NewLine), dRec.ShortDesc));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_8", "Stored File Name: {0}"), Environment.NewLine), dRec.StoredFileName));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_9", "SET: {0}"), Environment.NewLine), dRec.SetName));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_10", "Security Level: {0}"), Environment.NewLine), dRec.Security));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_11", "Classification: {0}"), Environment.NewLine), dRec.Classification));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_12", "Rating: {0}"), Environment.NewLine), dRec.Rating));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_13", "RMS Number: {0}"), Environment.NewLine), dRec.RMSNumber));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_14", "CAD Number: {0}"), Environment.NewLine), dRec.CADNumber));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_15", "Retain Indefinite: {0}"), Environment.NewLine), dRec.IsIndefinite));
            stringBuilder.Append(string.Format(string.Concat(Environment.NewLine, Environment.NewLine, LangCtrl.GetString("wrt_16", "File Uploaded from this machine environment: "), Environment.NewLine), new object[0]));
            stringBuilder.Append(string.Format(string.Concat("---------------------------------------------------------------------", Environment.NewLine), new object[0]));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_17", "Machine Name: {0}"), Environment.NewLine), dRec.MachineName));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_18", "Machine Account: {0}"), Environment.NewLine), dRec.MachineAccount));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_19", "Machine Login ID: {0}"), Environment.NewLine), dRec.LoginID));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_20", "Machine Domain: {0}"), Environment.NewLine), dRec.UserDomain));
            stringBuilder.Append(string.Format(string.Concat(LangCtrl.GetString("wrt_21", "File Source Path: {0}"), Environment.NewLine), dRec.SourcePath));
            string str = Path.Combine(this.FolderName, string.Format("{0}.txt", dRec.OriginalFileName));

            using (StreamWriter streamWriter = new StreamWriter(str))
            {
                streamWriter.Write(stringBuilder.ToString());
            }
            return(str);
        }
Beispiel #18
0
 private void SetLanguage()
 {
     LangCtrl.reText(this);
     this.Text = LangCtrl.GetString("dlg_AlertEmails", "Alert Emails");
 }
Beispiel #19
0
 private void BGColor_Load(object sender, EventArgs e)
 {
     this.Text = LangCtrl.GetString("dlg_BGColor", "Background Color");
 }
Beispiel #20
0
        public bool DeleteSlideFile(int days)
        {
            this.sRecord.Action = ACTION.NONE;
            bool flag = false;

            if (days > 0 && (this.sRecord.dRecord.Classification.ToUpper().Equals("UNCLASSIFIED") || string.IsNullOrEmpty(this.sRecord.dRecord.Classification)))
            {
                DateTime value = this.sRecord.dRecord.FileAddedTimestamp.Value;
                value = value.AddDays((double)days);
                if (DateTime.Now > value)
                {
                    this.picDelete.Visible = true;
                    Application.DoEvents();
                    DateTime now  = DateTime.Now;
                    object[] year = new object[] { now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond };
                    string   str  = string.Format("{0}{1:00}{2:00}_{3:00}{4:00}{5:00}.{6:0000}.zip", year);
                    string   str1 = Path.Combine(this.sRecord.dRecord.UNCName, this.sRecord.dRecord.UNCPath);
                    string   str2 = Path.Combine(Network.FormatPath(str1), string.Format("{0}{1}", this.sRecord.dRecord.StoredFileName, this.sRecord.dRecord.FileExtension));
                    if (!File.Exists(str2))
                    {
                        MessageBox.Show(this, string.Format(LangCtrl.GetString("sld_SourceFile", "Source File Not Found: {0}"), str2), "File Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    }
                    else
                    {
                        string empty  = string.Empty;
                        string empty1 = string.Empty;
                        using (RPM_GlobalConfig rPMGlobalConfig = new RPM_GlobalConfig())
                        {
                            GlobalConfig configRecord = rPMGlobalConfig.GetConfigRecord("RET_UNC_ROOT");
                            if (configRecord != null)
                            {
                                empty = configRecord.Value;
                            }
                            configRecord = rPMGlobalConfig.GetConfigRecord("RET_UNC_PATH");
                            if (configRecord != null)
                            {
                                empty1 = configRecord.Value;
                            }
                        }
                        if (!string.IsNullOrEmpty(empty) && !string.IsNullOrEmpty(empty1))
                        {
                            string str3 = Network.FormatPath(Path.Combine(empty, empty1));
                            if (!Directory.Exists(str3))
                            {
                                MessageBox.Show(this, LangCtrl.GetString("sld_ArchiveFolder", "Archive Folder Not Set!\nContact your system administrator."), "Archive Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                            else if (Zip.ZipToFile(str2, str3, str))
                            {
                                using (RPM_DataFile rPMDataFile = new RPM_DataFile())
                                {
                                    DataFile dataFile = rPMDataFile.GetDataFile(this.sRecord.dRecord.Id);
                                    dataFile.PurgeFileName  = str;
                                    dataFile.PurgeTimestamp = new DateTime?(DateTime.Now);
                                    dataFile.IsPurged       = new bool?(true);
                                    rPMDataFile.SaveUpdate(dataFile);
                                    rPMDataFile.Save();
                                    try
                                    {
                                        File.Delete(str2);
                                    }
                                    catch (Exception exception1)
                                    {
                                        Exception exception = exception1;
                                        MessageBox.Show(this, exception.Message, "Delete Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                                    }
                                    if (!File.Exists(str2))
                                    {
                                        Global.Log("USER DELETE", string.Format("File: {0}", str2));
                                        flag = true;
                                    }
                                }
                            }
                        }
                    }
                    this.picDelete.Visible = false;
                    Application.DoEvents();
                }
            }
            return(flag);
        }
Beispiel #21
0
 private void ImgViewer2_Load(object sender, EventArgs e)
 {
     Text = LangCtrl.GetString("dlg_ImgViewer", "Image Viewer");
     LangCtrl.reText(this);
     SecurityProfile();
 }
Beispiel #22
0
 private void SetLanguage()
 {
     this.Text = LangCtrl.GetString("dlg_Scanner", "Scanner");
     LangCtrl.reText(this);
 }
Beispiel #23
0
 private void ScanDocument()
 {
     if (this.cboDevices.SelectedItem == null)
     {
         this.Cursor              = Cursors.Default;
         this.WaitPic.Visible     = false;
         this.lbl_ScanStatus.Text = LangCtrl.GetString("txt_ScannerNotFound", "Scanner not found...");
         MessageBox.Show(this, LangCtrl.GetString("txt_ScannerNotFound", "Scanner not found."), "Scanner", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         this._isImageAcquiring = true;
         string str      = this.cboDevices.SelectedItem.ToString();
         Device @checked = this._deviceManager.Devices.Find(str);
         try
         {
             if (@checked != null)
             {
                 this.SubscribeToDeviceEvents(@checked);
                 @checked.ShowUI              = this.vCheckBox_0.Checked;
                 @checked.ModalUI             = false;
                 @checked.ShowIndicators      = false;
                 @checked.DisableAfterAcquire = false;
                 @checked.TransferMode        = TransferMode.Memory;
                 try
                 {
                     @checked.Open();
                 }
                 catch (TwainException twainException1)
                 {
                     TwainException twainException = twainException1;
                     this._isImageAcquiring = false;
                     MessageBox.Show(twainException.Message, "TWAIN device", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                     return;
                 }
                 @checked.PixelType = PixelType.RGB;
             }
             else
             {
                 this._isImageAcquiring = false;
                 return;
             }
         }
         catch (TwainException twainException2)
         {
         }
         try
         {
             @checked.UnitOfMeasure = UnitOfMeasure.Inches;
         }
         catch (TwainException twainException3)
         {
             MessageBox.Show("Unit of measure 'Inches' is not supported.", "TWAIN device");
         }
         Resolution resolution = new Resolution(100f, 100f);
         try
         {
             if (this.cboResolution.SelectedIndex == 1)
             {
                 resolution = new Resolution(150f, 150f);
             }
             else if (this.cboResolution.SelectedIndex == 2)
             {
                 resolution = new Resolution(200f, 200f);
             }
             else if (this.cboResolution.SelectedIndex == 3)
             {
                 resolution = new Resolution(300f, 300f);
             }
             else if (this.cboResolution.SelectedIndex == 4)
             {
                 resolution = new Resolution(600f, 600f);
             }
             @checked.Resolution = resolution;
         }
         catch (TwainException twainException4)
         {
             MessageBox.Show(string.Format("Resolution '{0}' is not supported.", resolution), "TWAIN device");
         }
         try
         {
             @checked.Acquire();
         }
         catch (TwainException twainException6)
         {
             TwainException twainException5 = twainException6;
             this._isImageAcquiring = false;
             MessageBox.Show(twainException5.Message, "TWAIN device", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         }
     }
 }
Beispiel #24
0
        private void Config()
        {
            vTreeNode _vTreeNode = new vTreeNode(LangCtrl.GetString("mnode_Config", "Configuration"))
            {
                ImageIndex = 8,
                Tag        = null
            };

            this.ROOT.Nodes.Add(_vTreeNode);
            vTreeNode _vTreeNode1 = new vTreeNode(LangCtrl.GetString("mnode_DataSets", "Data Sets"))
            {
                ImageIndex = 9,
                Tag        = "Cfg_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode1);
            vTreeNode _vTreeNode2 = new vTreeNode(LangCtrl.GetString("mnode_CameraProfiles", "Camera Profiles"))
            {
                ImageIndex = 13,
                Tag        = "Camera_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode2);
            vTreeNode _vTreeNode3 = new vTreeNode(LangCtrl.GetString("mnode_CUT", "Cite Utility Tool"))
            {
                ImageIndex = 21,
                Tag        = "Cut_Plugin"
            };

            _vTreeNode.Nodes.Add(_vTreeNode3);
            vTreeNode _vTreeNode4 = new vTreeNode(LangCtrl.GetString("mnode_VISION", "Vision Camera Tool"))
            {
                ImageIndex = 23,
                Tag        = "Plg_VisionCamera"
            };

            _vTreeNode.Nodes.Add(_vTreeNode4);
            vTreeNode _vTreeNode5 = new vTreeNode(LangCtrl.GetString("mnode_Cloud", "Cloud Storage"))
            {
                ImageIndex = 10,
                Tag        = "Cfg_Cloud"
            };

            _vTreeNode.Nodes.Add(_vTreeNode5);
            vTreeNode _vTreeNode6 = new vTreeNode(LangCtrl.GetString("mnode_System", "System"))
            {
                ImageIndex = 11,
                Tag        = null
            };

            _vTreeNode.Nodes.Add(_vTreeNode6);
            vTreeNode _vTreeNode7 = new vTreeNode(LangCtrl.GetString("mnode_Param", "Parameters"))
            {
                ImageIndex = 12,
                Tag        = "Cfg_SysParams"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode7);
            vTreeNode _vTreeNode8 = new vTreeNode(LangCtrl.GetString("mnode_FileMgr", "File Management"))
            {
                ImageIndex = 14,
                Tag        = "Cfg_FileMgr"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode8);
            vTreeNode _vTreeNode9 = new vTreeNode(LangCtrl.GetString("mnode_Restore", "Restore File"))
            {
                ImageIndex = 22,
                Tag        = "Plg_Restore"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode9);
            vTreeNode _vTreeNode10 = new vTreeNode(LangCtrl.GetString("mnode_EmailSettings", "Email Settings"))
            {
                ImageIndex = 15,
                Tag        = "Cfg_Email"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode10);
            vTreeNode _vTreeNode11 = new vTreeNode(LangCtrl.GetString("mnode_License", "Camera License"))
            {
                ImageIndex = 16,
                Tag        = "Cfg_License"
            };

            _vTreeNode6.Nodes.Add(_vTreeNode11);
        }
Beispiel #25
0
 private void AppLogin()
 {
     try
     {
         this.lbl_loginMsg.Text = LangCtrl.GetString("lbl_loginMsg", "Authenticating login...");
         this.lbl_loginMsg.Refresh();
         this.TryCount++;
         if (this.TryCount >= this.MaxTrys)
         {
             Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.LOGON_COUNT, this.vTextBox_0.Text, Guid.Empty);
             Process.GetCurrentProcess().Kill();
             base.DialogResult = DialogResult.Cancel;
             base.Close();
         }
         else
         {
             this.Cursor = Cursors.WaitCursor;
             using (RPM_Account rPMAccount = new RPM_Account())
             {
                 Account account = rPMAccount.Authenticate(vTextBox_0.Text, CryptoIO.MD5Encrypt(this.txtPwd.Text));
                 if (account == null)
                 {
                     Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.LOGON_FAILED, this.vTextBox_0.Text, Guid.Empty);
                 }
                 else
                 {
                     Global.LoginIDName   = (this.vTextBox_0.Text);
                     Global.GlobalAccount = account;
                     Global.RightsProfile = account.ApplicationRights;
                     this.Cursor          = Cursors.Default;
                     base.DialogResult    = DialogResult.OK;
                     if (account.IsPwdReset.Value)
                     {
                         PwdReset pwdReset = new PwdReset()
                         {
                             AccountID = account.Id
                         };
                         if (pwdReset.ShowDialog(this) == DialogResult.Cancel)
                         {
                             Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.PASSWORD, string.Concat("Password reset canceled: ", this.vTextBox_0.Text), account.Id);
                             base.DialogResult = DialogResult.Cancel;
                             base.Close();
                         }
                         Logger.Logging.WriteAccountLog(VMGlobal.LOG_ACTION.PASSWORD, string.Concat("Password reset: ", this.vTextBox_0.Text), account.Id);
                     }
                     base.DialogResult = DialogResult.OK;
                     base.Close();
                 }
             }
             this.Cursor = Cursors.Default;
         }
     }
     catch (Exception exception)
     {
     }
     if (!Global.LockLogin)
     {
         this.vTextBox_0.Text = string.Empty;
     }
     this.lbl_loginMsg.Text = string.Empty;
     this.txtPwd.Text       = string.Empty;
     this.vTextBox_0.Select();
     this.Cursor = Cursors.Default;
 }
Beispiel #26
0
        private void Export()
        {
            this.FileFolders.Clear();
            Stopwatch stopwatch = new Stopwatch();
            int       num       = 0;

            if (FileID.Count > 0)
            {
                stopwatch.Start();
                progBar.Maximum = FileID.Count;
                using (RPM_DataFile rPMDataFile = new RPM_DataFile())
                {
                    foreach (Guid fileID in FileID)
                    {
                        progFile.Value = 0;
                        DataFile   dataFile    = rPMDataFile.GetDataFile(fileID);
                        string     folderPath  = FolderPath;
                        ExportForm exportForm  = this;
                        int        folderCount = exportForm.FolderCount;
                        int        num1        = folderCount;
                        exportForm.FolderCount = folderCount + 1;
                        FolderName             = Path.Combine(folderPath, string.Format("FILE_{0}", num1));
                        if (!Directory.Exists(FolderName))
                        {
                            Directory.CreateDirectory(FolderName);
                            Network.SetAcl(FolderName);
                        }
                        FileFolders.Add(FolderName);
                        ListItem     listItem1     = new ListItem();
                        vProgressBar _vProgressBar = progBar;
                        ExportForm   exportForm1   = this;
                        int          fileCount     = exportForm1.FileCount;
                        int          num2          = fileCount;
                        exportForm1.FileCount = fileCount + 1;
                        _vProgressBar.Value   = num2;
                        progBar.Invalidate();
                        Application.DoEvents();
                        picThumbnail.Image = Utilities.ByteArrayToImage(dataFile.Thumbnail);
                        picThumbnail.Invalidate();
                        Application.DoEvents();
                        WriteFileInfo(dataFile);
                        CopyFile(dataFile);
                        listItem1.Text = string.Format("Export: {0}", string.Concat(dataFile.OriginalFileName, dataFile.FileExtension));
                        HashAlgorithm sHA1 = HashAlgorithms.SHA1;
                        switch (dataFile.HashAlgorithm)
                        {
                        case HASH_ALGORITHM.MD5:
                        {
                            sHA1 = HashAlgorithms.MD5;
                            break;
                        }

                        case HASH_ALGORITHM.SHA1:
                        {
                            sHA1 = HashAlgorithms.SHA1;
                            break;
                        }

                        case HASH_ALGORITHM.SHA256:
                        {
                            sHA1 = HashAlgorithms.SHA256;
                            break;
                        }

                        case HASH_ALGORITHM.SHA384:
                        {
                            sHA1 = HashAlgorithms.SHA384;
                            break;
                        }

                        case HASH_ALGORITHM.SHA512:
                        {
                            sHA1 = HashAlgorithms.SHA512;
                            break;
                        }

                        case HASH_ALGORITHM.RIPEMD160:
                        {
                            sHA1 = HashAlgorithms.RIPEMD160;
                            break;
                        }
                        }
                        string hashFromFile = Hash.GetHashFromFile(TargetFileName, sHA1);
                        BeginInvoke(new MethodInvoker(() => {
                            lblExportFileName.Text = string.Concat(dataFile.OriginalFileName, dataFile.FileExtension);
                            lblExportHash.Text     = Convert.ToString(hashFromFile);
                        }));
                        if (!hashFromFile.Equals(dataFile.FileHashCode))
                        {
                            num++;
                            listItem1.Description = string.Format(LangCtrl.GetString("txt_FileHashFail", "File validate Failed {0} x {1}"), dataFile.FileHashCode, hashFromFile);
                            listItem1.ImageIndex  = 2;
                            vListBox.Items.Insert(listItem1, 0);
                        }
                        else
                        {
                            listItem1.ImageIndex  = 1;
                            listItem1.Description = string.Format(LangCtrl.GetString("txt_HashVerified", "File Hash code Verified: {0}"), hashFromFile);
                        }
                        vListBox.Items.Insert(listItem1, 0);
                        CopyMemos(dataFile);
                        CopyThumbnails(dataFile);
                        Global.Log("EXPORT", string.Format(LangCtrl.GetString("txt_DiscExport", "Export: {0}{1} - {2}"), dataFile.StoredFileName, dataFile.FileExtension, dataFile.ShortDesc));
                        Application.DoEvents();
                        int num3 = 0;
                        try
                        {
                            using (RPM_Snapshot rPMSnapshot = new RPM_Snapshot())
                            {
                                List <Snapshot> snapshots = rPMSnapshot.GetSnapshots(fileID);
                                if (snapshots.Count > 0)
                                {
                                    foreach (Snapshot snapshot in snapshots)
                                    {
                                        string str1 = Path.Combine(snapshot.UNCName, snapshot.UNCPath);
                                        SourceFileName = Network.FormatPath(Path.Combine(str1, snapshot.StoredFileName));
                                        string str2 = string.Concat("Snapshot_", num3, snapshot.FileExtension);
                                        TargetFileName = Path.Combine(FolderName, str2);
                                        if (!File.Exists(SourceFileName))
                                        {
                                            continue;
                                        }
                                        File.Copy(SourceFileName, TargetFileName, true);
                                        num3++;
                                    }
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                    if (EFD.IsZipFile)
                    {
                        BeginInvoke(new MethodInvoker(() => {
                            ListItem listItem = new ListItem()
                            {
                                ImageIndex = 5,
                                Text       = LangCtrl.GetString("txt_SecuringFiles", "Securing Selected Files...Please wait...")
                            };
                            vListBox.Items.Insert(listItem, 0);
                        }));
                        if (EFD.ZipName.Contains("."))
                        {
                            EFD.ZipName = this.EFD.ZipName.Substring(0, this.EFD.ZipName.IndexOf('.'));
                        }
                        //TODO : ref
                        ExportFileData eFD = EFD;
                        eFD.ZipName = string.Concat(eFD.ZipName, ".zip");
                        if (Zip.ZipFolders(this.FileFolders, Path.Combine(this.FolderPath, this.EFD.ZipName), this.EFD.ZipPwd))
                        {
                            Global.Log("EXPORT_ZIP", string.Format(LangCtrl.GetString("txt_ExportSecure", "Export secure file {0}"), Path.Combine(this.FolderPath, this.EFD.ZipName)));
                            foreach (string fileFolder in this.FileFolders)
                            {
                                Directory.Delete(fileFolder, true);
                            }
                        }
                    }
                    stopwatch.Stop();
                    base.BeginInvoke(new MethodInvoker(() => {
                        this.picThumbnail.Image     = null;
                        this.lblExportFileName.Text = string.Empty;
                        this.lblExportHash.Text     = string.Empty;
                        TimeSpan timeSpan           = TimeSpan.FromMilliseconds((double)stopwatch.ElapsedMilliseconds);
                        string str        = string.Format("{0:D2}:{1:D2}:{2:D2}.{3:D2}", new object[] { timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds, timeSpan.Milliseconds });
                        ListItem listItem = new ListItem();
                        if (this.EFD.IsZipFile)
                        {
                            listItem.ImageIndex = 5;
                            listItem.Text       = string.Format(LangCtrl.GetString("txt_SecureFileCreated", "Secure File Created > {0}"), this.EFD.ZipName);
                            this.vListBox.Items.Insert(listItem, 0);
                        }
                        listItem = new ListItem();
                        if (!this.IsDVD)
                        {
                            listItem.ImageIndex = 3;
                            listItem.Text       = string.Format(LangCtrl.GetString("txt_ExportCompleted", "Export Completed > {0} Files in {1}"), this.FileID.Count, str);
                            Global.Log("EXPORT-COMPLETE", listItem.Text);
                        }
                        else
                        {
                            listItem.ImageIndex = 4;
                            listItem.Text       = string.Format(LangCtrl.GetString("txt_DiscPrep", "Disc Prep Completed > {0} Files in {1}"), this.FileID.Count, str);
                        }
                        listItem.Description = string.Format(LangCtrl.GetString("txt_ExportFileErrors", "File Errors: {0}"), num);
                        this.vListBox.Items.Insert(listItem, 0);
                        base.BeginInvoke(new MethodInvoker(() => {
                            this.lblExportFileName.Text = string.Empty;
                            this.lblExportHash.Text     = string.Empty;
                        }));
                    }));
                }
            }
            base.BeginInvoke(new MethodInvoker(() => {
                try
                {
                    if (!this.IsDVD)
                    {
                        this.picThumbnail.SizeMode = PictureBoxSizeMode.CenterImage;
                        this.picThumbnail.Image    = Properties.Resources.export;
                        this.lbl_FileName.Text     = LangCtrl.GetString("txt_FileExportCompleted", "File Export Completed...");
                        this.lbl_HashCode.Text     = string.Empty;
                    }
                    else
                    {
                        this.picThumbnail.SizeMode = PictureBoxSizeMode.CenterImage;
                        this.picThumbnail.Image    = Properties.Resources.burndisc;
                        this.lbl_FileName.Text     = LangCtrl.GetString("txt_RecToDisc", "Record Files to Disc...");
                        this.lbl_HashCode.Text     = string.Empty;
                        (new ExportCD()
                        {
                            RootFolder = this.TEMP_FOLDER
                        }).ShowDialog(this);
                        DirectoryInfo directoryInfo = new DirectoryInfo(this.TEMP_FOLDER);
                        FileInfo[] files            = directoryInfo.GetFiles();
                        for (int i = 0; i < (int)files.Length; i++)
                        {
                            files[i].Delete();
                        }
                        DirectoryInfo[] directories = directoryInfo.GetDirectories();
                        for (int j = 0; j < (int)directories.Length; j++)
                        {
                            directories[j].Delete(true);
                        }
                        Directory.Delete(this.TEMP_FOLDER);
                        this.BurnCompleteCallback();
                    }
                }
                catch
                {
                }
            }));
        }
Beispiel #27
0
 private void StartProcess()
 {
     this.IsDVD = false;
     if (string.IsNullOrEmpty(this.FolderPath))
     {
         this.IsDVD = true;
         base.BeginInvoke(new MethodInvoker(() => this.lblExportMessage.Text = LangCtrl.GetString("txt_ExportToDisc", "Export to Disc...")));
         Global.Log("EXPORT-CD", LangCtrl.GetString("txt_ExportToDisc", "Export to Disc"));
         this.GetTemporaryDirectory();
         this.FolderPath        = this.TEMP_FOLDER;
         this.EVT_BurnComplete -= new ExportForm.DEL_BurnComplete(this.ExportForm_EVT_BurnComplete);
         this.EVT_BurnComplete += new ExportForm.DEL_BurnComplete(this.ExportForm_EVT_BurnComplete);
     }
     this.Export();
 }
Beispiel #28
0
 private void SetLanguage()
 {
     LangCtrl.reText(this);
     this.Text = LangCtrl.GetString("dlg_Studio", "C3 Sentinel Studio");
 }
Beispiel #29
0
        private void MergeFiles()
        {
            string empty = string.Empty;
            int    num   = 0;

            if (this.media.Count > 0)
            {
                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();
                Network.SetAcl(this.VideoPath);
                using (RPM_VideoTag rPMVideoTag = new RPM_VideoTag())
                {
                    foreach (MediaFile medium in this.media)
                    {
                        this.TagList = rPMVideoTag.GetTagList(medium.FileID);
                        foreach (VideoTag tagList in this.TagList)
                        {
                            TimeSpan            timeSpan  = new TimeSpan(0, 0, Convert.ToInt32(tagList.StartTime));
                            TimeSpan            timeSpan1 = new TimeSpan(0, 0, Convert.ToInt32(tagList.EndTime));
                            string              str       = string.Format("{0:00}:{1:00}:{2:D2}", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
                            string              str1      = string.Format("{0:00}:{1:00}:{2:D2}", timeSpan1.Hours, timeSpan1.Minutes, timeSpan1.Seconds);
                            TimeSpan            timeSpan2 = timeSpan1 - timeSpan;
                            string              str2      = string.Format("{0:00}:{1:00}:{2:D2}", timeSpan2.Hours, timeSpan2.Minutes, timeSpan2.Seconds);
                            ListItemsCollection items     = this.vListBox.Items;
                            object[]            shortDesc = new object[] { tagList.ShortDesc, str, str1, str2 };
                            items.Insert(string.Format("{0} {1}-{2}  Len: {3}", shortDesc), 0);
                            string str3 = string.Format("{0}{1}", num, Path.GetExtension(medium.FileName));
                            try
                            {
                                ProcessStartInfo processStartInfo = new ProcessStartInfo()
                                {
                                    UseShellExecute = false,
                                    CreateNoWindow  = true,
                                    FileName        = Path.Combine(Directory.GetCurrentDirectory(), "ffmpeg.exe")
                                };
                                processStartInfo.CreateNoWindow = true;
                                object[] fileName = new object[] { str, medium.FileName, str2, this.VideoPath, str3 };
                                processStartInfo.Arguments = string.Format("-v 0 -y -ss {0} -i \"{1}\" -t {2} -c:v copy -c:a copy \"{3}\\{4}\"", fileName);
                                Process.Start(processStartInfo).WaitForExit();
                            }
                            catch (Exception exception1)
                            {
                                Exception exception = exception1;
                                this.vListBox.Items.Insert(exception.Message, 0);
                                MessageBox.Show(exception.Message);
                            }
                            string str4 = Path.Combine(this.VideoPath, str3);
                            if (!File.Exists(str4))
                            {
                                this.vListBox.Items.Insert(string.Format(LangCtrl.GetString("mv_ErrorCreating", "Error creating: {0}"), str3), 0);
                            }
                            else
                            {
                                this.tFiles.Add(string.Format("{0}", str4));
                                num++;
                            }
                        }
                    }
                    string[] strArrays = new string[this.tFiles.Count];
                    int      num1      = 0;
                    foreach (string tFile in this.tFiles)
                    {
                        if (!File.Exists(tFile))
                        {
                            continue;
                        }
                        strArrays[num1] = tFile;
                        num1++;
                    }
                    if ((int)strArrays.Length > 0)
                    {
                        string str5 = "MP4";
                        if (this.btnAVI.Checked)
                        {
                            str5 = "AVI";
                        }
                        if (this.btnMOV.Checked)
                        {
                            str5 = "MOV";
                        }
                        string str6 = string.Format("{0}\\{1}.{2}", this.VideoPath, this.txtName.Text, str5);
                        empty = str6;
                        this.vListBox.Items.Insert(LangCtrl.GetString("mv_Merging", "Merging Video Files...This may take a few minutes..."), 0);
                        Thread.Sleep(3000);
                        if ((int)strArrays.Length != 1)
                        {
                            try
                            {
                                ConcatSettings  concatSetting   = new ConcatSettings();
                                FFMpegConverter fFMpegConverter = new FFMpegConverter();
                                Thread.Sleep(1000);
                                fFMpegConverter.ConcatMedia(strArrays, str6, str5, concatSetting);
                            }
                            catch (Exception exception2)
                            {
                                this.vListBox.Items.Insert(exception2.Message, 0);
                            }
                        }
                        else
                        {
                            File.Move(strArrays[0], str6);
                        }
                    }
                    if (!this.chk_SaveSegments.Checked)
                    {
                        try
                        {
                            foreach (string tFile1 in this.tFiles)
                            {
                                if (!File.Exists(tFile1))
                                {
                                    continue;
                                }
                                File.Delete(tFile1);
                            }
                        }
                        catch (Exception exception3)
                        {
                            this.vListBox.Items.Insert(exception3.Message, 0);
                        }
                    }
                    stopwatch.Stop();
                    TimeSpan elapsed = stopwatch.Elapsed;
                    string   str7    = string.Format("{0:00}:{1:00}:{2:D2}", elapsed.Hours, elapsed.Minutes, elapsed.Seconds);
                    this.vListBox.Items.Insert(string.Format(LangCtrl.GetString("mv_MergeComplete", "{0} - File Merge completed. Elapsed Time {1}"), DateTime.Now, str7), 0);
                    if (File.Exists(empty) && Global.IsRights(Global.RightsProfile, UserRights.REDACT) && Global.IsRedact)
                    {
                        base.BeginInvoke(new MethodInvoker(() => {
                            if (MessageBox.Show(this, LangCtrl.GetString("mv_RedactVideo", "Redact video file?"), "Redact", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                try
                                {
                                    Global.Log("REDACT", string.Format("Redact Video Merge: {0}", empty));
                                    Process.Start(new ProcessStartInfo()
                                    {
                                        FileName  = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Redact/VideoEditor.exe"),
                                        Arguments = string.Concat("\"", empty, "\"")
                                    });
                                }
                                catch
                                {
                                }
                            }
                        }));
                    }
                }
                base.BeginInvoke(new MethodInvoker(() => {
                    this.btn_Close.Enabled   = true;
                    this.pictureBox1.Visible = false;
                }));
            }
        }