Пример #1
0
        public object ESRI_GetSubtypeLayer(ResultBuffer rb)
        {
            object result;

            try
            {
                string argument  = LspUtil.GetArgument(rb, 0, null);
                string argument2 = LspUtil.GetArgument(rb, 1, null);
                if (string.IsNullOrEmpty(argument) || string.IsNullOrEmpty(argument2))
                {
                    result = null;
                }
                else
                {
                    MSCFeatureClass        featureClassOrService  = this.GetFeatureClassOrService(argument);
                    MSCFeatureClassSubType mSCFeatureClassSubType = featureClassOrService.FindSubtypeName(argument2);
                    result = mSCFeatureClassSubType.CadLayerName;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_SetCurrentFeatureService(ResultBuffer rb)
        {
            object result;

            try
            {
                TypedValue[] array = rb.AsArray();
                if (array.Count <TypedValue>() < 1)
                {
                    result = null;
                }
                else
                {
                    TypedValue typedValue = array[0];
                    if (typedValue.TypeCode != 5005)
                    {
                        result = null;
                    }
                    else
                    {
                        string          name            = typedValue.Value.ToString();
                        MSCFeatureClass mSCFeatureClass = this.GetFeatureClassOrService(name);
                        if (mSCFeatureClass == null)
                        {
                            result = null;
                        }
                        else if (!(mSCFeatureClass is MSCFeatureService))
                        {
                            result = null;
                        }
                        else
                        {
                            if (array.Count <TypedValue>() > 1)
                            {
                                TypedValue typedValue2 = array[1];
                                if (typedValue2.TypeCode != 5005)
                                {
                                    result = null;
                                    return(result);
                                }
                                string stName = typedValue2.Value.ToString();
                                MSCFeatureClassSubType mSCFeatureClassSubType = mSCFeatureClass.FindSubtypeName(stName);
                                if (mSCFeatureClassSubType != null)
                                {
                                    mSCFeatureClass = mSCFeatureClassSubType;
                                }
                            }
                            ArcGISRibbon.SetActiveFeatureClass(mSCFeatureClass);
                            result = mSCFeatureClass.Name;
                        }
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }