Esempio n. 1
0
        /// <summary>
        /// Handles when the property value is copied to another node
        /// </summary>
        public void CopyGeneric(CswNbtNodePropData Source)
        {
            // Default, just copy the data values

            CswEnumNbtFieldType  FieldType     = Source.getFieldTypeValue();
            ICswNbtFieldTypeRule FieldTypeRule = _CswNbtResources.MetaData.getFieldTypeRule(FieldType);

            foreach (CswNbtSubField SubField in FieldTypeRule.SubFields)
            {
                if (SubField.Column == CswEnumNbtPropColumn.Field1_FK)
                {
                    //Implementing FieldType specific behavior here. Blame Steve.
                    if (FieldType == CswEnumNbtFieldType.ViewReference)
                    {
                        //we want to copy views to the new node by value, so changes to the view on either node don't affect the other
                        CswNbtView View     = _CswNbtResources.ViewSelect.restoreView(new CswNbtViewId(Source.Field1_Fk));
                        CswNbtView ViewCopy = new CswNbtView(_CswNbtResources);
                        ViewCopy.saveNew(View.ViewName, View.Visibility, View.VisibilityRoleId, View.VisibilityUserId, View);
                        SetSubFieldValue(CswEnumNbtSubFieldName.ViewID, ViewCopy.ViewId);
                    }
                    else
                    {
                        SetSubFieldValue(SubField.Name, Source.Field1_Fk);
                    }
                } // if( SubField.Column == CswEnumNbtPropColumn.Field1_FK )
                else
                {
                    SetSubFieldValue(SubField.Name, Source.GetPropRowValue(SubField));
                }
            } // foreach( CswNbtSubField SubField in NodeTypeProp.getFieldTypeRule().SubFields )

            // Also copy Gestalt, which usually isn't listed as a subfield
            SetSubFieldValue(CswEnumNbtSubFieldName.Gestalt, Source.Gestalt);
            SetSubFieldValue(CswEnumNbtSubFieldName.GestaltSearch, Source.GestaltSearch);

            //Case 31362 - also copy Blob_Data if necessary
            if (Source.getFieldTypeValue() == CswEnumNbtFieldType.MOL || Source.getFieldTypeValue() == CswEnumNbtFieldType.Image || Source.getFieldTypeValue() == CswEnumNbtFieldType.File)
            {
                CswNbtSdBlobData.CopyBlobData(_CswNbtResources, Source.JctNodePropId, JctNodePropId);
            }
        }
Esempio n. 2
0
 protected string GetPropRowValue(CswNbtSubField SubField)
 {
     return(_CswNbtNodePropData.GetPropRowValue(SubField));
 }