Example #1
0
        public FilePathUnitControl(ref FilePathGroup filePathGroup, string iniFilePath)
        {
            InitializeComponent();
            InitUIInfo();

            this.filePathGroup = filePathGroup;
            this.iniFilePath   = iniFilePath;

            LoadParaFromIniFile();
            SetParaToUI();

            bInit = true;
        }
Example #2
0
        public override int SetParaToUI()
        {
            filePathTabControlEX.Controls.Clear();
            for (int i = 0; i < DataFilePath.FilePathGroupList.Count; i++)
            {
                // FilePathUnitControl
                FilePathGroup filePathGroup = new FilePathGroup();
                filePathGroup = (FilePathGroup)DataFilePath.FilePathGroupList[i];
                FilePathUnitControl filePathUnitControl = new FilePathUnitControl(ref filePathGroup, strINIPath);

                filePathUnitControl.Font     = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                filePathUnitControl.Location = new System.Drawing.Point(-1, -1);
                filePathUnitControl.Margin   = new System.Windows.Forms.Padding(4);
                filePathUnitControl.Name     = "filePathUnitControl";
                filePathUnitControl.Size     = new System.Drawing.Size(1058, 251);
                filePathUnitControl.TabIndex = 0;

                filePathUnitControl.Dock = System.Windows.Forms.DockStyle.Fill;

                // TabPage
                Dotnetrix.Controls.TabPageEX tabPageEX;

                tabPageEX = new Dotnetrix.Controls.TabPageEX();
                tabPageEX.SuspendLayout();
                filePathTabControlEX.Controls.Add(tabPageEX);
                // tabPageEX
                tabPageEX.BackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(233)))), ((int)(((byte)(216)))));
                tabPageEX.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                tabPageEX.Controls.Add(filePathUnitControl);
                tabPageEX.Font     = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                tabPageEX.Location = new System.Drawing.Point(4, 25);
                tabPageEX.Name     = "tabPageEX" + i;
                tabPageEX.Size     = new System.Drawing.Size(1058, 251);
                tabPageEX.TabIndex = 0;
                tabPageEX.Text     = ((FilePathGroup)DataFilePath.FilePathGroupList[i]).FileGroupName;
                tabPageEX.ResumeLayout(false);
            }
            // Others
            autoDeleteLocalFileCheckBox.Checked = DataFilePath.EnableAutoDeleteLocalFile;
            autoDeleteDays.Value          = DataFilePath.AutoDeleteDays;
            cautionHDDLimit.Value         = DataFilePath.CautionHDDCheckLimit;
            warningHDDLimit.Value         = DataFilePath.WarningHDDCheckLimit;
            showCommErrorCheckBox.Checked = DataFilePath.EnableShowCommunicationError;

            return(0);
        }
Example #3
0
        public bool DefineFilePath(string strFilePathGroupName, string strFilePathName, bool enableUploadFunction)
        {
            FilePathGroup filePathGroupTemp = new FilePathGroup();
            bool          bGroupExist       = false;

            for (int i = 0; i < DataFilePath.FilePathGroupList.Count; i++)
            {
                if (((FilePathGroup)DataFilePath.FilePathGroupList[i]).FileGroupName.Equals(strFilePathGroupName) == true)
                {
                    filePathGroupTemp = ((FilePathGroup)DataFilePath.FilePathGroupList[i]);
                    bGroupExist       = true;
                }
            }

            if (bGroupExist == false)
            {
                FilePathGroup filePathGroup = new FilePathGroup(strFilePathGroupName);
                DataFilePath.FilePathGroupList.Add(filePathGroup);

                filePathGroupTemp = filePathGroup;
            }

            for (int i = 0; i < filePathGroupTemp.FilePathUnitList.Count; i++)
            {
                // 檢查File名稱是否重複
                if (((FilePathUnit)filePathGroupTemp.FilePathUnitList[i]).FileName.Equals(strFilePathName) == true)
                {
                    return(false);
                }
            }

            FilePathUnit filePathUnit = new FilePathUnit(strFilePathName, "", enableUploadFunction);

            filePathGroupTemp.FilePathUnitList.Add(filePathUnit);
            return(true);
        }