Example #1
0
        private void onCopyButtonPressed()
        {
            var copyWindow = new CopyWindow();

            App.app.Close();
            App.app = copyWindow;
            App.app.Show();
        }
Example #2
0
        private void btnCopyDialog_Click(object sender, RoutedEventArgs e)
        {
            CopyWindow cw = new CopyWindow();

            cw.ShowDialog();

            //GongSolutions.Wpf.DragDrop.Utilities.
        }
Example #3
0
        private static void ShowFileHash(ManifestFileGridItem item)
        {
            try
            {
                var crc = Merlion.ECR.Update.Core_2_0.Utilites.GetFileHash(item.FileInfo.FullName);

                var window = new CopyWindow("CRC", crc);
                window.ShowDialog();
            }
            catch (Exception ex)
            {
                LogAndShow("Возникло исключение при выводе хеша файла", ex);
            }
        }
Example #4
0
        private static void ShowPublicKeyToken(ManifestFileGridItem item)
        {
            try
            {
                var pkt = Merlion.ECR.Update.Core_2_0.Utilites.GetPublicKeyToken(item.FileInfo.FullName);

                var window = new CopyWindow("Токен публичного ключа", pkt);

                window.ShowDialog();
            }
            catch (Exception ex)
            {
                LogAndShow("Возникло исключение при показе Токена первичного ключа", ex);
            }
        }
Example #5
0
        private static void ShowAddinName(ManifestFileGridItem item)
        {
            try
            {
                string name = string.Empty;
                using (var asm = SeparatedAssembly.Load(item.FileInfo))
                {
                    name = asm.GetControlAddinName();

                    if (asm.HasException)
                    {
                        throw new InvalidOperationException("Возникло исключение при получении имени Add-In'а", asm.LastEx);
                    }
                }

                var window = new CopyWindow("Имя Add-In'a", name);
                window.ShowDialog();
            }
            catch (Exception ex)
            {
                LogAndShow("Возникло исключение при показе Имени AddIn'a", ex);
            }
        }
Example #6
0
        private void lvFileList_Drop(object sender, DragEventArgs e)
        {
            if (isListViewDroped)
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                    List <FileSystemInfo> fsiList = new List <FileSystemInfo>();
                    foreach (var f in files)
                    {
                        FileSystemInfo fsi = null;

                        if (Directory.Exists(f))
                        {
                            fsi = new DirectoryInfo(f);
                        }
                        else if (File.Exists(f))
                        {
                            fsi = new FileInfo(f);
                        }
                        else
                        {
                            throw new Exception("Its not a directory and not a file!");
                        }

                        fsiList.Add(fsi);
                    }


                    CopyWindow cw = new CopyWindow(fsiList, this.Path);
                    cw.ShowDialog();
                }

                //DataObject dObj = (DataObject)e.Data;

                //if (dObj.GetDataPresent(typeof(List<CustomFileSystemCover>)))
                //{
                //    // If the desired data format is present, use one of the GetData methods to retrieve the
                //    // data from the data object.
                //    List<CustomFileSystemCover> selectedList = dObj.GetData(typeof(List<CustomFileSystemCover>))
                //        as List<CustomFileSystemCover>;

                //    //MessageBox.Show(selectedList[0].Name);
                //    List<FileSystemInfo> fsiList = new List<FileSystemInfo>();

                //    foreach (var sl in selectedList)
                //    {
                //        if (sl.FileSystemElement.GetType() == typeof(DirectoryInfo))
                //        {
                //            fsiList.Add(new DirectoryInfo(sl.FileSystemElement.FullName));
                //        }
                //        else if (sl.FileSystemElement.GetType() == typeof(FileInfo))
                //        {
                //            fsiList.Add(new FileInfo(sl.FileSystemElement.FullName));
                //        }
                //        else
                //        {
                //            new Exception("Type not support!");
                //        }
                //    }

                //    CopyWindow cw = new CopyWindow(fsiList, this.Path);
                //    cw.ShowDialog();

                //}
            }

            //DataObject dObj = (DataObject)e.Data;

            //if (dObj.GetDataPresent(typeof(List<CustomFileSystemCover>)))
            //{
            //    // If the desired data format is present, use one of the GetData methods to retrieve the
            //    // data from the data object.
            //    List<CustomFileSystemCover> selectedList = dObj.GetData(typeof(List<CustomFileSystemCover>))
            //        as List<CustomFileSystemCover>;

            //    MessageBox.Show(selectedList[0].Name + " lv");

            //    selectedList = null;
            //}
        }
Example #7
0
        //private static Point dropPoint;

        private void ListViewItem_Drop(Object sender, DragEventArgs e)
        {
            // var p = e.GetPosition(this);

            // int mov = 55;
            // bool xM = p.X > dropPoint.X - mov;
            // bool xB = p.X < dropPoint.X + mov;
            // bool yM = p.Y > dropPoint.Y - mov;
            // bool yB = p.Y < dropPoint.Y + mov;

            // bool rt = (xM && xB && yM && yB);

            // if (rt)  return;

            //SystemParameters.mi

            ListViewItem lvi = (ListViewItem)sender;

            if (lvi.Content != null)
            {
                object content = lvi.Content;
                lvi.Opacity = 1;

                //var fff = e.Data.GetDataPresent(DataFormats.FileDrop);

                if (content.GetType() == typeof(DirectoryCover))
                {
                    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                    {
                        string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                        List <FileSystemInfo> fsiList = new List <FileSystemInfo>();
                        foreach (var f in files)
                        {
                            FileSystemInfo fsi = null;

                            if (Directory.Exists(f))
                            {
                                fsi = new DirectoryInfo(f);
                            }
                            else if (File.Exists(f))
                            {
                                fsi = new FileInfo(f);
                            }
                            else
                            {
                                throw new Exception("Its not a directory and not a file!");
                            }

                            fsiList.Add(fsi);
                        }
                        isListViewDroped = false;
                        DirectoryCover dc = (DirectoryCover)lvi.Content;

                        CopyWindow cw = new CopyWindow(fsiList, dc.FileSystemElement.FullName);
                        cw.ShowDialog();
                        //string[] files = (string[])dObj.GetData(DataFormats.FileDrop);
                        // MessageBox.Show(files.ToString());
                    }
                }
            }



            //ListViewItem lvi = (ListViewItem)sender;

            //if (lvi.Content != null)
            //{
            //    object content = lvi.Content;
            //    if (content.GetType() == typeof(DirectoryCover))
            //    {
            //        if (e.Effects == DragDropEffects.Move)
            //        {
            //            lvi.Opacity = 1;
            //            DataObject dObj = (DataObject)e.Data;

            //            //Делаем не возможным обрабатывать Drop lvFileList
            //            this.isListViewDroped = false;

            //            if (dObj.GetDataPresent(typeof(List<CustomFileSystemCover>)))
            //            {
            //                // If the desired data format is present, use one of the GetData methods to retrieve the
            //                // data from the data object.
            //                List<CustomFileSystemCover> selectedList = dObj.GetData(typeof(List<CustomFileSystemCover>))
            //                    as List<CustomFileSystemCover>;

            //                //MessageBox.Show(selectedList[0].Name);
            //                List<FileSystemInfo> fsiList = new List<FileSystemInfo>();

            //                foreach (var sl in selectedList)
            //                {
            //                    if (sl.FileSystemElement.GetType() == typeof(DirectoryInfo))
            //                    {
            //                        fsiList.Add(new DirectoryInfo(sl.FileSystemElement.FullName));
            //                    }
            //                    else if (sl.FileSystemElement.GetType() == typeof(FileInfo))
            //                    {
            //                        fsiList.Add(new FileInfo(sl.FileSystemElement.FullName));
            //                    }
            //                    else
            //                    {
            //                        new Exception("Type not support!");
            //                    }
            //                }
            //                DirectoryCover dc = (DirectoryCover)lvi.Content;


            //                CopyWindow cw = new CopyWindow(fsiList, dc.FileSystemElement.FullName);
            //                cw.ShowDialog();
            //            }
            //        }
            //    }
            //}
        }
Example #8
0
        private void lvFileList_Drop(object sender, DragEventArgs e)
        {
            if (isListViewDroped)
            {
                if (e.Data.GetDataPresent(DataFormats.FileDrop))
                {
                    string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                    List<FileSystemInfo> fsiList = new List<FileSystemInfo>();
                    foreach (var f in files)
                    {
                        FileSystemInfo fsi = null;

                        if (Directory.Exists(f))
                        {
                            fsi = new DirectoryInfo(f);
                        }
                        else if (File.Exists(f))
                        {
                            fsi = new FileInfo(f);
                        }
                        else
                        {
                            throw new Exception("Its not a directory and not a file!");
                        }

                        fsiList.Add(fsi);
                    }

                    CopyWindow cw = new CopyWindow(fsiList, this.Path);
                    cw.ShowDialog();
                }

                //DataObject dObj = (DataObject)e.Data;

                //if (dObj.GetDataPresent(typeof(List<CustomFileSystemCover>)))
                //{
                //    // If the desired data format is present, use one of the GetData methods to retrieve the
                //    // data from the data object.
                //    List<CustomFileSystemCover> selectedList = dObj.GetData(typeof(List<CustomFileSystemCover>))
                //        as List<CustomFileSystemCover>;

                //    //MessageBox.Show(selectedList[0].Name);
                //    List<FileSystemInfo> fsiList = new List<FileSystemInfo>();

                //    foreach (var sl in selectedList)
                //    {
                //        if (sl.FileSystemElement.GetType() == typeof(DirectoryInfo))
                //        {
                //            fsiList.Add(new DirectoryInfo(sl.FileSystemElement.FullName));
                //        }
                //        else if (sl.FileSystemElement.GetType() == typeof(FileInfo))
                //        {
                //            fsiList.Add(new FileInfo(sl.FileSystemElement.FullName));
                //        }
                //        else
                //        {
                //            new Exception("Type not support!");
                //        }
                //    }

                //    CopyWindow cw = new CopyWindow(fsiList, this.Path);
                //    cw.ShowDialog();

                //}
            }

            //DataObject dObj = (DataObject)e.Data;

            //if (dObj.GetDataPresent(typeof(List<CustomFileSystemCover>)))
            //{
            //    // If the desired data format is present, use one of the GetData methods to retrieve the
            //    // data from the data object.
            //    List<CustomFileSystemCover> selectedList = dObj.GetData(typeof(List<CustomFileSystemCover>))
            //        as List<CustomFileSystemCover>;

            //    MessageBox.Show(selectedList[0].Name + " lv");

            //    selectedList = null;
            //}
        }
Example #9
0
        //private static Point dropPoint;
        private void ListViewItem_Drop(Object sender, DragEventArgs e)
        {
            // var p = e.GetPosition(this);

               // int mov = 55;
               // bool xM = p.X > dropPoint.X - mov;
               // bool xB = p.X < dropPoint.X + mov;
               // bool yM = p.Y > dropPoint.Y - mov;
               // bool yB = p.Y < dropPoint.Y + mov;

               // bool rt = (xM && xB && yM && yB);

               // if (rt)  return;

               //SystemParameters.mi

            ListViewItem lvi = (ListViewItem)sender;
            if (lvi.Content != null)
            {
                object content = lvi.Content;
                lvi.Opacity = 1;

                //var fff = e.Data.GetDataPresent(DataFormats.FileDrop);

                if (content.GetType() == typeof(DirectoryCover))
                {
                    if (e.Data.GetDataPresent(DataFormats.FileDrop))
                    {
                        string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                        List<FileSystemInfo> fsiList = new List<FileSystemInfo>();
                        foreach (var f in files)
                        {
                            FileSystemInfo fsi = null;

                            if (Directory.Exists(f))
                            {
                                fsi = new DirectoryInfo(f);
                            }
                            else if (File.Exists(f))
                            {
                                fsi = new FileInfo(f);
                            }
                            else
                            {
                                throw new Exception("Its not a directory and not a file!");
                            }

                            fsiList.Add(fsi);
                        }
                        isListViewDroped = false;
                        DirectoryCover dc = (DirectoryCover)lvi.Content;

                        CopyWindow cw = new CopyWindow(fsiList, dc.FileSystemElement.FullName);
                        cw.ShowDialog();
                        //string[] files = (string[])dObj.GetData(DataFormats.FileDrop);
                        // MessageBox.Show(files.ToString());
                    }
                }

            }

            //ListViewItem lvi = (ListViewItem)sender;

            //if (lvi.Content != null)
            //{
            //    object content = lvi.Content;
            //    if (content.GetType() == typeof(DirectoryCover))
            //    {
            //        if (e.Effects == DragDropEffects.Move)
            //        {
            //            lvi.Opacity = 1;
            //            DataObject dObj = (DataObject)e.Data;

            //            //Делаем не возможным обрабатывать Drop lvFileList
            //            this.isListViewDroped = false;

            //            if (dObj.GetDataPresent(typeof(List<CustomFileSystemCover>)))
            //            {
            //                // If the desired data format is present, use one of the GetData methods to retrieve the
            //                // data from the data object.
            //                List<CustomFileSystemCover> selectedList = dObj.GetData(typeof(List<CustomFileSystemCover>))
            //                    as List<CustomFileSystemCover>;

            //                //MessageBox.Show(selectedList[0].Name);
            //                List<FileSystemInfo> fsiList = new List<FileSystemInfo>();

            //                foreach (var sl in selectedList)
            //                {
            //                    if (sl.FileSystemElement.GetType() == typeof(DirectoryInfo))
            //                    {
            //                        fsiList.Add(new DirectoryInfo(sl.FileSystemElement.FullName));
            //                    }
            //                    else if (sl.FileSystemElement.GetType() == typeof(FileInfo))
            //                    {
            //                        fsiList.Add(new FileInfo(sl.FileSystemElement.FullName));
            //                    }
            //                    else
            //                    {
            //                        new Exception("Type not support!");
            //                    }
            //                }
            //                DirectoryCover dc = (DirectoryCover)lvi.Content;

            //                CopyWindow cw = new CopyWindow(fsiList, dc.FileSystemElement.FullName);
            //                cw.ShowDialog();
            //            }
            //        }
            //    }
            //}
        }
Example #10
0
        private void btnCopyDialog_Click(object sender, RoutedEventArgs e)
        {
            CopyWindow cw = new CopyWindow();
            cw.ShowDialog();

            //GongSolutions.Wpf.DragDrop.Utilities.
        }