public static NBatchInfo CreateTmpNBatchInfo(this RadTreeNode node)
        {
            NBatchInfo info = new NBatchInfo
            {
                BatchNO = (node.Tag as NBatchInfo).BatchNO,
                Author  = AccountSetting.GetInstance().AccountName
            };

            info.FileInfos.AddRange(node.GetChildren().SelectNFileNode().Select <RadTreeNode, NFileInfo>(o => o.Tag as NFileInfo));
            return(info);
        }
Exemplo n.º 2
0
 public UCStatusBar()
 {
     this.InitializeComponent();
     UCStatusBar._curinstance      = this;
     this.radStatusBar1.Dock       = DockStyle.Fill;
     this.radButtonElementL.Click += new EventHandler(this.radButtonElementL_Click);
     this.radButtonElementR.Click += new EventHandler(this.radButtonElementR_Click);
     this.OnActionClick           += new EventHandler <TEventArg <string> >(this.UCStatusBar_OnActionClick);
     this.radLabelElement2.DataBindings.Add("Text", AccountSetting.GetInstance(), "AccountOrgID").ControlUpdateMode = ControlUpdateMode.OnPropertyChanged;
     this.radLabelElement3.DataBindings.Add("Text", AccountSetting.GetInstance(), "AccountName").ControlUpdateMode  = ControlUpdateMode.OnPropertyChanged;
     this.radLabelElement4.DataBindings.Add("Text", UpdateSetting.GetInstance(), "AppVersion").ControlUpdateMode    = ControlUpdateMode.OnPropertyChanged;
     this.radLabelElement2.Click += new EventHandler(this.RadLabelElementUserInfo_Click);
     this.radLabelElement3.Click += new EventHandler(this.RadLabelElementUserInfo_Click);
 }
        protected virtual void OnFileAcquied(string FilePath)
        {
            NFileInfo fileInfo = new NFileInfo();

            fileInfo.SetDate(DateTime.Now);
            fileInfo.Author    = AccountSetting.GetInstance().AccountName;
            fileInfo.LocalPath = FilePath;
            fileInfo.FileName  = FileHelper.GetFileName(FilePath);
            fileInfo.Operation = EOperType.eADD;

            NBatchInfo  batchInfo = null;
            RadTreeNode batchNode;

            if (this._lastScanOpeType == ScanOpe.Add)
            {
                if (navigateTree.GetRadTree().Nodes.Count == 0)
                {
                    string batchNo = BatchNoMaker.Cur.FromInputDialog(FilePath);
                    if (string.IsNullOrEmpty(batchNo))
                    {
                        return;
                    }
                    batchInfo = new NBatchInfo
                    {
                        BatchNO = batchNo
                    };
                    batchNode = navigateTree.CreateBatchNode(batchInfo);
                }
                else if (navigateTree.GetRadTree().SelectedNode != null)
                {
                    batchNode = navigateTree.GetRadTree().SelectedNode.GetBatchNode();
                    batchInfo = batchNode.Tag as NBatchInfo;
                }
                else
                {
                    batchNode = navigateTree.GetRadTree().Nodes[navigateTree.GetRadTree().Nodes.Count - 1];
                    batchInfo = batchNode.Tag as NBatchInfo;
                }
                RadTreeNode fileNode = navigateTree.CreateFileNodeFromLocal(batchNode, fileInfo, batchInfo);

                batchNode.ExpandAll();
                navigateTree.UpdateBatchNodeTitle(batchNode);
                Application.DoEvents();
            }
            else if (this._lastScanOpeType == ScanOpe.ReplaceCurrent)
            {
                RadTreeNode selectedNode = navigateTree.SelectedNode.UpdateFileNode(fileInfo);
                //this.OnItemSelectChanged(this, new TEventArg<RadTreeNode>(selectedNode));
            }
            else if (this._lastScanOpeType == ScanOpe.AddToCur)
            {
                //TODO AddToCur?

                /*RadTreeNode node = navigateTree.SelectedNode;
                 * if (node.Tag is NFileInfo)
                 * {
                 *  node = node.Parent;
                 * }*/
                batchNode = navigateTree.SelectedNode;
                batchInfo = batchNode.Tag as NBatchInfo;
                //NFileInfo info4 = new NFileInfo();
                //info4.SetDate(DateTime.Now);
                //info4.LocalPath = FilePath;
                //info4.FileName = FileHelper.GetFileName(FilePath);
                //info4.Operation = EOperType.eADD;
                //RadTreeNode node5 = node.Nodes.Add(info4.DisplayName);
                //node.TextAlignment = ContentAlignment.MiddleCenter;
                //node5.SetImageIcon(info4.LocalPath, this._viewfileinfoicon);
                //node5.Tag = info4;
                //this.SetFileNodeDefualtProperty(node5);
                //node5.Selected = true;
                //node5.ToolTipText = info4.ToUITipString();
                //node.ExpandAll();

                RadTreeNode fileNode = navigateTree.CreateFileNodeFromLocal(batchNode, fileInfo, batchInfo);

                navigateTree.UpdateBatchNodeTitle(batchNode);
                Application.DoEvents();
            }
        }
 private void btnOK_Click(object sender, EventArgs e)
 {
     AccountSetting.GetInstance().AccountOrgID = this.textBoxOrgID.Text;
     AccountSetting.GetInstance().AccountName  = this.textBoxAccount.Text;
     (base.Parent as Form).Close();
 }
 public UCAccountSetting()
 {
     this.InitializeComponent();
     this.textBoxOrgID.Text   = AccountSetting.GetInstance().AccountOrgID;
     this.textBoxAccount.Text = AccountSetting.GetInstance().AccountName;
 }
        private void ShowAppParams(object param = null)
        {
            FormContainer formContainer = new FormContainer();
            TabControl    tabControl    = new TabControl();
            TabPage       tabPage       = new TabPage();

            tabPage.Text = "快速设置";
            UCSetupWizard uCSetupWizard = new UCSetupWizard();

            uCSetupWizard.Dock = DockStyle.Fill;
            tabPage.Controls.Add(uCSetupWizard);
            tabControl.TabPages.Add(tabPage);
            TabPage tabPage2 = new TabPage();

            tabControl.TabPages.Add(tabPage2);
            UCMultiObjPropertyInfo uCMultiObjPropertyInfo = new UCMultiObjPropertyInfo();

            uCMultiObjPropertyInfo.AddObjs(UISetting.GetInstance().Name, UISetting.GetInstance());
            //uCMultiObjPropertyInfo.AddObjs(this._ucbench.GetSetting().Name, this._ucbench.GetSetting());
            //uCMultiObjPropertyInfo.AddObjs(UISetting.GetInstance().Name, UISetting.GetInstance());
            //uCMultiObjPropertyInfo.AddObjs(this._ucnavigatorbar.GetSetting().Name, this._ucnavigatorbar.GetSetting());
            if (this._uccenterview.Realview != null && this._uccenterview.Realview is UCPictureView)
            {
                UCPictureView.NestSetting setting = (this._uccenterview.Realview as UCPictureView).GetSetting();
                uCMultiObjPropertyInfo.AddObjs(setting.Name, setting);
            }
            uCMultiObjPropertyInfo.AddObjs(this._ucitemtoolbar.GetSetting().Name, this._ucitemtoolbar.GetSetting());
            uCMultiObjPropertyInfo.AddObjs(SummaryPropertiesSetting.GetInstance().Name, SummaryPropertiesSetting.GetInstance());
            uCMultiObjPropertyInfo.AddObjs(this._ucstatusbar.GetSetting().Name, this._ucstatusbar.GetSetting());
            tabPage2.Controls.Add(uCMultiObjPropertyInfo);
            tabPage2.Text = "界面参数设置";
            uCMultiObjPropertyInfo.Dock = DockStyle.Fill;
            TabPage tabPage3 = new TabPage();

            tabControl.TabPages.Add(tabPage3);
            UCMultiObjPropertyInfo uCMultiObjPropertyInfo2 = new UCMultiObjPropertyInfo();

            uCMultiObjPropertyInfo2.AddObjs(UpdateSetting.GetInstance().Name, UpdateSetting.GetInstance());
            uCMultiObjPropertyInfo2.AddObjs(EmailSetting.GetInstance().Name, EmailSetting.GetInstance());
            uCMultiObjPropertyInfo2.AddObjs(AccountSetting.GetInstance().Name, AccountSetting.GetInstance());
            uCMultiObjPropertyInfo2.AddObjs(AppSetting.GetInstance().Name, AppSetting.GetInstance());
            uCMultiObjPropertyInfo2.AddObjs(DebugSetting.GetInstance().Name, DebugSetting.GetInstance());
            //uCMultiObjPropertyInfo2.AddObjs(AbstractSetting<NetSetting>.CurSetting.Name, AbstractSetting<NetSetting>.CurSetting);
            uCMultiObjPropertyInfo2.AddObjs(NetSetting.GetInstance().Name, NetSetting.GetInstance());
            bool showAdvanceSetting = AppSetting.GetInstance().ShowAdvanceSetting;

            uCMultiObjPropertyInfo2.AddObjs(FunctionSetting.GetInstance().Name, FunctionSetting.GetInstance());
            if (showAdvanceSetting)
            {
                uCMultiObjPropertyInfo2.AddObjs(AbstractSetting <ServerIniConfig> .CurSetting.Name, AbstractSetting <ServerIniConfig> .CurSetting);
                uCMultiObjPropertyInfo2.AddObjs(FormAboutMe.Setting.Name, FormAboutMe.Setting);
            }
            tabPage3.Controls.Add(uCMultiObjPropertyInfo2);
            tabPage3.Text = "系统参数参数设置";
            uCMultiObjPropertyInfo2.Dock = DockStyle.Fill;
            bool showAdvanceSetting2 = AppSetting.GetInstance().ShowAdvanceSetting;

            if (showAdvanceSetting2)
            {
                TabPage tabPage4 = new TabPage();
                tabControl.TabPages.Add(tabPage4);
                UCMenuBarDesign uCMenuBarDesign = new UCMenuBarDesign();
                uCMenuBarDesign.Dock = DockStyle.Fill;
                tabPage4.Controls.Add(uCMenuBarDesign);
                tabPage4.Text = "菜单配置";
            }
            tabControl.Dock = DockStyle.Fill;
            formContainer.SetControl(tabControl);
            formContainer.Size = new Size(760, 540);
            formContainer.Text = "系统设置";
            formContainer.SetKeyEscCloseForm(true);
            formContainer.ShowDialog();
        }