本文整理汇总了C#中ESRI.Replace方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.Replace方法的具体用法?C# ESRI.Replace怎么用?C# ESRI.Replace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.Replace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateMessages
public void UpdateMessages(ESRI.ArcGIS.esriSystem.IArray paramvalues, ESRI.ArcGIS.Geoprocessing.IGPEnvironmentManager pEnvMgr, ESRI.ArcGIS.Geodatabase.IGPMessages Messages)
{
IGPUtilities3 gpUtilities3 = new GPUtilitiesClass();
// check for a valid download url
IGPParameter uploadURLParameter = paramvalues.get_Element(in_uploadURLNumber) as IGPParameter;
IGPString uploadURLGPString = uploadURLParameter.Value as IGPString;
if (uploadURLGPString == null)
{
Messages.ReplaceError(in_uploadURLNumber, -198, String.Format(resourceManager.GetString("GPTools_NullPointerParameterType"), uploadURLParameter.Value.GetAsText()));
}
else
{
try
{
if (uploadURLParameter.HasBeenValidated == false)
{
Uri downloadURI = new Uri(uploadURLGPString.Value);
// check base url
api osmAPICapabilities = OSMGPDownload.CheckValidServerURL(uploadURLGPString.Value);
// if we can construct a valid URI class then we are accepting the value and store it in the user settings as well
if (m_editorConfigurationSettings != null)
{
if (m_editorConfigurationSettings.ContainsKey("osmbaseurl"))
{
m_editorConfigurationSettings["osmbaseurl"] = uploadURLGPString.Value;
}
else
{
m_editorConfigurationSettings.Add("osmbaseurl", uploadURLGPString.Value);
}
OSMGPFactory.StoreOSMEditorSettings(m_editorConfigurationSettings);
}
}
}
catch (Exception ex)
{
StringBuilder errorMessage = new StringBuilder();
errorMessage.AppendLine(resourceManager.GetString("GPTools_OSMGPUpload_invaliduploadurl"));
errorMessage.AppendLine(ex.Message);
Messages.ReplaceError(in_uploadURLNumber, -3, errorMessage.ToString());
}
}
IGPParameter revisionTableParameter = paramvalues.get_Element(in_changesTablesNumber) as IGPParameter;
IGPValue revisionTableGPValue = gpUtilities3.UnpackGPValue(revisionTableParameter);
if (revisionTableGPValue.IsEmpty())
return;
ITable revisionTable = null;
IQueryFilter revisionTableQueryFilter = null;
try
{
using (ComReleaser comReleaser = new ComReleaser())
{
gpUtilities3.DecodeTableView(revisionTableGPValue, out revisionTable, out revisionTableQueryFilter);
comReleaser.ManageLifetime(revisionTable);
if (revisionTable is IFeatureClass)
{
Messages.ReplaceError(in_changesTablesNumber, -4, resourceManager.GetString("GPTools_OSMGPUpload_notarevisiontable"));
return;
}
IDatasetEdit datasetEdit = revisionTable as IDatasetEdit;
comReleaser.ManageLifetime(datasetEdit);
if (datasetEdit == null)
{
return;
}
if (datasetEdit.IsBeingEdited())
{
Messages.ReplaceError(in_changesTablesNumber, -4, resourceManager.GetString("GPTools_OSMGPUpload_inputnotvalidduringedit"));
}
}
gpUtilities3.ReleaseInternals();
}
catch
{
// check if we are dealing with a variable -- if we do then leave this string alone
string tableName = revisionTableGPValue.GetAsText();
string tableNameModified = tableName.Replace("%", String.Empty);
if (((tableName.Length - tableNameModified.Length) % 2) == 0)
{
Messages.Replace(in_changesTablesNumber, new GPMessageClass());
}
}
}
示例2: UpdateMessages
public void UpdateMessages(ESRI.ArcGIS.esriSystem.IArray paramvalues, ESRI.ArcGIS.Geoprocessing.IGPEnvironmentManager pEnvMgr, ESRI.ArcGIS.Geodatabase.IGPMessages Messages)
{
IGPUtilities3 gpUtilities3 = new GPUtilitiesClass();
for (int i = 0; i < Messages.Count; i++)
{
IGPMessage blah = Messages.GetMessage(i);
if (blah.IsError())
{
IGPMessage something = new GPMessageClass();
something.Description = String.Empty;
something.Type = esriGPMessageType.esriGPMessageTypeInformative;
something.ErrorCode = 0;
Messages.Replace(i, something);
}
}
IGPParameter inputOSMParameter = paramvalues.get_Element(in_osmFeatureClassNumber) as IGPParameter;
IGPValue inputOSMGPValue = gpUtilities3.UnpackGPValue(inputOSMParameter);
if (inputOSMGPValue.IsEmpty() == false)
{
IFeatureClass osmFeatureClass = null;
ITable osmInputTable = null;
IQueryFilter osmQueryFilter = null;
try
{
gpUtilities3.DecodeFeatureLayer(inputOSMGPValue, out osmFeatureClass, out osmQueryFilter);
osmInputTable = osmFeatureClass as ITable;
}
catch { }
try
{
if (osmInputTable == null)
{
gpUtilities3.DecodeTableView(inputOSMGPValue, out osmInputTable, out osmQueryFilter);
}
}
catch { }
if (osmInputTable == null)
{
return;
}
// find the field that holds tag binary/xml field
int osmTagCollectionFieldIndex = osmInputTable.FindField("osmTags");
if (osmTagCollectionFieldIndex == -1)
{
Messages.ReplaceAbort(in_osmFeatureClassNumber, resourceManager.GetString("GPTools_OSMGPCombineAttributes_inputlayer_missingtagfield"));
return;
}
}
}