Esempio n. 1
0
        private void PortMissingCommentsForType(DocsType dTypeToUpdate)
        {
            if (!CanAnalyzeAPI(dTypeToUpdate))
            {
                return;
            }

            TripleSlashMember tsTypeToPort = TripleSlashComments.Members.FirstOrDefault(x => x.Name == dTypeToUpdate.DocIdEscaped);

            if (tsTypeToPort != null)
            {
                if (tsTypeToPort.Name == dTypeToUpdate.DocIdEscaped)
                {
                    TryPortMissingSummaryForAPI(dTypeToUpdate, tsTypeToPort, null);
                    TryPortMissingRemarksForAPI(dTypeToUpdate, tsTypeToPort, null);
                    TryPortMissingParamsForAPI(dTypeToUpdate, tsTypeToPort, null); // Some types, like delegates, have params
                }

                if (dTypeToUpdate.Changed)
                {
                    ModifiedTypes.AddIfNotExists(dTypeToUpdate.DocId);
                    ModifiedFiles.AddIfNotExists(dTypeToUpdate.FilePath);
                }
            }
        }
Esempio n. 2
0
        public bool ListByDocs_id(int document_id, DocsType docsType)
        {
            string sql_condition = string.Format("{0}=:{0} AND {1}=:{1}", Tnet_User_Documents._DOCUMENTS_ID, Tnet_User_Documents._DOCUMENTS_TYPE);

            AddParameter(Tnet_User_Documents._DOCUMENTS_ID, document_id);
            AddParameter(Tnet_User_Documents._DOCUMENTS_TYPE, docsType);
            return(ListByCondition(sql_condition));
        }
Esempio n. 3
0
        /// <summary>
        /// 查询认证信息
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="type">证件类型</param>
        /// <param name="isContainDel">是否包含已删除的数据</param>
        /// <returns></returns>
        public bool SelectByUid_DocType_DelFlag(int userId, DocsType type, bool isContainDel = false)
        {
            string sql_condition = " USER_ID=:USER_ID AND DOCUMENTS_TYPE=:DOCUMENTS_TYPE";

            AddParameter(_USER_ID, userId);
            AddParameter(_DOCUMENTS_TYPE, type);
            if (!isContainDel)
            {
                sql_condition += " AND STATUS<>:DEL_FLAG";
                AddParameter("DEL_FLAG", ValidateStatus.已删除);
            }
            return(SelectByCondition(sql_condition));
        }
Esempio n. 4
0
        private bool IsTypeAllowed(DocsAPI api)
        {
            // All types are allowed
            if (Config.ExcludedTypes.Count() == 0 &&
                Config.IncludedTypes.Count() == 0)
            {
                return(true);
            }

            string typeName;
            string typeFullName;

            if (api is DocsType)
            {
                DocsType type = (DocsType)api;
                typeName     = type.Name;
                typeFullName = type.FullName;
            }
            else if (api is DocsMember)
            {
                DocsMember member = (DocsMember)api;
                typeName     = member.ParentType.Name;
                typeFullName = member.ParentType.FullName;
            }
            else
            {
                throw new InvalidCastException();
            }

            if (Config.ExcludedTypes.Count() > 0)
            {
                if (Config.ExcludedTypes.Contains(typeName) || Config.ExcludedTypes.Contains(typeFullName))
                {
                    return(false);
                }
            }
            if (Config.IncludedTypes.Count() > 0)
            {
                if (Config.IncludedTypes.Contains(typeName) || Config.IncludedTypes.Contains(typeFullName))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 5
0
        private void PortMissingCommentsForType(DocsType dTypeToUpdate)
        {
            IntelliSenseXmlMember?tsTypeToPort = IntelliSenseXmlComments.Members.FirstOrDefault(x => x.Name == dTypeToUpdate.DocIdEscaped);

            if (tsTypeToPort != null)
            {
                if (tsTypeToPort.Name == dTypeToUpdate.DocIdEscaped)
                {
                    TryPortMissingSummaryForAPI(dTypeToUpdate, tsTypeToPort, null);
                    TryPortMissingRemarksForAPI(dTypeToUpdate, tsTypeToPort, null, skipInterfaceRemarks: true);
                    TryPortMissingParamsForAPI(dTypeToUpdate, tsTypeToPort, null);     // Some types, like delegates, have params
                    TryPortMissingTypeParamsForAPI(dTypeToUpdate, tsTypeToPort, null); // Type names ending with <T> have TypeParams
                }

                if (dTypeToUpdate.Changed)
                {
                    ModifiedTypes.AddIfNotExists(dTypeToUpdate.DocId);
                    ModifiedFiles.AddIfNotExists(dTypeToUpdate.FilePath);
                }
            }
        }
Esempio n. 6
0
        private static bool TryPortMissingCommentsForContainer(TripleSlashMember tsMember, DocsType dType)
        {
            bool modified = false;

            if (tsMember.Name == dType.DocId)
            {
                // The triple slash member is referring to the base type (container) in the docs xml
                if (!IsEmpty(tsMember.Summary) && IsEmpty(dType.Summary))
                {
                    PrintModifiedMember("CONTAINER SUMMARY", dType.FilePath, tsMember.Name, dType.DocId, tsMember.Summary, dType.Summary);

                    dType.Summary = tsMember.Summary;
                    TotalModifiedIndividualElements++;
                    modified = true;
                }

                if (!IsEmpty(tsMember.Remarks) && IsEmpty(dType.Remarks))
                {
                    PrintModifiedMember("CONTAINER REMARKS", dType.FilePath, tsMember.Name, dType.DocId, tsMember.Remarks, dType.Remarks);

                    dType.Remarks = tsMember.Remarks;
                    TotalModifiedIndividualElements++;
                    modified = true;
                }

                if (modified)
                {
                    ModifiedContainers.AddIfNotExists(dType.DocId);
                }
            }

            if (modified)
            {
                ModifiedAPIs.AddIfNotExists(dType.DocId);
            }

            return(modified);
        }
 public LocationInformation(DocsType api, Location location, Compilation compilation)
 {
     Api   = api;
     Tree  = location.SourceTree ?? throw new NullReferenceException($"Tree null for '{api.FullName}'");
     Model = compilation.GetSemanticModel(Tree);
 }