Пример #1
0
        /// <summary>
        /// Read the working version of the document and attachment.
        /// </summary>
        protected virtual void readWorkVersion()
        {
            if (haveReadWorkVersion)
            {
                return;
            }
            haveReadWorkVersion = true;

            // Existing object?
            if (sordVal.id >= 0)
            {
                // read versions
                long      editC = EditInfoC.mbDocumentMembers | EditInfoC.mbSignatureMembers | EditInfoC.mbAttachmentMembers;
                EditInfoZ editZ = new EditInfoZ(editC, new SordZ(0));

                EditInfo ed = Conn.Ix.checkoutDoc(sordVal.guid, null, editZ, LockC.NO);

                // object has versions and/or attachments
                if (ed.document != null)
                {
                    // The current working versions might have been set by
                    // a previsious call to Version.File=c:/hello.txt.
                    // Thus do not overwrite the current working versions.

                    FWDocVersion wver = docs.WorkVersion;
                    FWDocVersion watt = atts.WorkVersion;

                    if (ed.document.docs != null && ed.document.docs.Length != 0)
                    {
                        DocVersion dv = ed.document.docs[0];
                        if (wver == null)
                        {
                            // ANPASSUNG
                            if (dv.workVersion)  // <-- Diese Zeile wurde eingefügt
                            {
                                wver = docs.InternalAdd(dv);
                            }
                        }
                        else if (wver.Signature == null)
                        {
                            wver.Signature = ClassFactory.NewDocVersion(dv.sig, this, FWDocVersionType.TYPE_SIGNATURE);
                        }
                    }

                    if (watt == null)
                    {
                        if (ed.document.atts != null && ed.document.atts.Length != 0)
                        {
                            DocVersion dv = ed.document.atts[0];
                            watt = atts.InternalAdd(dv);
                        }
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Initialize.
        /// </summary>
        protected void Init()
        {
            haveReadAll         = false;
            haveReadWorkVersion = false;

            // Provide empty collections for document versions and attachments
            docs = ClassFactory.NewDocVersions(null, this, FWDocVersionType.TYPE_VERSION);
            atts = ClassFactory.NewDocVersions(null, this, FWDocVersionType.TYPE_ATTACHMENT);

            // If the sord object contains a version, put it into the versions collection
            if (sordVal.docVersion != null)
            {
                docs.InternalAdd(sordVal.docVersion);
            }
        }