Пример #1
0
        /// <summary>
        /// Initializes the controls.
        /// </summary>
        ///
        /// <param name="container">The container.</param>
        protected override void InitializeControls(GenericContainer container)
        {
            base.InitializeControls(container);

            //SPLIT FLIED LIST FOR LATER USE
            if (!string.IsNullOrWhiteSpace(ExcludedFields))
            {
                ExcludedFieldsList = ExcludedFields.Split(',');
            }
        }
Пример #2
0
        protected ListMassInputViewModel(bool canHandleHotKeys)
        {
            _canHandleHotKeys = canHandleHotKeys;
            Items             = new DirtyCollection <T>();

            _fields = new Lazy <ObservableCollection <DataField> >(
                () => new ObservableCollection <DataField>(
                    GetFields(typeof(T))
                    .Where(f => !ExcludedFields.Any(e => e.Equals(f.FieldName, StringComparison.OrdinalIgnoreCase)))
                    .Select((f, i) => new { f, i })
                    .OrderBy(t => GetSortingOrder(t.f, t.i))
                    .Select(t => t.f)),
                LazyThreadSafetyMode.ExecutionAndPublication);

            CreateMenu();
        }
Пример #3
0
        /// <summary>
        /// Retrieves a list of fields in a goven content type trimming the list in Excluded fields
        /// </summary>
        /// <param name="contentType">Content Type object to populates fields from</param>
        /// <returns>A list of SPField objects that are allowed</returns>
        private List <SPField> GetAllowedFields(SPContentType contentType)
        {
            List <string>  excluded = new List <string>();
            List <SPField> allowed  = new List <SPField>();

            if (!String.IsNullOrEmpty(ExcludedFields))
            {
                excluded.AddRange(ExcludedFields.Split(','));
            }
            foreach (SPField field in contentType.Fields)
            {
                if (!excluded.Contains(field.Title) && !field.Hidden)//&& (field.Type == SPFieldType.Text || field.Type == SPFieldType.Note)
                {
                    allowed.Add(field);
                }
            }
            return(allowed);
        }
Пример #4
0
 public FieldMappings ExcludeField(string fieldName)
 {
     ExcludedFields.Add(fieldName);
     return(this);
 }
Пример #5
0
        public ArtItem()
        {
            _fields = new Lazy <ObservableCollection <DataField> >(
                () => new ObservableCollection <DataField>(GetFields(typeof(ArtItem)).Where(f => !ExcludedFields.Any(e => e.Equals(f.FieldName, StringComparison.OrdinalIgnoreCase)))),
                LazyThreadSafetyMode.ExecutionAndPublication);

            SKUList       = new SkuListMassInputViewModel(false);
            Art2GroupList = new Art2GroupListMassInputViewModel(false);
        }
Пример #6
0
 public void RemoveField(Field field)
 {
     ExcludedFields.Add(field);
 }