Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="fieldType"></param>
        /// <returns></returns>
        public static SPFieldType GetTargetFieldType(NotesFieldType fieldType)
        {
            string typeName = fieldType.ToString();
            var    result   = FieldMap.Where(row => row.NotesFieldType == typeName);

            if (result.Count() == 0)
            {
                result = FieldMap.Where(row => row.NotesFieldType == "DEFAULT");
            }
            SPFieldType type = SPFieldType.Invalid;

            if (result.Count() > 0 && result.First().CanConvert)
            {
                if (Enum.TryParse(result.First().SPFieldType, out type))
                {
                    return(type);
                }
            }
            return(SPFieldType.Invalid);
        }
Ejemplo n.º 2
0
        private void InitField(XmlNode node, XmlNamespaceManager xm, bool isSharedField)
        {
            this._name       = GetAttribute(node, "name");
            this.Title       = GetAttribute(node, "name");
            this.Description = GetAttribute(node, "description");
            string type = GetAttribute(node, "type");

            this._sourceType = this.GetSourceType(type);
            string kind = GetAttribute(node, "kind");

            this.ShowInDisplayForm = true;
            this.ShowInEditForm    = true;
            this.ShowInNewForm     = true;
            this.Required          = false;
            this.Hidden            = false;
            this._isSharedField    = isSharedField;
            switch (kind)
            {
            case "computed":
            case "computedfordisplay":
            case "computedwhencomposed":
                this._computed   = true;
                this._isReadonly = true;
                break;

            default:
                this._isReadonly = false;
                break;
            }
            this.TargetType = MappingInfo.GetTargetFieldType(this.SourceType);
            //Codeを取得
            if (node.NodeType == XmlNodeType.Element)
            {
                this.GetCodes((XmlElement)node, xm);
            }
            //フィールド別の個別属性を取得する
            this.GetFieldInfo(node, xm);
        }