Netcad Netigma API Reference
IExtraCriteriaGenerator Interface
Members  Example  See Also  Send Feedback
Netcad.Netigma Namespace : IExtraCriteriaGenerator Interface


Syntax

 
Visual Basic
C#
 
 

Example

C#Copy Code
using Netcad.Netigma.Web.MultiLang;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Netcad.Data.Filtering;
using System.ComponentModel;
using Netcad.Web.Controls;
using System.Collections.Specialized;
using Netcad.Netigma;

namespace Netcad.Netigma.Web
{
    //TODO:Düzelmeli. string ile işi yok.
    [NetigmaHelpId(104)]
    public class ExtraWhereCriteriaGenerator : IExtraWhereCriteriaGenerator, IPropertyChangeSupport, IDeleteChecker
    {
        [ml_DisplayName(121, "Etkin")]
        [DefaultValue(true)]
        public bool Active { get; set; }

        [NetigmaNonSerialized]
        [ml_DisplayName(2, "Adı")]
        [Browsable(false)]
        public string Name { get { return "WHERE"; } }

        [ml_DisplayName(3, "Gösterim Adı")]
        [Browsable(false)]
        public string DisplayName { get { return ml.ml_string(25, "Ek Sorgu Kriteri"); } }

        [Browsable(false)]
        [ml_DisplayName(122, "Çoklu Kullanım")]
        public bool AllowMultiple { get; private set; }

        [WebEditor("Netcad.Netigma.Design.NetigmaCriteriaEditor, Netcad.Netigma.Design, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
        [ml_DisplayName(26, "Kriter")]
        public OgcCriteriaOperator Criteria { get; set; }

        public ExtraWhereCriteriaGenerator()
        {          
            this.Active = true;
            //this.Criteria = new OgcGroupOperator();//Deserialize bozuluyor!
            this.AllowMultiple = true; //??
        }

        public OgcCriteriaOperator GetCriteria(INetigmaDataSource activeObject, INetigmaDomain domain, IGUIState state)
        {
            return Criteria;
        }

        public IExtraCriteriaGenerator Clone()
        {

            //NETIGMA-2491
            ExtraWhereCriteriaGenerator clone = new ExtraWhereCriteriaGenerator();
            clone.Criteria = this.Criteria != null ? this.Criteria.Clone() as OgcCriteriaOperator : null;
            clone.Active = Active;
            return clone;

            //return new ExtraWhereCriteriaGenerator();//todo:criteria!
        }

        public override string ToString()
        {
            if (!string.IsNullOrWhiteSpace(this.DisplayName))
                return this.DisplayName;
            else
                if (!string.IsNullOrWhiteSpace(this.Name))
                    return this.Name;
                else
                    return ml.ml_string(131, "Gösterim Adı Tanımlanmamış");
        }

        void IPropertyChangeSupport.RenameProperty(IDataSourceProperty property, string newName)
        {
            this.Criteria.AdjustOgcCriteriaForPropertyRename(property.Owner.Name, property.Name, newName);
        }

        bool IDeleteChecker.CheckDelete(object item, System.Collections.Generic.IList<string> resultMessages)
        {
            IDataSourceProperty property = item as IDataSourceProperty;
            if (property != null)
                return (this.Criteria.IsOgcCriteriaRelatedWithProperty(property.Owner.Name, property.Name));
            return false;
        }




    }
}

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2016 All Rights Reserved.