예제 #1
0
        private bool DropAction(string sender, object attr)
        {
            if (sender == "Drop")
            {
                var objs = attr as object[];
                if (objs.Count() == 2)
                {
                    var p = objs[0] as SmartGroup;
                    var t = objs[1] as XFrmWorkAttribute;

                    var item = PluginProvider.GetObjectInstance(t.MyType) as IColumnProcess;
                    if (string.IsNullOrEmpty(p.Name) == false)
                    {
                        item.Column = p.Name;
                    }

                    InsertModule(item);
                    ETLMount++;
                    RefreshSamples();
                }
            }
            if (sender == "Click")
            {
                var smart = attr as SmartGroup;
                if (smart != null)
                {
                    attr = smart.ColumnInfo;
                }
                var window = PropertyGridFactory.GetPropertyWindow(attr);


                window.Closed += (s, e) => RefreshSamples();
                window.ShowDialog();
            }
            if (sender != "Delete")
            {
                return(true);
            }
            var a = attr as IColumnProcess;

            if (MessageBox.Show("确实要删除" + a.TypeName + "吗?", "提示信息", MessageBoxButton.OKCancel) !=
                MessageBoxResult.OK)
            {
                return(true);
            }
            CurrentETLTools.Remove(a);
            RefreshSamples();
            return(true);
        }
예제 #2
0
        private bool DropAction(string sender, object attr)
        {
            if (sender == "Drop")
            {
                var objs = attr as object[];
                if (objs.Count() == 2)
                {
                    var p = objs[0] as SmartGroup;
                    var t = objs[1] as XFrmWorkAttribute;

                    var item = PluginProvider.GetObjectInstance(t.MyType) as IColumnProcess;

                    if (string.IsNullOrEmpty(p.Name) == false)
                    {
                        item.Column = p.Name;
                    }
                    item.Father  = this;
                    shouldUpdate = false;
                    InsertModule(item);
                    shouldUpdate = true;
                    if (NeedConfig(item))
                    {
                        var window = PropertyGridFactory.GetPropertyWindow(item);

                        window.ShowDialog();
                    }
                    ETLMount++;
                }
            }
            if (sender == "Click")
            {
                var smart = attr as SmartGroup;
                if (smart != null)
                {
                    attr = smart.ColumnInfo;
                }
                var window  = PropertyGridFactory.GetPropertyWindow(attr);
                var oldProp = attr.UnsafeDictSerializePlus();

                window.Closed += (s, e) =>
                {
                    if (oldProp.IsEqual(attr.UnsafeDictSerializePlus()) == false && IsAutoRefresh)
                    {
                        RefreshSamples();
                    }
                };
                window.ShowDialog();
            }
            if (sender != "Delete")
            {
                return(true);
            }
            var a = attr as IColumnProcess;

            if (MessageBox.Show("确实要删除" + a.TypeName + "吗?", "提示信息", MessageBoxButton.OKCancel) !=
                MessageBoxResult.OK)
            {
                return(true);
            }

            CurrentETLTools.Remove(a);
            if (IsAutoRefresh)
            {
                RefreshSamples();
            }
            return(true);
        }