public ExplorerNode(string fp, string name, DateTime chg, explType tp, long sz, Icon ic = null) { this.fullpath = fp; this.Type = tp; this.EdsState = 0; InitializeComponent(); this.expl_name.Text = name; this.expl_chng_date.Text = chg.ToLongTimeString(); this.expl_type.Text = (tp == explType.File ? "Файл" : "Папка"); if (sz < 1024) { this.expl_size.Text = sz.ToString() + " Б"; } else { this.expl_size.Text = (sz / 1024).ToString() + " Кб"; } if (ic == null) { this.expl_ico.Source = new BitmapImage(new Uri("Images/ExplorerNode/Folder.png", UriKind.Relative)); } else { this.expl_ico.Source = SupportEDS.BitmapToImageSource(ic.ToBitmap()); } if (tp == explType.File) { this.expl_state.Visibility = Visibility.Visible; } }
private void Page_Loaded(object sender, RoutedEventArgs e) { if (File != null) { this.file_name.Text = File.File.Name; this.file_big_image.Source = SupportEDS.BitmapToImageSource(Icon.ExtractAssociatedIcon(File.File.FullName).ToBitmap()); this.file_extn_val.Text = File.File.Extension; this.file_desc_val.Text = File.File.Name; this.file_path_val.Text = File.File.DirectoryName; this.file_size_val.Text = SupportEDS.FileSizeFormat(File.File.Length, true); this.file_crat_val.Text = File.File.CreationTime.ToString("d MMMM yyyy г., h:mm:ss"); this.file_edit_val.Text = File.File.LastWriteTime.ToString("d MMMM yyyy г., h:mm:ss"); this.file_open_val.Text = File.File.LastAccessTime.ToString("d MMMM yyyy г., h:mm:ss"); if (File.EdsState == 0) { this.message_text.Text = "Цифровой подписи не обнаружено."; this.big_button_text.Text = "СОЗДАТЬ ПОДПИСЬ"; } else if (File.EdsState == 1) { this.message_text.Text = "Цифровая подпись присутствует."; this.big_button_text.Text = "ПРОВЕРИТЬ"; } else if (File.EdsState == 2) { this.message_text.Text = "Подлинность цифровой подписи подтверждена."; this.big_button_text.Text = "ПРОВЕРИТЬ"; } else if (File.EdsState == 3) { this.message_text.Text = "Подпись не соответствует документу."; this.big_button_text.Text = "ПРОВЕРИТЬ"; } } }