コード例 #1
0
        public static CodePropertyImplementsInterface Implements(this CodePropertyImplementsInterface property, CodeTypeReference t, string interfaceProperty)
        {
            if (!property.Property.ImplementationTypes.Cast <CodeTypeReference>().Any(it => it.IsEquals(t)))
            {
                property.Property.ImplementationTypes.Add(t);
            }

            if (!string.IsNullOrEmpty(interfaceProperty) && !property.InterfaceProperties.Any(it => it.Item2 == interfaceProperty && it.Item1.IsEquals(t)))
            {
                property.InterfaceProperties.Add(new Tuple <CodeTypeReference, string>(t, interfaceProperty));
            }
            return(property);
        }
コード例 #2
0
        public static CodePropertyImplementsInterface Implements(this CodePropertyImplementsInterface property, CodeTypeReference t, string interfaceProperty)
        {
            //if ((property.Attributes & MemberAttributes.Private) == MemberAttributes.Private)
            //    property.Property.PrivateImplementationType = t;
            //else
            {
                if (!property.Property.ImplementationTypes.Contains(t))
                {
                    property.Property.ImplementationTypes.Add(t);
                }

                if (!string.IsNullOrEmpty(interfaceProperty))
                {
                    property.InterfaceProperties[t] = interfaceProperty;
                }
            }
            return(property);
        }
コード例 #3
0
ファイル: Property.cs プロジェクト: zjklee/code2codedom
        public static CodePropertyImplementsInterface Implements(this CodeMemberProperty property, CodeTypeReference t, string interfaceProperty)
        {
            var p = new CodePropertyImplementsInterface(property);

            return(p.Implements(t, interfaceProperty));
        }