Mono.CSharp.MemberCore.IsExposedFromAssembly C# (CSharp) Method

IsExposedFromAssembly() public method

Returns true when MemberCore is exposed from assembly.
public IsExposedFromAssembly ( ) : bool
return bool
		public bool IsExposedFromAssembly ()
		{
			if ((ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)
				return false;
			
			DeclSpace parentContainer = Parent.PartialContainer;
			while (parentContainer != null && parentContainer.ModFlags != 0) {
				if ((parentContainer.ModFlags & (Modifiers.PUBLIC | Modifiers.PROTECTED)) == 0)
					return false;
				parentContainer = parentContainer.Parent;
			}
			return true;
		}

Usage Example

Example #1
0
File: doc.cs Project: speier/shake
        //
        // Generates xml doc comments (if any), and if required,
        // handle warning report.
        //
        internal static void GenerateDocComment(MemberCore mc,
            DeclSpace ds, Report Report)
        {
            if (mc.DocComment != null) {
                string name = mc.GetDocCommentName (ds);

                XmlNode n = GetDocCommentNode (mc, name, Report);

                XmlElement el = n as XmlElement;
                if (el != null) {
                    mc.OnGenerateDocComment (el);

                    // FIXME: it could be done with XmlReader
                    XmlNodeList nl = n.SelectNodes (".//include");
                    if (nl.Count > 0) {
                        // It could result in current node removal, so prepare another list to iterate.
                        var al = new List<XmlNode> (nl.Count);
                        foreach (XmlNode inc in nl)
                            al.Add (inc);
                        foreach (XmlElement inc in al)
                            if (!HandleInclude (mc, inc, Report))
                                inc.ParentNode.RemoveChild (inc);
                    }

                    // FIXME: it could be done with XmlReader
                    DeclSpace ds_target = mc as DeclSpace;
                    if (ds_target == null)
                        ds_target = ds;

                    foreach (XmlElement see in n.SelectNodes (".//see"))
                        HandleSee (mc, ds_target, see, Report);
                    foreach (XmlElement seealso in n.SelectNodes (".//seealso"))
                        HandleSeeAlso (mc, ds_target, seealso ,Report);
                    foreach (XmlElement see in n.SelectNodes (".//exception"))
                        HandleException (mc, ds_target, see, Report);
                }

                n.WriteTo (RootContext.Documentation.XmlCommentOutput);
            }
            else if (mc.IsExposedFromAssembly ()) {
                Constructor c = mc as Constructor;
                if (c == null || !c.IsDefault ())
                    Report.Warning (1591, 4, mc.Location,
                        "Missing XML comment for publicly visible type or member `{0}'", mc.GetSignatureForError ());
            }
        }
All Usage Examples Of Mono.CSharp.MemberCore::IsExposedFromAssembly