Exemple #1
0
        protected override void OnEvent()
        {
            base.OnEvent();

            List <ExplorerDialogFilter> filters = new List <ExplorerDialogFilter>();

            filters.Add(new OpenFeatureDatasetOrFolder());

            ExplorerDialog exDlg = new ExplorerDialog("New Target Featureclass",
                                                      filters,
                                                      true);

            if (exDlg.ShowDialog() == DialogResult.OK &&
                exDlg.ExplorerObjects.Count == 1)
            {
                if (_exapp.MoveToTreeNode(exDlg.ExplorerObjects[0].FullName))
                {
                    Paste paste = new Paste();

                    //var data = Clipboard.GetDataObject();
                    //var task = Task.Run(async () =>
                    //  {
                    //      await Task.Delay(3000);
                    //      if (Clipboard.GetDataObject()==null)
                    //      {
                    //          Clipboard.SetDataObject(data);
                    //      }

                    //      paste.OnCreate(_exapp);
                    //      await paste.OnEvent(null);
                    //  });

                    paste.OnCreate(_exapp);
                    paste.OnEvent(null);
                }
            }
        }
Exemple #2
0
        protected override void OnEvent()
        {
            base.OnEvent();

            List <ExplorerDialogFilter> filters = new List <ExplorerDialogFilter>();

            filters.Add(new OpenFeatureDatasetOrFolder());

            ExplorerDialog exDlg = new ExplorerDialog("New Target Featureclass",
                                                      filters,
                                                      true);

            if (exDlg.ShowDialog() == DialogResult.OK &&
                exDlg.ExplorerObjects.Count == 1)
            {
                if (_exapp.MoveToTreeNode(exDlg.ExplorerObjects[0].FullName))
                {
                    Paste paste = new Paste();
                    paste.OnCreate(_exapp);

                    paste.OnEvent(null);
                }
            }
        }