Esempio n. 1
0
        /// <summary>
        /// Determines whether a <see cref="LabelValueCollectionItem"/> is in the collection.
        /// </summary>
        /// <param name="item">The <see cref="LabelValueCollectionItem"/> to locate in the collection. The element to locate can be a null reference.</param>
        /// <returns>true if value is found in the collection; otherwise, false.</returns>
        public bool Contains(LabelValueCollectionItem item)
        {
            if (item == null)
            {
                return(false);
            }

            return(_labelValueCollection.Contains(item));
        }
        bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
        {
            Page.Trace.Warn(this.ID, "LoadPostData...");

            _names = string.Empty;
            _spellValues.Clear();

            Editor editor   = (Editor)this.Parent.Parent.Parent;
            string contents = System.Web.HttpContext.Current.Request.Params[_PARAMETER_CONTENTS_];

            if (editor != null && contents != null && contents != string.Empty)
            {
                _spellChecker.DictionaryFile = DictionaryFile;
                _spellChecker.GetTextFromString(contents);
                _spellChecker.CheckAllWords();

                _names += "'";
                foreach (Word wrd in _spellChecker.WordsCollection)
                {
                    if (!wrd.IsTrue)
                    {
                        _names += /*"'" +*/ wrd.CurrentWord + /*"',"*/ ",";
                        LabelValueCollectionItem item = new LabelValueCollectionItem();
                        item.Label = wrd.CurrentWord;

                        foreach (string trueWord in wrd.TrueWords)
                        {
                            item.Value += trueWord + ";";
                        }
                        item.Value = item.Value.TrimEnd(';');

                        _spellValues.Add(item);
                    }
                }

                _names  = _names.TrimEnd(',');
                _names += "'";

                _names = _names.TrimEnd(',');
            }

            if (postCollection[editor.ClientID] == string.Empty || _names == string.Empty || _names == @"''")
            {
                _tmpShowNothing = true;
            }
            else
            {
                _tmpShowNothing = false;
            }

            if (ShowPopup == false && _tmpShowNothing == false)
            {
                ShowPopup = true;
            }

            if (_tmpShowNothing)
            {
                _showNothing = true;
            }

            _tmpShowNothing = false;

            return(true);
        }
Esempio n. 3
0
 /// <summary>
 /// Removes a <see cref="DateCollectionItem"/> from the collection.
 /// </summary>
 /// <param name="item">The <see cref="DateCollectionItem"/> to remove from the collection.</param>
 public void Remove(LabelValueCollectionItem item)
 {
     _labelValueCollection.Remove(item);
 }