/// <summary>
 /// Returns TRUE if filtered
 /// </summary>
 /// <param name="theItem"></param>
 /// <returns></returns>
 bool PerItemFilter(KGFITaggable theItem)
 {
     foreach (KGFObjectListColumnItem aFieldItem in itsListFieldCache)
     {
         object aValue = aFieldItem.GetReturnValue(theItem);
         // check item filtering
         if (aFieldItem.GetIsFiltered(aValue))
         {
             return(true);
         }
     }
     return(false);
 }
    void OnClickRow(object theSender, EventArgs theArgs)
    {
        KGFDataRow aRow = theSender as KGFDataRow;

        if (aRow != null)
        {
            itsCurrentSelectedItem = (KGFITaggable)aRow [0].Value;
            if (itsCurrentSelectedRow != aRow)
            {
                itsCurrentSelectedRow = aRow;
            }
            if (EventSelect != null)
            {
                EventSelect(this, new KGFGUIObjectListSelectEventArgs(itsCurrentSelectedItem));
            }
        }
    }
    /// <summary>
    /// Set currently selected item
    /// </summary>
    /// <param name="theObject"></param>
    public void SetSelected(KGFITaggable theObject)
    {
        itsCurrentSelectedItem = theObject;

        int i = 0;

        foreach (KGFDataRow aRow in itsData.Rows)
        {
            if (aRow[0].Value == theObject)
            {
                itsGuiData.SetCurrentSelected(aRow);
                itsCurrentPage = i / ((int)itsItemsPerPage);
                break;
            }
            i++;
        }
    }
    /// <summary>
    /// Returns TRUE if filtered
    /// </summary>
    /// <param name="theItem"></param>
    /// <returns></returns>
    bool FullTextFilter(KGFITaggable theItem)
    {
        if (itsFulltextSearch.Trim() == itsTextSearch)
        {
            return(false);
        }

        foreach (string aSearchPartFull in itsFulltextSearch.Trim().ToLower().Split(' '))
        {
            bool      aFoundPart       = false;
            string    aSearchPartValue = aSearchPartFull;
            string    aSearchPartName  = null;
            string [] aSearchPartArr   = aSearchPartFull.Split('=');
            if (aSearchPartArr.Length == 2)
            {
                aSearchPartValue = aSearchPartArr[1];
                aSearchPartName  = aSearchPartArr[0];
            }

            foreach (KGFObjectListColumnItem aFieldItem in itsListFieldCache)
            {
                // if it is a search for a special field, only use it for that field
                if (aSearchPartName != null)
                {
                    if (aFieldItem.itsHeader.ToLower() != aSearchPartName.ToLower())
                    {
                        continue;
                    }
                }

                object aValue = aFieldItem.GetReturnValue(theItem);                //itsFieldInfo.GetValue (theItem);

                if (aFieldItem.itsSearchable)
                {
                    if (aValue is IEnumerable && !(aValue is string))
                    {
                        foreach (object aValueItem in (IEnumerable)aValue)
                        {
                            if (aValueItem == null)
                            {
                                continue;
                            }
                            if (aValueItem.ToString().Trim().ToLower().Contains(aSearchPartValue))
                            {
                                aFoundPart = true;
                            }
                        }
                    }
                    else
                    {
                        string aValueString = aValue.ToString();
                        if (aValueString.Trim().ToLower().Contains(aSearchPartValue))
                        {
                            aFoundPart = true;
                        }
                    }
                }
            }

            if (!aFoundPart)
            {
                return(true);
            }
        }
        return(false);
    }
 public KGFGUIObjectListSelectEventArgs(KGFITaggable theItem)
 {
     itsItem = theItem;
 }
 /// <summary>
 /// Clears the selected item
 /// </summary>
 public void ClearSelected()
 {
     itsCurrentSelectedItem = null;
 }
	/// <summary>
	/// Returns TRUE if filtered
	/// </summary>
	/// <param name="theItem"></param>
	/// <returns></returns>
	bool PerItemFilter(KGFITaggable theItem)
	{
		foreach (KGFObjectListColumnItem aFieldItem in itsListFieldCache)
		{
			object aValue = aFieldItem.GetReturnValue (theItem);
			// check item filtering
			if (aFieldItem.GetIsFiltered (aValue))
			{
				return true;
			}
		}
		return false;
	}
		public KGFGUIObjectListSelectEventArgs (KGFITaggable theItem)
		{
			itsItem = theItem;
		}
	/// <summary>
	/// Returns TRUE if filtered
	/// </summary>
	/// <param name="theItem"></param>
	/// <returns></returns>
	bool FullTextFilter(KGFITaggable theItem)
	{
		if (itsFulltextSearch.Trim() == itsTextSearch)
			return false;
		
		foreach (string aSearchPartFull in itsFulltextSearch.Trim().ToLower().Split(' '))
		{
			bool aFoundPart = false;
			string aSearchPartValue = aSearchPartFull;
			string aSearchPartName = null;
			string [] aSearchPartArr = aSearchPartFull.Split('=');
			if (aSearchPartArr.Length == 2)
			{
				aSearchPartValue = aSearchPartArr[1];
				aSearchPartName = aSearchPartArr[0];
			}
			
			foreach (KGFObjectListColumnItem aFieldItem in itsListFieldCache)
			{
				// if it is a search for a special field, only use it for that field
				if (aSearchPartName != null)
				{
					if (aFieldItem.itsHeader.ToLower() != aSearchPartName.ToLower())
						continue;
				}
				
				object aValue = aFieldItem.GetReturnValue(theItem);//itsFieldInfo.GetValue (theItem);
				
				if (aFieldItem.itsSearchable)
				{
					if (aValue is IEnumerable && !(aValue is string))
					{
						foreach (object aValueItem in (IEnumerable)aValue)
						{
							if (aValueItem == null)
								continue;
							if (aValueItem.ToString().Trim().ToLower().Contains(aSearchPartValue))
							{
								aFoundPart = true;
							}
						}
					}
					else
					{
						string aValueString = aValue.ToString();
						if (aValueString.Trim ().ToLower ().Contains (aSearchPartValue))
						{
							aFoundPart = true;
						}
					}
				}
			}
			
			if (!aFoundPart)
				return true;
		}
		return false;
	}
Exemplo n.º 10
0
	void OnClickRow (object theSender, EventArgs theArgs)
	{
		KGFDataRow aRow = theSender as KGFDataRow;
		
		if (aRow != null)
		{
			itsCurrentSelectedItem = (KGFITaggable)aRow [0].Value;
			if (itsCurrentSelectedRow != aRow)
			{
				itsCurrentSelectedRow = aRow;
			}
			if (EventSelect != null)
			{
				EventSelect (this, new KGFGUIObjectListSelectEventArgs (itsCurrentSelectedItem));
			}
		}
	}
Exemplo n.º 11
0
	/// <summary>
	/// Set currently selected item
	/// </summary>
	/// <param name="theObject"></param>
	public void SetSelected(KGFITaggable theObject)
	{
		itsCurrentSelectedItem = theObject;
		
		int i = 0;
		foreach (KGFDataRow aRow in itsData.Rows)
		{
			if (aRow[0].Value == theObject)
			{
				itsGuiData.SetCurrentSelected(aRow);
				itsCurrentPage = i/((int)itsItemsPerPage);
				break;
			}
			i++;
		}
	}
Exemplo n.º 12
0
	/// <summary>
	/// Clears the selected item
	/// </summary>
	public void ClearSelected ()
	{
		itsCurrentSelectedItem = null;
	}