public object ESRI_Image_SendBehind(ResultBuffer rb)
        {
            object result;

            try
            {
                string           argument = LspUtil.GetArgument(rb, 0, null);
                MSCRasterService mSCRasterService;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCRasterService = this.GetImageService(argument);
                }
                else
                {
                    mSCRasterService = AfaDocData.ActiveDocData.CurrentImageService;
                }
                if (mSCRasterService == null)
                {
                    result = null;
                }
                else
                {
                    mSCRasterService.SendBehind();
                    result = LspUtil.LispTrue;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
示例#2
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);
        }
示例#3
0
        public object ESRI_CoordSys_Assign(ResultBuffer rb)
        {
            object result;

            try
            {
                string argument = LspUtil.GetArgument(rb, 0, null);
                if (string.IsNullOrEmpty(argument))
                {
                    result = null;
                }
                else
                {
                    Document arg_1F_0 = AfaDocData.ActiveDocData.Document;
                    if (AfaDocData.ActiveDocData.DocDataset.FeatureServices.Count > 0)
                    {
                        result = null;
                    }
                    else if (MSCPrj.AssignPRJFile(argument))
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_Image_Remove(ResultBuffer rb)
        {
            object result;

            try
            {
                string argument = LspUtil.GetArgument(rb, 0, null);
                if (string.IsNullOrEmpty(argument))
                {
                    result = null;
                }
                else
                {
                    MSCImageService imageService = this.GetImageService(argument);
                    if (imageService == null)
                    {
                        result = null;
                    }
                    else if (imageService.DeleteService())
                    {
                        result = LspUtil.LispTrue;
                    }
                    else
                    {
                        result = null;
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_Map_SetCurrent(ResultBuffer rb)
        {
            object result;

            try
            {
                string        argument   = LspUtil.GetArgument(rb, 0, null);
                MSCMapService mapService = this.GetMapService(argument);
                if (mapService == null)
                {
                    result = null;
                }
                else
                {
                    AfaDocData.ActiveDocData.CurrentMapService = mapService;
                    ArcGISRibbon.SetActiveRasterService(mapService);
                    result = LspUtil.LispTrue;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
示例#6
0
        public object ESRI_FeatureClass_Get(ResultBuffer rb)
        {
            object result;

            try
            {
                string          argument = LspUtil.GetArgument(rb, 0, null);
                MSCFeatureClass mSCFeatureClass;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCFeatureClass = this.GetFeatureClassOrService(argument);
                }
                else
                {
                    mSCFeatureClass = this.GetCurrentFeatureClassOrService();
                }
                if (mSCFeatureClass == null)
                {
                    result = null;
                }
                else
                {
                    string argument2 = LspUtil.GetArgument(rb, 1, null);
                    if (argument2 != null)
                    {
                        mSCFeatureClass = mSCFeatureClass.FindSubtypeName(argument2);
                    }
                    if (mSCFeatureClass == null)
                    {
                        result = null;
                    }
                    else
                    {
                        List <TypedValue> list = new List <TypedValue>();
                        list.Add(new TypedValue(5016, null));
                        LspUtil.AppendDottedPair(ref list, "NAME", mSCFeatureClass.Name);
                        LspUtil.AppendDottedPair(ref list, "GEOMTYPE", MSCFeatureClass.GetGeomString(mSCFeatureClass.GeometryType));
                        if (!string.IsNullOrEmpty(mSCFeatureClass.TypeField))
                        {
                            LspUtil.AppendDottedPair(ref list, "TYPEFIELD", mSCFeatureClass.TypeField);
                        }
                        if (mSCFeatureClass.IsSingleLayerQuery())
                        {
                            LspUtil.AppendDottedPair(ref list, "CADLAYER", mSCFeatureClass.GetFirstLayerFromQuery());
                        }
                        list.Add(new TypedValue(5017, null));
                        ResultBuffer resultBuffer = new ResultBuffer(list.ToArray());
                        result = resultBuffer;
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
示例#7
0
        public object ESRI_Attributes_Get(ResultBuffer rb)
        {
            object result;

            try
            {
                ObjectId argument = LspUtil.GetArgument(rb, 0, ObjectId.Null);
                if (argument == ObjectId.Null)
                {
                    result = null;
                }
                else
                {
                    string          assocParam   = LspUtil.GetAssocParam(rb, "FCNAME", null);
                    string          assocParam2  = LspUtil.GetAssocParam(rb, "STNAME", null);
                    string          fieldName    = LspUtil.GetAssocParam(rb, "FIELDNAME", null);
                    MSCFeatureClass featureClass = this.GetFeatureClass(assocParam, assocParam2);
                    List <CadField> list;
                    if (featureClass == null)
                    {
                        list = CadField.EntityCadFields(argument);
                    }
                    else
                    {
                        list = featureClass.GetEntityFields(argument);
                    }
                    if (!string.IsNullOrEmpty(fieldName))
                    {
                        list = (from x in list
                                where x.Name == fieldName
                                select x).ToList <CadField>();
                    }
                    if (list.Count == 0)
                    {
                        result = null;
                    }
                    else
                    {
                        List <TypedValue> list2 = new List <TypedValue>();
                        list2.Add(new TypedValue(5016, null));
                        foreach (CadField current in list)
                        {
                            LspUtil.AppendDottedPair(ref list2, current.Name, current.Value.Value);
                        }
                        list2.Add(new TypedValue(5017, null));
                        ResultBuffer resultBuffer = new ResultBuffer(list2.ToArray());
                        result = resultBuffer;
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_FeatureService_remove(ResultBuffer rb)
        {
            object result;

            try
            {
                string            argument = LspUtil.GetArgument(rb, 0, null);
                MSCFeatureService mSCFeatureService;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCFeatureService = this.GetFeatureService(argument);
                }
                else
                {
                    mSCFeatureService = this.GetCurrentFeatureService();
                }
                if (mSCFeatureService == null)
                {
                    result = null;
                }
                else
                {
                    bool queryOnly = mSCFeatureService.QueryOnly;
                    if (mSCFeatureService.DeleteService())
                    {
                        AfaDocData.ActiveDocData.DocDataset.FeatureServices.Remove(argument);
                        MSCDataset.SetDefaultActiveFeatureClass();
                        if (AfaDocData.ActiveDocData.DocDataset.FeatureServices.Count == 0)
                        {
                            ArcGISRibbon.EnableFeatureServiceButtons(false);
                        }
                        if (!queryOnly)
                        {
                            ToolPalette.UpdatePalette(AfaDocData.ActiveDocData.DocDataset.ParentDocument, AfaDocData.ActiveDocData.DocDataset, false);
                        }
                    }
                    result = true;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
示例#9
0
        public object ESRI_Subytpe_Names(ResultBuffer rb)
        {
            object result;

            try
            {
                string          argument = LspUtil.GetArgument(rb, 0, null);
                MSCFeatureClass mSCFeatureClass;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCFeatureClass = this.GetFeatureClassOrService(argument);
                }
                else
                {
                    mSCFeatureClass = this.GetCurrentFeatureClassOrService();
                }
                if (mSCFeatureClass == null)
                {
                    result = null;
                }
                else if (mSCFeatureClass.SubTypes.Count == 0)
                {
                    result = null;
                }
                else
                {
                    ResultBuffer resultBuffer = new ResultBuffer();
                    foreach (MSCFeatureClassSubType current in mSCFeatureClass.SubTypes)
                    {
                        resultBuffer.Add(new TypedValue(5005, current.Name));
                    }
                    result = resultBuffer;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
示例#10
0
        public object ESRI_RemoveFeatureClass(ResultBuffer rb)
        {
            object result;

            try
            {
                string          argument = LspUtil.GetArgument(rb, 0, null);
                MSCFeatureClass mSCFeatureClass;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCFeatureClass = this.GetFeatureClassOrService(argument);
                }
                else
                {
                    mSCFeatureClass = this.GetCurrentFeatureClassOrService();
                }
                if (mSCFeatureClass == null)
                {
                    result = null;
                }
                else
                {
                    MSCFeatureClass activeFeatureClassOrSubtype = AfaDocData.ActiveDocData.GetActiveFeatureClassOrSubtype();
                    bool            flag = mSCFeatureClass == activeFeatureClassOrSubtype;
                    AfaDocData.ActiveDocData.DocDataset.RemoveFeatureClass(mSCFeatureClass);
                    if (flag)
                    {
                        MSCDataset.SetDefaultActiveFeatureClass();
                    }
                    result = LspUtil.LispTrue;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_Image_Update(ResultBuffer rb)
        {
            object result;

            try
            {
                if (null == Application.DocumentManager.MdiActiveDocument)
                {
                    result = null;
                }
                else
                {
                    string          argument = LspUtil.GetArgument(rb, 0, null);
                    MSCImageService mSCImageService;
                    if (!string.IsNullOrEmpty(argument))
                    {
                        mSCImageService = this.GetImageService(argument);
                    }
                    else
                    {
                        mSCImageService = AfaDocData.ActiveDocData.CurrentImageService;
                    }
                    if (mSCImageService == null)
                    {
                        result = null;
                    }
                    else
                    {
                        short   num         = short.Parse(mSCImageService.GetTransparency().ToString());
                        Point2d minPoint    = mSCImageService.ExportOptions.BoundingBox.MinPoint;
                        Point2d maxPoint    = mSCImageService.ExportOptions.BoundingBox.MaxPoint;
                        bool    assocParam  = LspUtil.GetAssocParam(rb, "DYNAMIC", mSCImageService.Dynamic);
                        bool    assocParam2 = LspUtil.GetAssocParam(rb, "VISIBLE", mSCImageService.GetVisibility());
                        short   assocParam3 = LspUtil.GetAssocParam(rb, "TRANSPARENCY", num);
                        Point2d assocParam4 = LspUtil.GetAssocParam(rb, "EXTMIN", minPoint);
                        Point2d assocParam5 = LspUtil.GetAssocParam(rb, "EXTMAX", maxPoint);
                        string  assocParam6 = LspUtil.GetAssocParam(rb, "FORMAT", mSCImageService.ExportOptions.Format);
                        string  text        = MSCPrj.ReadWKT(Application.DocumentManager.MdiActiveDocument);
                        if (mSCImageService != null)
                        {
                            mSCImageService.SetVisbility(assocParam2);
                            if (assocParam3 != num)
                            {
                                mSCImageService.SetTransparency((int)assocParam3);
                            }
                            if (assocParam != mSCImageService.Dynamic)
                            {
                                mSCImageService.Dynamic = assocParam;
                            }
                            mSCImageService.ExportOptions.Format    = assocParam6;
                            mSCImageService.ExportOptions.OutputWKT = text;
                            Extent extent = new Extent(assocParam4, assocParam5);
                            if (extent.IsValid())
                            {
                                extent.SetWKTFrom(text);
                                mSCImageService.UpdateExtentLimit(extent);
                            }
                            mSCImageService.Write();
                            mSCImageService.RefreshService();
                            Mouse.OverrideCursor = null;
                            result = true;
                        }
                        else
                        {
                            result = null;
                        }
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_Image_Get(ResultBuffer rb)
        {
            object result;

            try
            {
                string          argument        = LspUtil.GetArgument(rb, 0, null);
                MSCImageService mSCImageService = null;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCImageService = this.GetImageService(argument);
                }
                else
                {
                    mSCImageService = AfaDocData.ActiveDocData.CurrentImageService;
                }
                if (mSCImageService == null)
                {
                    result = null;
                }
                else
                {
                    List <TypedValue> list = new List <TypedValue>();
                    list.Add(new TypedValue(5016, null));
                    if (mSCImageService.ExportOptions != null)
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "DYNAMIC", 5003, mSCImageService.ExportOptions.Dynamic);
                        LspUtil.AppendDottedPair(ref list, 5005, "TRANSPARENCY", 5003, mSCImageService.ExportOptions.Transparency);
                        try
                        {
                            if (mSCImageService.BoundaryExtent.IsValid())
                            {
                                LspUtil.AppendDottedPair(ref list, "EXT", mSCImageService.BoundaryExtent);
                            }
                        }
                        catch
                        {
                        }
                        LspUtil.AppendDottedPair(ref list, 5005, "VISIBILE", 5003, mSCImageService.GetVisibility());
                        if (!string.IsNullOrEmpty(mSCImageService.ExportOptions.Format))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "FORMAT", 5005, mSCImageService.ExportOptions.Format);
                        }
                        if (!string.IsNullOrEmpty(mSCImageService.ConnectionURL))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "URL", 5005, mSCImageService.RestEndpoint);
                        }
                        if (!string.IsNullOrEmpty(mSCImageService.RestEndpoint))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "RESTURL", 5005, mSCImageService.RestEndpoint);
                        }
                        LspUtil.AppendDottedPair(ref list, "COMPRESSION", mSCImageService.ExportOptions.TransCompression);
                        LspUtil.AppendDottedPair(ref list, "MOSAICMETHOD", mSCImageService.ExportOptions.MosaicMethod);
                        LspUtil.AppendDottedPair(ref list, "MOSAICOPERATOR", mSCImageService.ExportOptions.MosaicOperator);
                        LspUtil.AppendDottedPair(ref list, "MOSAICRULE", mSCImageService.ExportOptions.MosaicRule);
                        LspUtil.AppendDottedPair(ref list, "ASCENDING", mSCImageService.ExportOptions.Ascending);
                        LspUtil.AppendDottedPair(ref list, "BANDIDS", mSCImageService.ExportOptions.BandIds);
                        LspUtil.AppendDottedPair(ref list, "INTERPOLATION", mSCImageService.ExportOptions.Interpolation);
                        LspUtil.AppendDottedPair(ref list, "LOCKRASTERID", mSCImageService.ExportOptions.LockRasterID);
                        LspUtil.AppendDottedPair(ref list, "NODATAVALUE", mSCImageService.ExportOptions.NoDataValue);
                        LspUtil.AppendDottedPair(ref list, "ORDERBASEVALUE", mSCImageService.ExportOptions.OrderBaseValue);
                        LspUtil.AppendDottedPair(ref list, "ORDERFIELD", mSCImageService.ExportOptions.OrderField);
                        LspUtil.AppendDottedPair(ref list, "RENDERINGRULE", mSCImageService.ExportOptions.RenderingRule);
                        LspUtil.AppendDottedPair(ref list, "PIXELTYPE", mSCImageService.ExportOptions.PixelType);
                        LspUtil.AppendDottedPair(ref list, "QUALITY", mSCImageService.ExportOptions.Quality);
                    }
                    LspUtil.AppendDottedPair(ref list, 5005, "NAME", 5005, mSCImageService.Name);
                    LspUtil.AppendDottedPair(ref list, 5005, "ENAME", 5006, mSCImageService.RasterObjectId);
                    if (!string.IsNullOrEmpty(mSCImageService.ConnectionURL))
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "URL", 5005, mSCImageService.ConnectionURL);
                    }
                    try
                    {
                        AGSConnection parent = mSCImageService.ParentService.Parent;
                        if (!string.IsNullOrEmpty(parent.Name))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "CONNECTION_NAME", 5005, parent.Name);
                        }
                    }
                    catch
                    {
                    }
                    try
                    {
                        if (!string.IsNullOrEmpty(mSCImageService.CurrentFileName))
                        {
                            LspUtil.AppendDottedPair(ref list, "CURRENTFILE", 5005, mSCImageService.CurrentFileName);
                        }
                        mSCImageService.ParentService.GetWKT();
                        if (mSCImageService.ParentService != null)
                        {
                            foreach (KeyValuePair <string, object> current in mSCImageService.ParentService.Properties)
                            {
                                try
                                {
                                    LspUtil.AppendDottedPair(ref list, current.Key, current.Value);
                                }
                                catch
                                {
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    list.Add(new TypedValue(5017, null));
                    ResultBuffer resultBuffer = new ResultBuffer(list.ToArray());
                    result = resultBuffer;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_Map_Get(ResultBuffer rb)
        {
            object result;

            try
            {
                string        argument      = LspUtil.GetArgument(rb, 0, null);
                MSCMapService mSCMapService = null;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCMapService = this.GetMapService(argument);
                }
                else
                {
                    mSCMapService = AfaDocData.ActiveDocData.CurrentMapService;
                }
                if (mSCMapService == null)
                {
                    result = null;
                }
                else
                {
                    List <TypedValue> list = new List <TypedValue>();
                    list.Add(new TypedValue(5016, null));
                    if (mSCMapService.ExportOptions != null)
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "DYNAMIC", 5003, mSCMapService.ExportOptions.Dynamic);
                        LspUtil.AppendDottedPair(ref list, 5005, "TRANSPARENCY", 5003, mSCMapService.ExportOptions.Transparency);
                        try
                        {
                            if (mSCMapService.BoundaryExtent.IsValid())
                            {
                                LspUtil.AppendDottedPair(ref list, "EXT", mSCMapService.BoundaryExtent);
                            }
                        }
                        catch
                        {
                        }
                        if (!string.IsNullOrEmpty(mSCMapService.ExportOptions.Format))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "FORMAT", 5005, mSCMapService.ExportOptions.Format);
                        }
                    }
                    LspUtil.AppendDottedPair(ref list, 5005, "VISIBILE", 5003, mSCMapService.GetVisibility());
                    LspUtil.AppendDottedPair(ref list, 5005, "NAME", 5005, mSCMapService.Name);
                    LspUtil.AppendDottedPair(ref list, 5005, "ENAME", 5006, mSCMapService.RasterObjectId);
                    if (!string.IsNullOrEmpty(mSCMapService.ConnectionURL))
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "URL", 5005, mSCMapService.ConnectionURL);
                    }
                    if (!string.IsNullOrEmpty(mSCMapService.RestEndpoint))
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "RESTURL", 5005, mSCMapService.RestEndpoint);
                    }
                    try
                    {
                        AGSConnection parent = mSCMapService.ParentService.Parent;
                        if (!string.IsNullOrEmpty(parent.Name))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "CONNECTION_NAME", 5005, parent.Name);
                        }
                    }
                    catch
                    {
                    }
                    try
                    {
                        if (!string.IsNullOrEmpty(mSCMapService.CurrentFileName))
                        {
                            LspUtil.AppendDottedPair(ref list, "CURRENTFILE", 5005, mSCMapService.CurrentFileName);
                        }
                        mSCMapService.ParentService.GetWKT();
                        if (mSCMapService.ParentService != null)
                        {
                            foreach (KeyValuePair <string, object> current in mSCMapService.ParentService.Properties)
                            {
                                try
                                {
                                    LspUtil.AppendDottedPair(ref list, current.Key, current.Value);
                                }
                                catch
                                {
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    list.Add(new TypedValue(5017, null));
                    ResultBuffer resultBuffer = new ResultBuffer(list.ToArray());
                    result = resultBuffer;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_FeatureService_Get(ResultBuffer rb)
        {
            object result;

            try
            {
                string            argument          = LspUtil.GetArgument(rb, 0, null);
                MSCFeatureService mSCFeatureService = null;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCFeatureService = this.GetFeatureService(argument);
                }
                else
                {
                    mSCFeatureService = this.GetCurrentFeatureService();
                }
                if (mSCFeatureService == null)
                {
                    result = null;
                }
                else
                {
                    List <TypedValue> list = new List <TypedValue>();
                    list.Add(new TypedValue(5016, null));
                    LspUtil.AppendDottedPair(ref list, "SERVICENAME", mSCFeatureService.Name);
                    LspUtil.AppendDottedPair(ref list, "GEOMTYPE", MSCFeatureClass.GetGeomString(mSCFeatureService.GeometryType));
                    if (!string.IsNullOrEmpty(mSCFeatureService.TypeField))
                    {
                        LspUtil.AppendDottedPair(ref list, "TYPEFIELD", mSCFeatureService.TypeField);
                    }
                    LspUtil.AppendDottedPair(ref list, "CADLAYER", mSCFeatureService.LayerName);
                    LspUtil.AppendDottedPair(ref list, "LAYERID", mSCFeatureService.ServiceLayerID);
                    if (mSCFeatureService.ExportOptions != null)
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "EDITMODE", 5003, mSCFeatureService.ExportOptions.Dynamic);
                        try
                        {
                            if (mSCFeatureService.ExportOptions.BoundingBox.IsValid())
                            {
                                LspUtil.AppendDottedPair(ref list, "EXT", mSCFeatureService.ExportOptions.BoundingBox);
                            }
                        }
                        catch
                        {
                        }
                    }
                    LspUtil.AppendDottedPair(ref list, 5005, "NAME", 5005, mSCFeatureService.Name);
                    if (!string.IsNullOrEmpty(mSCFeatureService.ConnectionURL))
                    {
                        LspUtil.AppendDottedPair(ref list, 5005, "URL", 5005, mSCFeatureService.ConnectionURL);
                    }
                    try
                    {
                        AGSConnection parent = mSCFeatureService.ParentService.Parent;
                        if (!string.IsNullOrEmpty(parent.Name))
                        {
                            LspUtil.AppendDottedPair(ref list, 5005, "CONNECTION_NAME", 5005, parent.Name);
                        }
                    }
                    catch
                    {
                    }
                    try
                    {
                        mSCFeatureService.ParentService.GetWKT();
                        if (mSCFeatureService.ParentService != null)
                        {
                            foreach (KeyValuePair <string, object> current in mSCFeatureService.ParentService.Properties)
                            {
                                try
                                {
                                    LspUtil.AppendDottedPair(ref list, current.Key, current.Value);
                                }
                                catch
                                {
                                }
                            }
                        }
                    }
                    catch
                    {
                    }
                    list.Add(new TypedValue(5017, null));
                    ResultBuffer resultBuffer = new ResultBuffer(list.ToArray());
                    result = resultBuffer;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
        public object ESRI_FeatureService_set(ResultBuffer rb)
        {
            object result;

            try
            {
                if (null == Application.DocumentManager.MdiActiveDocument)
                {
                    result = null;
                }
                else
                {
                    string            argument = LspUtil.GetArgument(rb, 0, null);
                    MSCFeatureService mSCFeatureService;
                    if (!string.IsNullOrEmpty(argument))
                    {
                        mSCFeatureService = this.GetFeatureService(argument);
                    }
                    else
                    {
                        mSCFeatureService = this.GetCurrentFeatureService();
                    }
                    if (mSCFeatureService == null)
                    {
                        result = null;
                    }
                    else
                    {
                        AGSExportOptions exportOptions = mSCFeatureService.ExportOptions;
                        bool             assocParam    = LspUtil.GetAssocParam(rb, "EDITMODE", exportOptions.Dynamic);
                        Point2d          assocParam2   = LspUtil.GetAssocParam(rb, "EXTMIN", exportOptions.BoundingBox.MinPoint);
                        Point2d          assocParam3   = LspUtil.GetAssocParam(rb, "EXTMAX", exportOptions.BoundingBox.MaxPoint);
                        string           text          = MSCPrj.ReadWKT(Application.DocumentManager.MdiActiveDocument);
                        if (mSCFeatureService != null)
                        {
                            if (assocParam)
                            {
                                mSCFeatureService.QueryOnly = false;
                                mSCFeatureService.SetLayerLock(false);
                            }
                            else
                            {
                                mSCFeatureService.QueryOnly = true;
                                mSCFeatureService.SetLayerLock(true);
                            }
                            mSCFeatureService.ExportOptions.Dynamic   = assocParam;
                            mSCFeatureService.ExportOptions.OutputWKT = text;
                            Extent extent = new Extent(assocParam2, assocParam3);
                            if (extent.IsValid())
                            {
                                extent.SetWKTFrom(text);
                                mSCFeatureService.UpdateExtentLimit(extent);
                            }
                            mSCFeatureService.Write();
                            Mouse.OverrideCursor = null;
                            result = true;
                        }
                        else
                        {
                            result = null;
                        }
                    }
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }