Beispiel #1
0
        private void SetLayerDefinition(ILayer lyr)
        {
            if (lyr is ICompositeLayer)
            {
                ICompositeLayer comlyr = lyr as ICompositeLayer;
                for (int j = 0; j < comlyr.Count; j++)
                {
                    ILayer lyr2 = comlyr.get_Layer(j);
                    SetLayerDefinition(lyr2);
                }
            }
            else
            {
                switch (lyr.Name.Trim().ToLower())
                {
                case "checkitemptn":
                case "checkitemln":
                case "checkitempoly":
                case "checkarea":
                    if (lyr is IFeatureLayerDefinition2)
                    {
                        IFeatureLayerDefinition2 flyrd = lyr as IFeatureLayerDefinition2;
                        flyrd.DefinitionExpression = "VersionName = '" + AppManager.GetInstance().TaskName + "'";
                    }
                    break;

                case "passedgrid":
                    if (lyr is IFeatureLayerDefinition2)
                    {
                        IFeatureLayerDefinition2 flyrd = lyr as IFeatureLayerDefinition2;
                        flyrd.DefinitionExpression = "passed =1 and TaskName='" + AppManager.GetInstance().TaskName + "'";
                    }
                    break;

                case "updategrid":
                    if (lyr is IFeatureLayerDefinition2)
                    {
                        IFeatureLayerDefinition2 flyrd = lyr as IFeatureLayerDefinition2;
                        flyrd.DefinitionExpression = "passed is null and TaskName='" + AppManager.GetInstance().TaskName + "'";
                    }
                    break;

                default:
                    break;
                }
            }
        }