示例#1
0
        internal static StepPresentationStyleAssignment CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var presentationStyleAssignment = new StepPresentationStyleAssignment();

            presentationStyleAssignment.SyntaxList = syntaxList;
            syntaxList.AssertListCount(1);
            presentationStyleAssignment.Id = id;
            presentationStyleAssignment.BindSyntaxList(binder, syntaxList, 0);
            return(presentationStyleAssignment);
        }
示例#2
0
        internal static StepPresentationStyleAssignment CreateFromSyntaxList(StepBinder binder, StepSyntaxList syntaxList, int id)
        {
            var presentationStyleAssignment = new StepPresentationStyleAssignment();

            syntaxList.AssertListCount(1);
            presentationStyleAssignment.Id = id;

            var referList = syntaxList.Values[0].GetValueList();

            presentationStyleAssignment.StyleUsageList.Clear();
            presentationStyleAssignment.StyleUsageList.AddRange(Enumerable.Range(0, referList.Values.Count).Select(_ => (StepSurfaceStyleUsage)null));
            for (int i = 0; i < referList.Values.Count; i++)
            {
                var j = i;
                binder.BindValue(referList.Values[j], v => presentationStyleAssignment.StyleUsageList[j] = v.AsType <StepSurfaceStyleUsage>());
            }

            return(presentationStyleAssignment);
        }