When I click in a code area and then press control-a, I expect to see only the code in the code panel selected. Instead, everything on the page is selected. If I wanted to select everything on the page, then I would not have clicked in the code area.
Update: this is not an issue with short pieces of code, but for longer pieces, it sure is hard to copy just the code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using System.EnterpriseServices;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Server;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.SOESupport;
//TODO: sign the project (project properties > signing tab > sign the assembly)
// this is strongly suggested if the dll will be registered using regasm.exe <your>.dll /codebase
namespace RestSOE1
{
[ComVisible(true)]
[Guid("2d1eaa1c-c07c-47f1-b97e-b0730bbbf619")]
[ClassInterface(ClassInterfaceType.None)]
public class RestSOE1 : ServicedComponent, IServerObjectExtension, IObjectConstruct, IRESTRequestHandler
{
private string soe_name;
private IPropertySet configProps;
private IServerObjectHelper serverObjectHelper;
private ServerLogger logger;
private IRESTRequestHandler reqHandler;
public RestSOE1()
{
soe_name = this.GetType().Name;
logger = new ServerLogger();
reqHandler = new SoeRestImpl(soe_name, CreateRestSchema()) as IRESTRequestHandler;
}
#region IServerObjectExtension Members
public void Init(IServerObjectHelper pSOH)
{
serverObjectHelper = pSOH;
}
public void Shutdown()
{
}
#endregion
#region IObjectConstruct Members
public void Construct(IPropertySet props)
{
configProps = props;
}
#endregion
#region IRESTRequestHandler Members
public string GetSchema()
{
return reqHandler.GetSchema();
}
public byte[] HandleRESTRequest(string Capabilities, string resourceName, string operationName, string operationInput, string outputFormat, string requestProperties, out string responseProperties)
{
return reqHandler.HandleRESTRequest(Capabilities, resourceName, operationName, operationInput, outputFormat, requestProperties, out responseProperties);
}
#endregion
private RestResource CreateRestSchema()
{
RestResource rootRes = new RestResource(soe_name, false, RootResHandler);
RestOperation sampleOper = new RestOperation("sampleOperation",
new string[] { "parm1", "parm2" },
new string[] { "json" },
SampleOperHandler);
rootRes.operations.Add(sampleOper);
return rootRes;
}
private byte[] RootResHandler(NameValueCollection boundVariables, string outputFormat, string requestProperties, out string responseProperties)
{
responseProperties = null;
JsonObject result = new JsonObject();
result.AddString("hello", "world");
return Encoding.UTF8.GetBytes(result.ToJson());
}
private byte[] SampleOperHandler(NameValueCollection boundVariables,
JsonObject operationInput,
string outputFormat,
string requestProperties,
out string responseProperties)
{
responseProperties = null;
string parm1Value;
bool found = operationInput.TryGetString("parm1", out parm1Value);
if (!found || string.IsNullOrEmpty(parm1Value))
throw new ArgumentNullException("parm1");
string parm2Value;
found = operationInput.TryGetString("parm2", out parm2Value);
if (!found || string.IsNullOrEmpty(parm2Value))
throw new ArgumentNullException("parm2");
JsonObject result = new JsonObject();
result.AddString("parm1", parm1Value);
result.AddString("parm2", parm2Value);
return Encoding.UTF8.GetBytes(result.ToJson());
}
}
}