Example #1
0
        internal void AsyncGetImageFile(BiblioRegisterControl biblioRegister,
            AsyncGetImageEventArgs e)
        {
            string strError = "";
            if (String.IsNullOrEmpty(e.RecPath) == true)
            {
                strError = "e.RecPath 为空,无法获得图像文件";
                goto ERROR1;
            }

            string strPath = "";
            string strServerName = "";
            StringUtil.ParseTwoPart(e.RecPath, "@", out strPath, out strServerName);

            AccountInfo account = _base.GetAccountInfo(strServerName);
            if (account == null)
            {
                strError = "e.RecPath 中 '" + e.RecPath + "' 服务器名 '" + strServerName + "' 没有配置";
                goto ERROR1;
            }
            string strServerUrl = account.ServerUrl;
            string strUserName = account.UserName;

            if (EntityRegisterBase.IsDot(strServerUrl) == true)
                strServerUrl = this.MainForm.LibraryServerUrl;
            if (EntityRegisterBase.IsDot(strUserName) == true)
                strUserName = this.MainForm.DefaultUserName;

            EventFilter filter = new EventFilter();
            filter.BiblioRegister = biblioRegister;
            filter.Row = e.Row;
            filter.BiblioRecPath = e.RecPath;

            string strObjectPath = strPath + "/object/" + e.ObjectPath;
            this._imageManager.AsyncGetObjectFile(strServerUrl, 
                strUserName,
                strObjectPath,
                e.FileName,
                filter);

            return;
        ERROR1:
            biblioRegister.AsyncGetImageComplete(e.Row,
                "",
                null,
                strError);
        }
Example #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="container"></param>
        public RegisterLine(EntityRegisterControl container)
        {
            this.Container = container;

            label_color = new Label();
            label_color.Dock = DockStyle.Fill;
            label_color.Size = new Size(6, 23);
            label_color.Margin = new Padding(0, 0, 0, 0);

            _biblioRegister = new BiblioRegisterControl();
            _biblioRegister.Dock = DockStyle.Fill;
            // _biblioRegister.Size = new Size(100, 100);
            _biblioRegister.Margin = new Padding(0, 0, 0, 0);
            _biblioRegister.AutoSize = true;
            _biblioRegister.AutoScroll = false;

            // 册信息部分显示为空
            _biblioRegister.TrySetBlank("not_initial");
            _biblioRegister.LoaderImage = (this.Container as EntityRegisterControl).LoaderImage;

            // _biblioRegister.SetWidth(this.Container.ClientSize.Width);
        }