erminas.SmartAPI.CMS.Project.ContentClasses.ContentClass.CopyAttributesToCC C# (CSharp) Method

CopyAttributesToCC() private method

private CopyAttributesToCC ( IContentClass targetCC ) : void
targetCC IContentClass
return void
        private void CopyAttributesToCC(IContentClass targetCC)
        {
            var assignment = new AttributeAssignment();
            assignment.AssignAllLanguageIndependentRedDotAttributes(EditableAreaSettings, targetCC.EditableAreaSettings);

            targetCC.EditableAreaSettings.Commit();
            targetCC.Refresh();
            try
            {
                assignment.AssignAllLanguageIndependentRedDotAttributes(this, targetCC);
            } catch (AttributeChangeException e)
            {
                throw new SmartAPIException(Session.ServerLogin,
                                            string.Format(
                                                "Unable to assign attribute {0} in content class {1} of project {2} to content class {3} of project {4}",
                                                e.AttributeName, Name, Project.Name, targetCC.Name,
                                                targetCC.Project.Name), e);
            }
            targetCC.Commit();
        }