Esempio n. 1
0
        protected override void OnDrop(DragEventArgs e)
        {
            base.OnDrop(e);
            // If the DataObject contains string data, extract it.
            ConfigList par = this.Parent as ConfigList;

            if (e.Data.GetDataPresent("Object") &&
                par != null)
            {
                Object data_obj = (Object)e.Data.GetData("Object");
                List <LinuxTreeViewItem> list_ltvi = data_obj as List <LinuxTreeViewItem>;
                if (list_ltvi != null)
                {
                    foreach (LinuxTreeViewItem ltvi in list_ltvi)
                    {
                        if (this.work_name != null && this.index == null)
                        {
                            JObject jobj;
                            if (this.root["type"].ToString() == "file")
                            {
                                jobj = new JObject(new JProperty("enc_option", new JObject(new JProperty("input_dir", ltvi.Path))));
                            }
                            else
                            {
                                jobj = new JObject(new JProperty("comm_option", new JObject(new JProperty("input_dir", ltvi.Path))));
                            }

                            if (jobj != null)
                            {
                                JObject tmp_root = this.root.DeepClone() as JObject;
                                (tmp_root?["work_group"]?[work_name]?["processes"] as JArray)?.Add(jobj);
                                string tmp_index = this.Items.Count.ToString();

                                Window_Config wc = new Window_Config(tmp_root, this.work_name, tmp_index, true, ltvi.Path);
                                Point         pt = WindowMain.current.PointToScreen(new Point(WindowMain.current.Width - wc.Width, WindowMain.current.Height - wc.Height));
                                wc.Left = pt.X;
                                wc.Top  = pt.Y;
                                bool?retval = wc.ShowDialog();
                                if (retval == true)
                                {
                                    if (ltvi.IsDirectory)
                                    {
                                        (this.root?["work_group"]?[work_name]?["processes"] as JArray)?.Add(jobj);
                                        this.Items.Add(new ConfigInfoPanel(this.bnt_parent, this.root, this.work_name, tmp_index, ltvi.Path));
                                    }
                                    /* 암호화 */
                                    Console.WriteLine("JHLIM_DEBUG : Encrypt {0} {1} {2} [{3}]", this.root["type"], this.work_name, tmp_index, ltvi.Path);
                                }
                            }
                        }
                        else if (this.work_name != null && this.index != null)
                        {
                            ;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
 {
     base.OnMouseDoubleClick(e);
     if (e.ChangedButton == MouseButton.Left && this.IsChecked == true)
     {
         Window_Config wc = new Window_Config(this.Root);
         Point         pt = WindowMain.current.PointToScreen(new Point(WindowMain.current.Width - wc.Width, WindowMain.current.Height - wc.Height));
         wc.Left = pt.X;
         wc.Top  = pt.Y;
         wc.Show();
     }
     e.Handled = true;
 }
Esempio n. 3
0
 protected override void OnPreviewMouseDoubleClick(MouseButtonEventArgs e)
 {
     base.OnMouseDoubleClick(e);
     if (this.IsSelected && e.ChangedButton == MouseButton.Left)
     {
         Window_Config wc = new Window_Config(this.ConfigIdx?.JobjRoot, this.WorkName, this.ProcessIndex, path: this.ConfigIdx?.Path);
         Point         pt = WindowMain.current.PointToScreen(new Point(WindowMain.current.Width - wc.Width, WindowMain.current.Height - wc.Height));
         wc.Left = pt.X;
         wc.Top  = pt.Y;
         wc.Show();
         e.Handled = true;
     }
 }
Esempio n. 4
0
        protected override void OnPreviewMouseDoubleClick(MouseButtonEventArgs e)
        {
            base.OnMouseDoubleClick(e);
            if (e.ChangedButton == MouseButton.Left)
            {
                JObject root      = null;
                string  work_name = null;
                string  index     = null;

                root      = (this.SelectedItem as ConfigInfoPanel)?.root;
                work_name = (this.SelectedItem as ConfigInfoPanel)?.work_name;
                index     = (this.SelectedItem as ConfigInfoPanel)?.index;

                Window_Config wc = new Window_Config(root, work_name, index, path: (this.SelectedItem as ConfigInfoPanel)?.path);
                Point         pt = WindowMain.current.PointToScreen(new Point(WindowMain.current.Width - wc.Width, WindowMain.current.Height - wc.Height));
                wc.Left = pt.X;
                wc.Top  = pt.Y;
                wc.Show();
                e.Handled = true;
            }
        }
Esempio n. 5
0
        protected override void OnDrop(DragEventArgs e)
        {
            base.OnDrop(e);
            if (this.ConfigIdx?.JobjRoot == null)
            {
                return;
            }

            Object data_obj = (Object)e.Data.GetData("Object");
            List <LinuxTreeViewItem> list_ltvi = data_obj as List <LinuxTreeViewItem>;

            if (list_ltvi != null)
            {
                List <string> list_cofile_opt = new List <string>();
                int           i;
                for (i = 0; i < list_ltvi.Count; i++)
                {
                    LinuxTreeViewItem ltvi = list_ltvi[i];

                    string tmp_index = "";
                    bool?  retval    = false;
                    if (this.WorkName != null && this.ProcessIndex == null && ltvi.IsDirectory)
                    {
                        JObject jobj;
                        if (this.ConfigIdx?.Type == "file")
                        {
                            jobj = new JObject(new JProperty("enc_option", new JObject(new JProperty("input_dir", ltvi.Path))));
                        }
                        else
                        {
                            jobj = new JObject(new JProperty("comm_option", new JObject(new JProperty("input_dir", ltvi.Path))));
                        }
                        if (jobj != null)
                        {
                            JObject tmp_root = this.ConfigIdx?.JobjRoot.DeepClone() as JObject;
                            (tmp_root?["work_group"]?[WorkName]?["processes"] as JArray)?.Add(jobj);
                            tmp_index = this.Items.Count.ToString();

                            Window_Config wc = new Window_Config(tmp_root, this.WorkName, tmp_index, true, ltvi.Path);
                            Point         pt = WindowMain.current.PointToScreen(new Point(WindowMain.current.Width - wc.Width, WindowMain.current.Height - wc.Height));
                            wc.Left = pt.X;
                            wc.Top  = pt.Y;
                            retval  = wc.ShowDialog();
                            if (retval == true)
                            {
                                (this.ConfigIdx?.JobjRoot["work_group"]?[WorkName]?["processes"] as JArray)?.Add(jobj);
                                ConfigMenuTreeViewItem new_cip = new ConfigMenuTreeViewItem()
                                {
                                    ConfigIdx = new ConfigMenuModel(this.ConfigIdx?.JobjRoot)
                                    {
                                        WorkName = this.WorkName, ProcessIndex = tmp_index
                                    }
                                };
                                this.Items.Add(new_cip);

                                //string cofile_type = this.root["type"].ToString();
                                //string config_info = WindowMain.current?.enableConnect?.sshManager?.EnvCoHome + "/var/conf/test/" + cofile_type + ".json";
                                //WindowMain.current?.enableConnect?.sshManager?.NewSendNRecvCofileCommand(list_ltvi, true, config_info, cofile_type);
                                Console.WriteLine("JHLIM_DEBUG : Encrypt {0} {1} {2} [{3}]", this.ConfigIdx?.Type, this.WorkName, tmp_index, ltvi.Path);

                                //string config_info = new_cip.work_name;
                                //if(new_cip.index != null)
                                //	config_info += "_" + new_cip.index;
                                string config_info = "/home/test/var/conf/test/" + this.ConfigIdx?.Type + ".json";
                                list_cofile_opt.Add("-c " + config_info);
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                    else
                    {
                        //string config_info = this.work_name;
                        //if(this.index != null)
                        //	config_info += "_" + this.index;
                        string config_info = "/home/test/var/conf/test/" + this.ConfigIdx?.Type + ".json";
                        if (ltvi.IsDirectory)
                        {
                            list_cofile_opt.Add("-c " + config_info + " -id " + ltvi.Path + " -od " + ltvi.Path);
                        }
                        else
                        {
                            string dir = ltvi.Path.Substring(0, ltvi.Path.Length - ltvi.FileName.Length);
                            list_cofile_opt.Add("-c " + config_info + " -id " + dir + " -od " + dir + " -f " + ltvi.FileName);
                        }
                    }
                }
                if (i == list_ltvi.Count)
                {
                    RequestEncryption(list_cofile_opt);
                }
            }
            e.Handled = true;
        }