Shuxia Ning
2025-01-16 f0cebbd2deb4dbf9e89dac4768415de62fd1fc20
泵图表 修改文字位置
已修改4个文件
已添加6个文件
1112 ■■■■■ 文件已修改
Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextSelDlg.Designer.cs 368 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextSelDlg.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextSelDlg.resx 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextUIHelper.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardTextHelper.cs 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/使用黏贴板.txt 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Service/HStation.Service.Revit.Core/04-service/01-json/RevitJsonHelper.cs
@@ -21,8 +21,8 @@
                msg = "Revit json å­—符串为空";
                return default;
            }
            try
            {
            //try
            //{
                var model = new Model.RevitModel();
                //解析结构json
@@ -260,12 +260,12 @@
                }
                return model;
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                return default;
            }
            //}
            //catch (Exception ex)
            //{
            //    msg = ex.Message;
            //    return default;
            //}
        }
@@ -5656,6 +5656,11 @@
                {
                    exchanger.Elev = elevOfElevation / 1000f;
                    var jre = jobject[RevitJsonProp.Elev];
                    if (!jre.HasValues)
                    {
                    }
                    if (jre != null)
                    {
                        if (jre[RevitJsonProp.ElevFacade].MatchNumeric(out double facade))
WinFrmUI/HStation.WinFrmUI.PhartRelation.Core/01-pump/01-view/PumpChartViewCtrl.cs
@@ -16,9 +16,11 @@
            this.barCekPowerVisible.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            this.barCekEqVisible.Checked = true;
            this.barCekEqVisible.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            this.pumpViewChart1.AnnotationChangedEvent += PumpViewChart1_AnnotationChangedEvent;
        }
        private Yw.Vmo.PhartDiagramExGraphListVmo _vmo = null;
        private List<Yw.WinFrmUI.Phart.PumpViewChartViewModel> _vm_list = null;
@@ -175,6 +177,7 @@
                        case Yw.Ahart.eCurveType.QH: vm.Color = Yw.WinFrmUI.Phart.PumpChartDisplay.CurveColorQH; break;
                        case Yw.Ahart.eCurveType.QP: vm.Color = Yw.WinFrmUI.Phart.PumpChartDisplay.CurveColorQP; break;
                        case Yw.Ahart.eCurveType.QE: vm.Color = Yw.WinFrmUI.Phart.PumpChartDisplay.CurveColorQE; break;
                        case Yw.Ahart.eCurveType.EqualE: vm.Color = Color.DarkGreen; break;
                    }
                }
@@ -183,8 +186,7 @@
        }
        /// <summary>
        /// ç»‘定数据
        /// </summary>
@@ -300,6 +302,11 @@
            this.pumpViewChart1.SetEquip(equip_pt_list, pump_sect_pt);
        }
        private void PumpViewChart1_AnnotationChangedEvent((long DbId, string Tag, double X, double Y) info)
        {
            Update(info);
        }
        private void barImgCmbChartSel_EditValueChanged(object sender, EventArgs e)
        {
@@ -804,6 +811,39 @@
            SetEquip();
        }
        private async void Update((long DbId, string Tag, double X, double Y) info)
        {
            var bll = new Yw.BLL.PhartGraph();
            var vm = _vm_list.Find(x => x.DbId == info.DbId);
            if (vm == null)
                return;
            var annotation = vm.AnnotationList.Find(x => x.Tag == info.Tag);
            if (annotation == null)
                return;
            annotation.X = info.X;
            annotation.Y = info.Y;
            var paras = vm.AnnotationList.ToJson();
            var bol = await bll.UpdateAnnotationParas(info.DbId, paras);
            if (!bol)
            {
                TipFormHelper.ShowError($"{annotation.Text}更新失败!");
                return;
            }
            //var newVmo = await new Yw.BLL.PhartDiagramExtensions().GetByID(_vmo.ID);
            //if (newVmo == null)
            //{
            //    TipFormHelper.ShowWarn("获取失败!");
            //    return;
            //}
            //SetBindingData(newVmo, _nr);
            //SetEquip();
        }
        private async void Delete(List<(long Id, double Basis)> graph_ids)
        {
            if (graph_ids == null || !graph_ids.Any())
@@ -818,7 +858,7 @@
                if (!bol)
                {
                    err_hz_list.Add(graph_info.Basis);
                    return;
                    continue;
                }
            }
            if (err_hz_list != null && err_hz_list.Any())
WinFrmUI/Yw.WinFrmUI.Phart.Core/01-pump/01-view/PumpViewChart.cs
@@ -86,6 +86,20 @@
        #endregion
        #region Public Evnet
        /// <summary>
        /// åæ ‡å˜æ¢äº‹ä»¶
        /// </summary>
        public event Action<PumpCoordinate> CoordinateChangedEvent = null;
        /// <summary>
        /// æŸ¥è¯¢ç‚¹å˜æ¢äº‹ä»¶
        /// </summary>
        public event Action<(long DbId,string Tag,double X,double Y)> AnnotationChangedEvent = null;
        #endregion
        #region Private Initial
        /// <summary>
@@ -95,7 +109,7 @@
        {
            this.chartControl1.SetChartDisplay();
            this.chartControl1.RuntimeHitTesting = true;
            this.chartControl1.AnimationStartMode = ChartAnimationMode.OnLoad;
            //this.chartControl1.AnimationStartMode = ChartAnimationMode.OnLoad;
            this.chartControl1.ObjectHotTracked += new DevExpress.XtraCharts.HotTrackEventHandler(this.chartControl1_ObjectHotTracked);
            this.chartControl1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseMove);
@@ -103,7 +117,8 @@
            this.chartControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chartControl1_MouseDown);
            this.chartControl1.Resize += new System.EventHandler(this.chartControl1_Resize);
            this.chartControl1.CustomPaint += ChartControl1_CustomPaint;
            _diagram = (XYDiagram)this.chartControl1.Diagram;
            _default_pane = _diagram.DefaultPane;
@@ -142,8 +157,9 @@
            _anno_txt_query_info.SetTextAnnoWorkPointDisplay();
            _anno_txt_query_info.Visible = false;
        }
        /// <summary>
        /// åˆå§‹åŒ–坐标轴
@@ -189,7 +205,9 @@
        }
        private bool _on_move_x_line = false;
        private bool _on_move_y_line = false;
        private bool _on_move_y_line = false;
        private bool _on_move_annotation = false;
        private TextAnnotation _on_move_annotation_obj = null;
        private void chartControl1_MouseDown(object sender, MouseEventArgs e)
        {
            if (!_initial_data)
@@ -209,11 +227,19 @@
                        _on_move_y_line = true;
                    }
                }
                else if (hitInfo.InAnnotation)
                {
                    if (hitInfo.Annotation.Tag is not string id)
                        return;
                    if (!long.TryParse(id, out long db_id))
                        return;
                    _on_move_annotation = true;
                    _on_move_annotation_obj = (TextAnnotation)hitInfo.Annotation;
                }
            }
        }
        private void chartControl1_MouseMove(object sender, MouseEventArgs e)
        {
@@ -228,7 +254,6 @@
                    return;
                double chartQ = axis_value.NumericalValue;
                SetAxisXValue(chartQ);
            }
            else if (_on_move_y_line)
            {
@@ -256,14 +281,49 @@
                    this.chartControl1.Cursor = Cursors.Default;
                }
            }
        }
        private void chartControl1_MouseUp(object sender, MouseEventArgs e)
        {
            if (!_initial_data)
                return;
            if (_on_move_annotation && _on_move_annotation_obj != null)
            {
                if (this.AnnotationChangedEvent != null)
                {
                    var db_id = Convert.ToInt64(_on_move_annotation_obj.Tag);
                    var pane_anchor_pt = _on_move_annotation_obj.AnchorPoint as PaneAnchorPoint;
                    if (pane_anchor_pt != null)
                    {
                        var diagram_coordinates = _diagram.PointToDiagram(e.Location);
                        AxisValue axis_x_value= diagram_coordinates.GetAxisValue(_axis_x_flow);
                        AxisValue axis_y_value = diagram_coordinates.GetAxisValue(pane_anchor_pt.AxisYCoordinate.Axis);
                        if (axis_x_value==null|| axis_y_value==null)
                        {
                            return;
                        }
                        var tag = pane_anchor_pt.Tag?.ToString() ?? null;
                        var x = axis_x_value.NumericalValue;
                        var y = axis_y_value.NumericalValue;
                        pane_anchor_pt.AxisXCoordinate.AxisValue = x;
                        pane_anchor_pt.AxisYCoordinate.AxisValue = y;
                        this.AnnotationChangedEvent?.Invoke((db_id, tag, x, y));
                    }
                }
            }
            _on_move_x_line = false;
            _on_move_y_line = false;
            _on_move_annotation = false;
            _on_move_annotation_obj = null;
        }
        private void chartControl1_Resize(object sender, EventArgs e)
@@ -495,14 +555,14 @@
                    axis_x = _axis_x_flow;
                    axis_y = _axis_y_power;
                    pane = _split_panel? _bottom_pane: _default_pane; 
                }
                }
                if (vm.AnnotationList != null && vm.AnnotationList.Any())
                {
                    foreach (var name in vm.AnnotationList)
                    {
                        AddAnnotation(vm.Id, name.Text, vm.Color, axis_y, pane, new Geometry.Point2d(name.X, name.Y), -40);
                    }
                        AddAnnotation(vm.Id, name.Tag, name.Text, vm.Color, axis_y, pane, new Geometry.Point2d(name.X, name.Y), 0,0);
                    }
                }
@@ -626,7 +686,7 @@
            this.chartControl1.Series.Add(series);
        }
        private void AddAnnotation(string id, string caption, Color color, AxisYBase axis_y, XYDiagramPaneBase pane, Yw.Geometry.Point2d pt, double angle = -10)
        private void AddAnnotation(string id, string tag, string caption, Color color, AxisYBase axis_y, XYDiagramPaneBase pane, Yw.Geometry.Point2d pt, double angle = -10, double connector_length = 20)
        {
            if (pt == null)
                return;
@@ -636,11 +696,14 @@
            pane_anchor_pt.AxisYCoordinate.Axis = axis_y;
            pane_anchor_pt.AxisXCoordinate.AxisValue = anchor_pt.X;
            pane_anchor_pt.AxisYCoordinate.AxisValue = anchor_pt.Y;
            pane_anchor_pt.Tag = tag;
            var relative_position = new DevExpress.XtraCharts.RelativePosition();
            relative_position.Angle = angle;
            relative_position.ConnectorLength = 20;
            relative_position.ConnectorLength = connector_length;
            var text_annotation = new TextAnnotation();
            text_annotation.AnchorPoint = pane_anchor_pt;
            text_annotation.AutoHeight = true;
@@ -654,14 +717,17 @@
            text_annotation.Padding.Left = 1;
            text_annotation.Padding.Right = 1;
            text_annotation.Padding.Top = 1;
            text_annotation.RuntimeMoving = true;
            text_annotation.RuntimeAnchoring = false;
            text_annotation.RuntimeMoving = false;
            text_annotation.RuntimeAnchoring = true;
            text_annotation.RuntimeResizing = false;
            text_annotation.RuntimeRotation = false;
            text_annotation.RuntimeEditing = false;
            text_annotation.Text = caption;
            text_annotation.TextColor = color;
            text_annotation.ShapePosition = relative_position;
            text_annotation.Visible = true;
            text_annotation.EnableAntialiasing = DefaultBoolean.True;
            text_annotation.DXFont = new DevExpress.Drawing.DXFont(this.Font.Name, 10F);
            this.chartControl1.AnnotationRepository.Add(text_annotation);
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextSelDlg.Designer.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,368 @@
namespace XPump.WinFrmUI
{
    partial class ClipboardCurveTextSelDlg
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
            this.txtNeglectChar3 = new DevExpress.XtraEditors.TextEdit();
            this.txtNeglectChar2 = new DevExpress.XtraEditors.TextEdit();
            this.txtNeglectChar1 = new DevExpress.XtraEditors.TextEdit();
            this.txtClipboard = new DevExpress.XtraEditors.MemoEdit();
            this.btnCancel = new DevExpress.XtraEditors.SimpleButton();
            this.btnOk = new DevExpress.XtraEditors.SimpleButton();
            this.rgDirection = new DevExpress.XtraEditors.RadioGroup();
            this.rgSeparator = new DevExpress.XtraEditors.RadioGroup();
            this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
            this.layoutControl1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.txtNeglectChar3.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNeglectChar2.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNeglectChar1.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtClipboard.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.rgDirection.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.rgSeparator.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
            this.SuspendLayout();
            //
            // layoutControl1
            //
            this.layoutControl1.AllowCustomizationMenu = false;
            this.layoutControl1.Controls.Add(this.txtNeglectChar3);
            this.layoutControl1.Controls.Add(this.txtNeglectChar2);
            this.layoutControl1.Controls.Add(this.txtNeglectChar1);
            this.layoutControl1.Controls.Add(this.txtClipboard);
            this.layoutControl1.Controls.Add(this.btnCancel);
            this.layoutControl1.Controls.Add(this.btnOk);
            this.layoutControl1.Controls.Add(this.rgDirection);
            this.layoutControl1.Controls.Add(this.rgSeparator);
            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
            this.layoutControl1.Name = "layoutControl1";
            this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(772, 198, 250, 350);
            this.layoutControl1.Root = this.layoutControlGroup1;
            this.layoutControl1.Size = new System.Drawing.Size(446, 439);
            this.layoutControl1.TabIndex = 0;
            this.layoutControl1.Text = "layoutControl1";
            //
            // txtNeglectChar3
            //
            this.txtNeglectChar3.EditValue = "\\";
            this.txtNeglectChar3.Location = new System.Drawing.Point(12, 381);
            this.txtNeglectChar3.Name = "txtNeglectChar3";
            this.txtNeglectChar3.Size = new System.Drawing.Size(422, 20);
            this.txtNeglectChar3.StyleController = this.layoutControl1;
            this.txtNeglectChar3.TabIndex = 11;
            //
            // txtNeglectChar2
            //
            this.txtNeglectChar2.EditValue = "*";
            this.txtNeglectChar2.Location = new System.Drawing.Point(12, 337);
            this.txtNeglectChar2.Name = "txtNeglectChar2";
            this.txtNeglectChar2.Size = new System.Drawing.Size(422, 20);
            this.txtNeglectChar2.StyleController = this.layoutControl1;
            this.txtNeglectChar2.TabIndex = 10;
            //
            // txtNeglectChar1
            //
            this.txtNeglectChar1.EditValue = "/";
            this.txtNeglectChar1.Location = new System.Drawing.Point(12, 293);
            this.txtNeglectChar1.Name = "txtNeglectChar1";
            this.txtNeglectChar1.Size = new System.Drawing.Size(422, 20);
            this.txtNeglectChar1.StyleController = this.layoutControl1;
            this.txtNeglectChar1.TabIndex = 9;
            //
            // txtClipboard
            //
            this.txtClipboard.Location = new System.Drawing.Point(12, 29);
            this.txtClipboard.Name = "txtClipboard";
            this.txtClipboard.Size = new System.Drawing.Size(422, 120);
            this.txtClipboard.StyleController = this.layoutControl1;
            this.txtClipboard.TabIndex = 8;
            //
            // btnCancel
            //
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(347, 405);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(87, 22);
            this.btnCancel.StyleController = this.layoutControl1;
            this.btnCancel.TabIndex = 7;
            this.btnCancel.Text = "取消";
            //
            // btnOk
            //
            this.btnOk.Location = new System.Drawing.Point(256, 405);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new System.Drawing.Size(87, 22);
            this.btnOk.StyleController = this.layoutControl1;
            this.btnOk.TabIndex = 6;
            this.btnOk.Text = "确定";
            this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
            //
            // rgDirection
            //
            this.rgDirection.Location = new System.Drawing.Point(12, 233);
            this.rgDirection.Name = "rgDirection";
            this.rgDirection.Properties.Columns = 2;
            this.rgDirection.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] {
            new DevExpress.XtraEditors.Controls.RadioGroupItem(null, "横向"),
            new DevExpress.XtraEditors.Controls.RadioGroupItem(null, "纵向")});
            this.rgDirection.Size = new System.Drawing.Size(422, 36);
            this.rgDirection.StyleController = this.layoutControl1;
            this.rgDirection.TabIndex = 5;
            //
            // rgSeparator
            //
            this.rgSeparator.Location = new System.Drawing.Point(12, 173);
            this.rgSeparator.Name = "rgSeparator";
            this.rgSeparator.Properties.Columns = 2;
            this.rgSeparator.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] {
            new DevExpress.XtraEditors.Controls.RadioGroupItem(null, "单元"),
            new DevExpress.XtraEditors.Controls.RadioGroupItem(null, "逗号")});
            this.rgSeparator.Size = new System.Drawing.Size(422, 36);
            this.rgSeparator.StyleController = this.layoutControl1;
            this.rgSeparator.TabIndex = 4;
            //
            // layoutControlGroup1
            //
            this.layoutControlGroup1.CustomizationFormText = "Root";
            this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
            this.layoutControlGroup1.GroupBordersVisible = false;
            this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
            this.layoutControlItem1,
            this.layoutControlItem2,
            this.layoutControlItem3,
            this.layoutControlItem4,
            this.emptySpaceItem1,
            this.layoutControlItem5,
            this.layoutControlItem6,
            this.layoutControlItem7,
            this.layoutControlItem8});
            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
            this.layoutControlGroup1.Name = "Root";
            this.layoutControlGroup1.Size = new System.Drawing.Size(446, 439);
            this.layoutControlGroup1.Text = "Root";
            this.layoutControlGroup1.TextVisible = false;
            //
            // layoutControlItem1
            //
            this.layoutControlItem1.AppearanceItemCaption.FontSizeDelta = 1;
            this.layoutControlItem1.AppearanceItemCaption.Options.UseFont = true;
            this.layoutControlItem1.Control = this.rgSeparator;
            this.layoutControlItem1.CustomizationFormText = "分隔";
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 141);
            this.layoutControlItem1.MaxSize = new System.Drawing.Size(0, 60);
            this.layoutControlItem1.MinSize = new System.Drawing.Size(54, 60);
            this.layoutControlItem1.Name = "layoutControlItem1";
            this.layoutControlItem1.Size = new System.Drawing.Size(426, 60);
            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
            this.layoutControlItem1.Text = "分隔";
            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
            this.layoutControlItem1.TextSize = new System.Drawing.Size(60, 17);
            //
            // layoutControlItem2
            //
            this.layoutControlItem2.AppearanceItemCaption.FontSizeDelta = 1;
            this.layoutControlItem2.AppearanceItemCaption.Options.UseFont = true;
            this.layoutControlItem2.Control = this.rgDirection;
            this.layoutControlItem2.CustomizationFormText = "方向";
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 201);
            this.layoutControlItem2.MaxSize = new System.Drawing.Size(0, 60);
            this.layoutControlItem2.MinSize = new System.Drawing.Size(54, 60);
            this.layoutControlItem2.Name = "layoutControlItem2";
            this.layoutControlItem2.Size = new System.Drawing.Size(426, 60);
            this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
            this.layoutControlItem2.Text = "方向";
            this.layoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top;
            this.layoutControlItem2.TextSize = new System.Drawing.Size(60, 17);
            //
            // layoutControlItem3
            //
            this.layoutControlItem3.Control = this.btnOk;
            this.layoutControlItem3.CustomizationFormText = "layoutControlItem3";
            this.layoutControlItem3.Location = new System.Drawing.Point(244, 393);
            this.layoutControlItem3.MaxSize = new System.Drawing.Size(91, 26);
            this.layoutControlItem3.MinSize = new System.Drawing.Size(91, 26);
            this.layoutControlItem3.Name = "layoutControlItem3";
            this.layoutControlItem3.Size = new System.Drawing.Size(91, 26);
            this.layoutControlItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
            this.layoutControlItem3.Text = "layoutControlItem3";
            this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem3.TextToControlDistance = 0;
            this.layoutControlItem3.TextVisible = false;
            //
            // layoutControlItem4
            //
            this.layoutControlItem4.Control = this.btnCancel;
            this.layoutControlItem4.CustomizationFormText = "layoutControlItem4";
            this.layoutControlItem4.Location = new System.Drawing.Point(335, 393);
            this.layoutControlItem4.MaxSize = new System.Drawing.Size(91, 26);
            this.layoutControlItem4.MinSize = new System.Drawing.Size(91, 26);
            this.layoutControlItem4.Name = "layoutControlItem4";
            this.layoutControlItem4.Size = new System.Drawing.Size(91, 26);
            this.layoutControlItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
            this.layoutControlItem4.Text = "layoutControlItem4";
            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
            this.layoutControlItem4.TextToControlDistance = 0;
            this.layoutControlItem4.TextVisible = false;
            //
            // emptySpaceItem1
            //
            this.emptySpaceItem1.AllowHotTrack = false;
            this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1";
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 393);
            this.emptySpaceItem1.Name = "emptySpaceItem1";
            this.emptySpaceItem1.Size = new System.Drawing.Size(244, 26);
            this.emptySpaceItem1.Text = "emptySpaceItem1";
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
            //
            // layoutControlItem5
            //
            this.layoutControlItem5.Control = this.txtClipboard;
            this.layoutControlItem5.CustomizationFormText = "剪切板内容";
            this.layoutControlItem5.Location = new System.Drawing.Point(0, 0);
            this.layoutControlItem5.Name = "layoutControlItem5";
            this.layoutControlItem5.Size = new System.Drawing.Size(426, 141);
            this.layoutControlItem5.Text = "剪切板内容";
            this.layoutControlItem5.TextLocation = DevExpress.Utils.Locations.Top;
            this.layoutControlItem5.TextSize = new System.Drawing.Size(60, 14);
            //
            // layoutControlItem6
            //
            this.layoutControlItem6.AppearanceItemCaption.FontSizeDelta = 1;
            this.layoutControlItem6.AppearanceItemCaption.Options.UseFont = true;
            this.layoutControlItem6.Control = this.txtNeglectChar1;
            this.layoutControlItem6.CustomizationFormText = "忽略";
            this.layoutControlItem6.Location = new System.Drawing.Point(0, 261);
            this.layoutControlItem6.Name = "layoutControlItem6";
            this.layoutControlItem6.Size = new System.Drawing.Size(426, 44);
            this.layoutControlItem6.Text = "忽略1";
            this.layoutControlItem6.TextLocation = DevExpress.Utils.Locations.Top;
            this.layoutControlItem6.TextSize = new System.Drawing.Size(60, 17);
            //
            // layoutControlItem7
            //
            this.layoutControlItem7.AppearanceItemCaption.FontSizeDelta = 1;
            this.layoutControlItem7.AppearanceItemCaption.Options.UseFont = true;
            this.layoutControlItem7.Control = this.txtNeglectChar2;
            this.layoutControlItem7.CustomizationFormText = "忽略2";
            this.layoutControlItem7.Location = new System.Drawing.Point(0, 305);
            this.layoutControlItem7.Name = "layoutControlItem7";
            this.layoutControlItem7.Size = new System.Drawing.Size(426, 44);
            this.layoutControlItem7.Text = "忽略2";
            this.layoutControlItem7.TextLocation = DevExpress.Utils.Locations.Top;
            this.layoutControlItem7.TextSize = new System.Drawing.Size(60, 17);
            //
            // layoutControlItem8
            //
            this.layoutControlItem8.AppearanceItemCaption.FontSizeDelta = 1;
            this.layoutControlItem8.AppearanceItemCaption.Options.UseFont = true;
            this.layoutControlItem8.Control = this.txtNeglectChar3;
            this.layoutControlItem8.CustomizationFormText = "忽略3";
            this.layoutControlItem8.Location = new System.Drawing.Point(0, 349);
            this.layoutControlItem8.Name = "layoutControlItem8";
            this.layoutControlItem8.Size = new System.Drawing.Size(426, 44);
            this.layoutControlItem8.Text = "忽略3";
            this.layoutControlItem8.TextLocation = DevExpress.Utils.Locations.Top;
            this.layoutControlItem8.TextSize = new System.Drawing.Size(60, 17);
            //
            // ClipboardCurveTextSelDlg
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(446, 439);
            this.Controls.Add(this.layoutControl1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            this.Name = "ClipboardCurveTextSelDlg";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text = "剪切板数据确认";
            this.Load += new System.EventHandler(this.ClipboardCurveTextSelDlg_Load);
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
            this.layoutControl1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.txtNeglectChar3.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNeglectChar2.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtNeglectChar1.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.txtClipboard.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.rgDirection.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.rgSeparator.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
            this.ResumeLayout(false);
        }
        #endregion
        private DevExpress.XtraLayout.LayoutControl layoutControl1;
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
        private DevExpress.XtraEditors.SimpleButton btnCancel;
        private DevExpress.XtraEditors.SimpleButton btnOk;
        private DevExpress.XtraEditors.RadioGroup rgDirection;
        private DevExpress.XtraEditors.RadioGroup rgSeparator;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
        private DevExpress.XtraEditors.MemoEdit txtClipboard;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
        private DevExpress.XtraEditors.TextEdit txtNeglectChar1;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
        private DevExpress.XtraEditors.TextEdit txtNeglectChar3;
        private DevExpress.XtraEditors.TextEdit txtNeglectChar2;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem8;
    }
}
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextSelDlg.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,101 @@
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XPump.WinFrmUI
{
    public partial class ClipboardCurveTextSelDlg : XtraForm
    {
        public ClipboardCurveTextSelDlg()
        {
            InitializeComponent();
            this.Shown += delegate { this.txtClipboard.EditValue = Clipboard.GetText(); };
        }
        private void ClipboardCurveTextSelDlg_Load(object sender, EventArgs e)
        {
            this.rgSeparator.SelectedIndex = XPump.WinFrmUI.Properties.Settings.Default.LastSelClipboard1;
            this.rgDirection.SelectedIndex = XPump.WinFrmUI.Properties.Settings.Default.LastSelClipboard2;
            //if (SPump.WinFrmUI.Localization.IsCN)
            //    return;
            //this.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("剪切板数据确认");
            //this.layoutControlItem5.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("剪切板内容");
            //this.layoutControlItem1.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("分隔");
            //this.layoutControlItem2.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("方向");
            //this.layoutControlItem6.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("忽略") + "1";
            //this.layoutControlItem7.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("忽略") + "2";
            //this.layoutControlItem8.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("忽略") + "3";
            //this.btnOk.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("确定");
            //this.btnCancel.Text = SPump.WinFrmUI.Localization.TranslateHelper.GetString("取消");
            //this.rgDirection.Properties.Items.Clear();
            //this.rgDirection.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] {
            //new DevExpress.XtraEditors.Controls.RadioGroupItem(null, SPump.WinFrmUI.Localization.TranslateHelper.GetString("横向")),
            //new DevExpress.XtraEditors.Controls.RadioGroupItem(null, SPump.WinFrmUI.Localization.TranslateHelper.GetString("纵向"))});
            //this.rgSeparator.Properties.Items.Clear();
            //this.rgSeparator.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] {
            //new DevExpress.XtraEditors.Controls.RadioGroupItem(null, SPump.WinFrmUI.Localization.TranslateHelper.GetString("单元")),
            //new DevExpress.XtraEditors.Controls.RadioGroupItem(null, SPump.WinFrmUI.Localization.TranslateHelper.GetString("逗号"))});
        }
        public enum eSeparator
        {
            å•å…ƒ,
            é€—号
        }
        public enum eDirection
        {
            æ¨ªå‘,
            çºµå‘
        }
        /// <summary>
        /// å¿½ç•¥å­—符串
        /// </summary>
        public List<string> NeglectList { get; set; }
        public eSeparator Separator { get; private set; }
        public eDirection Direction { get; private set; }
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (this.rgSeparator.SelectedIndex == 0)
                Separator = eSeparator.单元;
            else
                Separator = eSeparator.逗号;
            if (this.rgDirection.SelectedIndex == 0)
                Direction = eDirection.横向;
            else
                Direction = eDirection.纵向;
            XPump.WinFrmUI.Properties.Settings.Default.LastSelClipboard1 =
                     this.rgSeparator.SelectedIndex;
            XPump.WinFrmUI.Properties.Settings.Default.LastSelClipboard2 =
                this.rgDirection.SelectedIndex;
            var neglectList = new List<string>();
            if (!string.IsNullOrEmpty(txtNeglectChar1.Text))
                neglectList.Add(this.txtNeglectChar1.Text);
            if (!string.IsNullOrEmpty(txtNeglectChar2.Text))
                neglectList.Add(this.txtNeglectChar2.Text);
            if (!string.IsNullOrEmpty(txtNeglectChar3.Text))
                neglectList.Add(this.txtNeglectChar3.Text);
            NeglectList = neglectList;
            XPump.WinFrmUI.Properties.Settings.Default.Save();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextSelDlg.resx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!--
    Microsoft ResX Schema
    Version 2.0
    The primary goals of this format is to allow a simple XML format
    that is mostly human readable. The generation and parsing of the
    various data types are done through the TypeConverter classes
    associated with the data types.
    Example:
    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>
    There are any number of "resheader" rows that contain simple
    name/value pairs.
    Each data row contains a name, and value. The row also contains a
    type or mimetype. Type corresponds to a .NET class that support
    text/value conversion through the TypeConverter architecture.
    Classes that don't support this are serialized and stored with the
    mimetype set.
    The mimetype is used for serialized objects, and tells the
    ResXResourceReader how to depersist the object. This is currently not
    extensible. For a given mimetype the value must be set accordingly:
    Note - application/x-microsoft.net.object.binary.base64 is the format
    that the ResXResourceWriter will generate, however the reader can
    read any of the formats listed below.
    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.
    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
</root>
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardCurveTextUIHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XPump.WinFrmUI
{
    /// <summary>
    /// æ›²çº¿UI剪切板辅助类
    /// </summary>
    public class ClipboardCurveTextUIHelper
    {
        /// <summary>
        /// å¤åˆ¶å­—符串
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public static bool CopyString(out List<List<string>> list)
        {
            var dlg = new ClipboardCurveTextSelDlg();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (dlg.Separator == ClipboardCurveTextSelDlg.eSeparator.单元)
                {
                    if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
                    {
                        list = ClipboardCurveTextHelper.GetRowTextList("\t");
                    }
                    else
                    {
                        list = ClipboardCurveTextHelper.GetColTextList("\t");
                    }
                }
                else
                {
                    if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
                    {
                        list = ClipboardCurveTextHelper.GetRowTextList(",");
                    }
                    else
                    {
                        list = ClipboardCurveTextHelper.GetColTextList(",");
                    }
                }
                return true;
            }
            list = null;
            return false;
        }
        /// <summary>
        /// å¤åˆ¶æ•°å€¼
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public static bool CopyDouble(out List<List<double?>> list)
        {
            var dlg = new ClipboardCurveTextSelDlg();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (dlg.Separator == ClipboardCurveTextSelDlg.eSeparator.单元)
                {
                    if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
                    {
                        list = ClipboardCurveTextHelper.GetRowDoubleText(dlg.NeglectList, "\t");
                    }
                    else
                    {
                        list = ClipboardCurveTextHelper.GetColDoubleList(dlg.NeglectList, "\t");
                    }
                }
                else
                {
                    if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
                    {
                        list = ClipboardCurveTextHelper.GetRowDoubleText(dlg.NeglectList, ",");
                    }
                    else
                    {
                        list = ClipboardCurveTextHelper.GetColDoubleList(dlg.NeglectList, ",");
                    }
                }
                return true;
            }
            list = null;
            return false;
        }
    }
}
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/Clipboard/ClipboardTextHelper.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace XPump.WinFrmUI
{
    /// <summary>
    /// å‰ªåˆ‡æ¿æ–‡æœ¬è¾…助类
    /// </summary>
    public class ClipboardCurveTextHelper
    {
        /// <summary>
        /// èŽ·å–Excel文本列表
        /// </summary>
        /// <returns></returns>
        public static List<List<string>> GetExcelColTextList()
        {
            return GetColTextList("\t");
        }
        /// <summary>
        /// èŽ·å–Excel double列表
        /// </summary>
        /// <returns></returns>
        public static List<List<double?>> GetExcelColDoubleList()
        {
            return GetColDoubleList(null, "\t");
        }
        /// <summary>
        /// èŽ·å–çºµå‘æ–‡æœ¬åˆ—è¡¨
        /// </summary>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static List<List<string>> GetColTextList(string separator = ",")
        {
            var text = Clipboard.GetText();
            if (string.IsNullOrEmpty(text))
                return null;
            var rows = text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            if (rows.Count < 1)
                return null;
            var list = new List<List<string>>();
            foreach (var row in rows)
            {
                var cols = row.Split(new string[] { separator }, StringSplitOptions.None).ToList();
                list.Add(cols);
            }
            return list;
        }
        /// <summary>
        /// èŽ·å–çºµå‘æ–‡æœ¬åˆ—è¡¨
        /// </summary>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static List<List<string>> GetRowTextList(string separator = ",")
        {
            var rowsList = GetColTextList(separator);
            if (rowsList == null || rowsList.Count < 1)
                return null;
            var colsList = new List<List<string>>();
            for (int i = 0; i < rowsList.First().Count; i++)
            {
                var list = rowsList.Select(x =>
                {
                    if (x.Count <= i)
                        return null;
                    return x[i];
                }).ToList();
                colsList.Add(list);
            }
            return colsList;
        }
        /// <summary>
        /// èŽ·å–çºµå‘Double åˆ—表
        /// </summary>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static List<List<double?>> GetColDoubleList(List<string> neglectList, string separator = ",")
        {
            var text = Clipboard.GetText();
            if (string.IsNullOrEmpty(text))
                return null;
            if(neglectList != null && neglectList.Count>0)
            {
                neglectList.ForEach(x =>
                {
                    text = text.Replace(x, "");
                });
            }
            var rows = text.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            if (rows.Count < 1)
                return null;
            var list = new List<List<double?>>();
            foreach (var row in rows)
            {
                var cols = row.Split(new string[] { separator }, StringSplitOptions.RemoveEmptyEntries);
                var col_doubles = cols.Select(x =>
                {
                    double? r;
                    if (string.IsNullOrEmpty(x))
                    {
                        r = null;
                    }
                    else
                    {
                        double d;
                        if (double.TryParse(x, out d))
                        {
                            r = d;
                        }
                        else
                        {
                            r = null;
                        }
                    }
                    return r;
                }).ToList();
                list.Add(col_doubles);
            }
            return list;
        }
        /// <summary>
        /// èŽ·å–æ¨ªå‘Double åˆ—表
        /// </summary>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static List<List<double?>> GetRowDoubleText(List<string> neglectList, string separator = ",")
        {
            var rowsList = GetColDoubleList(neglectList, separator);
            if (rowsList == null || rowsList.Count < 1)
                return null;
            var colsList = new List<List<double?>>();
            for (int i = 0; i < rowsList.First().Count; i++)
            {
                var list = rowsList.Select(x =>
                {
                    if (x.Count <= i)
                        return null;
                    return x[i];
                }).ToList();
                colsList.Add(list);
            }
            return colsList;
        }
    }
}
WinFrmUI/Yw.WinFrmUI.Phart.Core/99-temp/Clipboard/ʹÓÃð¤Ìù°å.txt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,99 @@
     private void barBtnCopyFromClipboard_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            List<List<double?>> list = null;
            if (!ClipboardCurveTextUIHelper.CopyDouble(out list))
                return;
            if (list == null || list.Count < 1)
                return;
            if (list.Count < 1)
            {
                XtraMessageBox.Show(("数据不完整"));
                return;
            }
            if (list.Count == 1)
            {
                #region å•列
                var cels = dataGridView1.SelectedCells.Count;
                if (cels == 0)
                    return;
                var sel_cel = dataGridView1.SelectedCells[0];
                if (sel_cel.ColumnIndex == 0)
                {
                    dataGridView1.Rows.Clear();
                    for (int i = 0; i < list[0].Count; i++)
                    {
                        dataGridView1.Rows.Add(list[0][i], "", "", "");
                    }
                }
                else if (sel_cel.ColumnIndex == 1)
                {
                    for (int i = 0; i < dataGridView1.Rows.Count; i++)
                    {
                        if (dataGridView1.Rows[i].Cells[0].Value == null)
                            continue;
                        if (i < list[0].Count)
                            dataGridView1.Rows[i].Cells[1].Value = list[0][i];
                    }
                }
                else if (sel_cel.ColumnIndex == 2)
                {
                    for (int i = 0; i < dataGridView1.Rows.Count; i++)
                    {
                        if (dataGridView1.Rows[i].Cells[0].Value == null)
                            continue;
                        if (i < list[0].Count)
                            dataGridView1.Rows[i].Cells[2].Value = list[0][i];
                    }
                }
                else if (sel_cel.ColumnIndex == 3)
                {
                    for (int i = 0; i < dataGridView1.Rows.Count; i++)
                    {
                        if (dataGridView1.Rows[i].Cells[0].Value == null)
                            continue;
                        if (i < list[0].Count)
                            dataGridView1.Rows[i].Cells[3].Value = list[0][i];
                    }
                }
                #endregion
            }
            if (list.Count == 2 && list[0].Count == list[1].Count)
            {
                #region 2列
                dataGridView1.Rows.Clear();
                for (int i = 0; i < list[0].Count; i++)
                {
                    dataGridView1.Rows.Add(list[0][i], list[1][i], "", "");
                }
                #endregion
            }
            if (list.Count == 3 && list[0].Count == list[1].Count && list[0].Count == list[2].Count)
            {
                #region 3列
                dataGridView1.Rows.Clear();
                for (int i = 0; i < list[0].Count; i++)
                {
                    dataGridView1.Rows.Add(list[0][i], list[1][i], list[2][i], "");
                }
                #endregion
            }
            if (list.Count == 4 && list[0].Count == list[1].Count && list[0].Count == list[2].Count && list[0].Count == list[3].Count)
            {
                #region 4列
                dataGridView1.Rows.Clear();
                for (int i = 0; i < list[0].Count; i++)
                {
                    dataGridView1.Rows.Add(list[0][i], list[1][i], list[2][i], list[3][i]);
                }
                #endregion
            }
        }
WinFrmUI/Yw.WinFrmUI.Phart.Core/Yw.WinFrmUI.Phart.Core.csproj
@@ -10,6 +10,7 @@
  <ItemGroup>
    <Compile Remove="01-pump\04-special\04-variable-speed\**" />
    <Compile Remove="02-valve\**" />
    <Compile Remove="99-temp\Clipboard\**" />
    <Compile Remove="bak2\**" />
    <Compile Remove="bak3\**" />
    <Compile Remove="v1 - å¤åˆ¶\**" />
@@ -17,6 +18,7 @@
    <Compile Remove="v2\**" />
    <EmbeddedResource Remove="01-pump\04-special\04-variable-speed\**" />
    <EmbeddedResource Remove="02-valve\**" />
    <EmbeddedResource Remove="99-temp\Clipboard\**" />
    <EmbeddedResource Remove="bak2\**" />
    <EmbeddedResource Remove="bak3\**" />
    <EmbeddedResource Remove="v1 - å¤åˆ¶\**" />
@@ -24,6 +26,7 @@
    <EmbeddedResource Remove="v2\**" />
    <None Remove="01-pump\04-special\04-variable-speed\**" />
    <None Remove="02-valve\**" />
    <None Remove="99-temp\Clipboard\**" />
    <None Remove="bak2\**" />
    <None Remove="bak3\**" />
    <None Remove="v1 - å¤åˆ¶\**" />
@@ -31,6 +34,7 @@
    <None Remove="v2\**" />
    <Page Remove="01-pump\04-special\04-variable-speed\**" />
    <Page Remove="02-valve\**" />
    <Page Remove="99-temp\Clipboard\**" />
    <Page Remove="bak2\**" />
    <Page Remove="bak3\**" />
    <Page Remove="v1 - å¤åˆ¶\**" />
@@ -153,6 +157,7 @@
    <Folder Include="00-core\03-view-model\02-paras\disp-paras\" />
    <Folder Include="01-pump\03-import\01-excel\" />
    <Folder Include="02-universal\03-import\01-excel\" />
    <Folder Include="99-temp\" />
    <Folder Include="Properties\DataSources\" />
  </ItemGroup>