本文整理汇总了C#中IPropertySet.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertySet.GetProperty方法的具体用法?C# IPropertySet.GetProperty怎么用?C# IPropertySet.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertySet
的用法示例。
在下文中一共展示了IPropertySet.GetProperty方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Construct
public void Construct(IPropertySet props)
{
configProps = props;
strServer = props.GetProperty("Server").ToString();
strInstance = props.GetProperty("Instance").ToString();
strDatabase = props.GetProperty("Database").ToString();
strVersion = props.GetProperty("Version").ToString();
strUser = props.GetProperty("User").ToString();
strPasswd = props.GetProperty("Password").ToString();
}
示例2: Construct
public void Construct(IPropertySet props)
{
configProps = props;
string lid = (string)props.GetProperty("layerId");
this.layerId = Convert.ToInt32(lid);
this.fc = (IFeatureClass) this.mapServerDataAccess.GetDataSource(this.mapServerInfo.Name, this.layerId);
this.editLayerInfo = this.layerInfos.get_Element(this.layerId);
}
示例3: SetProperties
/// <summary>
/// Populates the dialog's listview in order to display the identify results
/// </summary>
/// <param name="propSet"></param>
/// <remarks>The identify results are passed by the layer by the IdentifyObject through a PropertySet</remarks>
public void SetProperties(IPropertySet propSet)
{
if(null == propSet)
return;
//The listView gets pairs of items since it has two columns for fields and value
string id = Convert.ToString(propSet.GetProperty("ID"));
listView1.Items.Add(new ListViewItem(new string[2] {"ID", id}));
string zipCode = Convert.ToString(propSet.GetProperty("ZIPCODE"));
listView1.Items.Add(new ListViewItem(new string[2] {"ZIPCODE", zipCode}));
string cityName = Convert.ToString(propSet.GetProperty("CITYNAME"));
listView1.Items.Add(new ListViewItem(new string[2] {"CITYNAME", cityName}));
string latitude = Convert.ToString(propSet.GetProperty("LAT"));
listView1.Items.Add(new ListViewItem(new string[2] {"LATITUDE", latitude}));
string longitude = Convert.ToString(propSet.GetProperty("LON"));
listView1.Items.Add(new ListViewItem(new string[2] {"LONGITUDE", longitude}));
string temperature = Convert.ToString(propSet.GetProperty("TEMPERATURE"));
listView1.Items.Add(new ListViewItem(new string[2] {"TEMPERATURE", temperature}));
string description = Convert.ToString(propSet.GetProperty("CONDITION"));
listView1.Items.Add(new ListViewItem(new string[2] {"DESCRIPTION", description}));
string day = Convert.ToString(propSet.GetProperty("DAY"));
listView1.Items.Add(new ListViewItem(new string[2] {"DAY", day}));
string date = Convert.ToString(propSet.GetProperty("DATE"));
listView1.Items.Add(new ListViewItem(new string[2] {"DATE", date}));
string low = Convert.ToString(propSet.GetProperty("LOW"));
listView1.Items.Add(new ListViewItem(new string[2] {"LOW", low}));
string high = Convert.ToString(propSet.GetProperty("HIGH"));
listView1.Items.Add(new ListViewItem(new string[2] {"HIGH", high}));
string updated = Convert.ToDateTime(propSet.GetProperty("UPDATED")).ToLongTimeString();
listView1.Items.Add(new ListViewItem(new string[2] {"UPDATED", updated}));
string icon = Convert.ToString(propSet.GetProperty("ICONNAME"));
listView1.Items.Add(new ListViewItem(new string[2] {"ICON", icon}));
}
示例4: Construct
public void Construct(IPropertySet props)
{
try
{
logger.LogMessage(ServerLogger.msgType.infoDetailed, "Construct", 8000, "Watershed SOE constructor running");
object tProperty = null;
m_CanDoWatershed = true;
// IPropertySet doesn't have anything like a trygetvalue method
// so if we don't know if a property will be present we have to just try getting
// it and if there is an exception assumes it wasn't there
try {
tProperty = props.GetProperty("FlowAccLayer");
if (tProperty as string == "None")
{
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: Flow accumulation layer set to 'None'. No watershed functionality.");
m_CanDoWatershed = false;
//throw new ArgumentNullException();
}
else
{
m_FlowAccLayerName = tProperty as string;
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: found definition for Flow Accumulation layer: " + m_FlowAccLayerName);
}
}
catch{
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: Flow accumulation layer not set. No watershed functionality.");
m_CanDoWatershed = false;
//throw new ArgumentNullException();
}
try {
tProperty = props.GetProperty("FlowDirLayer");
if (tProperty as string == "None")
{
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: Flow direction layer set to 'None'. No watershed functionality.");
m_CanDoWatershed = false;
}
else
{
m_FlowDirLayerName = tProperty as string;
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: found definition for Flow direction layer: " + m_FlowDirLayerName);
}
}
catch {
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: Flow direction layer not set. No watershed functionality.");
m_CanDoWatershed = false;
}
try
{
tProperty = props.GetProperty("ExtentFeatureLayer") as string;
if (tProperty as string =="None"){
logger.LogMessage(ServerLogger.msgType.debug, "Construct", 8000,
"WSH: No extent features configured. Extent may still be passed as input");
}
else
{
m_ExtentFeatureLayerName = tProperty as string;
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: found definition for Extent Feature layer: " + m_ExtentFeatureLayerName);
}
}
catch {
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: no definition for extent feature layers found. Extent may still be passed as input");
}
try
{
tProperty = props.GetProperty("ReadConfigFromMap");
if (tProperty == null || tProperty as string != "False")
{
m_BuildLayerParamsFromMap = true;
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: layer parameters will be built from map document layers");
}
else
{
m_BuildLayerParamsFromMap = false;
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: layer parameters would be read from properties file but this is NOT IMPLEMENTED YET ");
// TODO: add code to read in LayerConfiguration parameter and parse it
}
}
catch
{
m_BuildLayerParamsFromMap = true;
logger.LogMessage(ServerLogger.msgType.debug, "Construct", 8000,
"WSH: no property found for ReadConfigFromMap; "+
"layer parameters will be built from map document layers");
}
}
catch (Exception e)
{
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, "WSH: Properties constructor threw an exception");
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, e.Message);
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, e.ToString());
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, e.TargetSite.Name);
logger.LogMessage(ServerLogger.msgType.infoStandard, "Construct", 8000, e.StackTrace);
}
try
{
// get the datasets associated with the configured inputs to watershed delineation.
// Also note the other layers: we will make all others available for extraction
//.........这里部分代码省略.........
示例5: getProperty
/// <summary>
/// Helper method for getting a property and returning null if it isn't found
/// instead of throwing an exception.
/// </summary>
/// <param name="locatorProperties"></param>
/// <param name="Name"></param>
/// <returns>The property value if found. Otherwise 'null'</returns>
protected object getProperty(IPropertySet locatorProperties, String Name)
{
_log.Debug("Misc getProperty");
try
{
return locatorProperties.GetProperty(Name);
}
catch
{
return null;
}
}
示例6: Read
protected override void Read (IPropertySet pset)
{
base.Read (pset);
var prop = pset.GetProperty ("GenerateDocumentation");
if (prop != null && documentationFile != null) {
if (prop.GetValue<bool> ())
documentationFile = ParentConfiguration.CompiledOutputName.ChangeExtension (".xml");
else
documentationFile = null;
}
optimize = pset.GetValue ("Optimize", (bool?)null);
}
示例7: Construct
public void Construct(IPropertySet props)
{
string lType = (string) props.GetProperty("layerType");
if (lType.Equals("feature") || lType.Equals("raster") || lType.Equals("all"))
{
this.layerType = lType;
}
else
{
this.layerType = "feature";
}
string format = (string)props.GetProperty("returnFormat");
if (format.ToLower().Equals("json") || format.ToLower().Equals("html") || format.ToLower().Equals("text"))
{
this.returnFormat = format;
}
else
{
this.returnFormat = "json";
}
int maxFeatures = Convert.ToInt32((string)props.GetProperty("maxNumFeatures"));
if (maxFeatures <= 0)
{
this.maxNumFeatures = 100;
}
else
{
this.maxNumFeatures = maxFeatures;
}
this.isEditable = Convert.ToBoolean((string)props.GetProperty("isEditable"));
}
示例8: Init
/// <summary>
/// Initializes the extension.
/// </summary>
/// <param name="classHelper">Provides a reference to the extension's class.</param>
/// <param name="extensionProperties">A set of properties unique to the extension.</param>
public void Init(IClassHelper classHelper, IPropertySet extensionProperties)
{
// Store the class helper as a member variable.
this.classHelper = classHelper;
IClass baseClass = classHelper.Class;
// Get the names of the created and modified fields, if they exist.
if (extensionProperties != null)
{
this.extensionProperties = extensionProperties;
object createdObject = extensionProperties.GetProperty(Resources.CreatedFieldKey);
object modifiedObject = extensionProperties.GetProperty(Resources.ModifiedFieldKey);
object userObject = extensionProperties.GetProperty(Resources.UserFieldKey);
// Make sure the properties exist and are strings.
if (createdObject != null && createdObject is String)
{
createdFieldName = Convert.ToString(createdObject);
}
if (modifiedObject != null && modifiedObject is String)
{
modifiedFieldName = Convert.ToString(modifiedObject);
}
if (userObject != null && userObject is String)
{
userFieldName = Convert.ToString(userObject);
}
}
else
{
// First time the extension has been run. Initialize with default values.
InitNewExtension();
}
// Set the positions of the fields.
SetFieldIndexes();
// Set the current user name.
userName = GetCurrentUser();
}
示例9: Config
/// <summary>
/// Constructor from PropertySet (in the SDEWorkspace fashion)
/// </summary>
/// <param name="propertySet"></param>
public Config(IPropertySet propertySet)
{
m_ps = propertySet;
//generate connection string
addConnectionItem("server", m_ps.GetProperty("server").ToString());
addConnectionItem("database", m_ps.GetProperty("database").ToString());
addConnectionItem("user", m_ps.GetProperty("user").ToString());
addConnectionItem("password", m_ps.GetProperty("password").ToString());
addConnectionItem("port", m_ps.GetProperty("port").ToString());
//if configfile is passed set the log setting
try //manage COM except if property is missing
{
object configFileProp = m_ps.GetProperty("configfile");
if (configFileProp != null)
{
string path = configFileProp.ToString();
setLoggingSettings(path);
}
}
catch(SystemException e)
{
System.Diagnostics.Debug.WriteLine("configfile property not set");
}
}
示例10: PropertySetToString
/// <summary>
/// PropertySet生成显示字符串
/// </summary>
/// <param name="propertySet"></param>
/// <returns></returns>
public static string PropertySetToString(IPropertySet propertySet)
{
if (propertySet == null)
return null;
string strPropertySet = string.Format("DbClient={0};", propertySet.GetProperty("dbclient"));
strPropertySet += string.Format("Server={0};", propertySet.GetProperty("Server"));
strPropertySet += string.Format("Instance={0};", propertySet.GetProperty("Instance"));
strPropertySet += string.Format("User={0};", propertySet.GetProperty("user"));
strPropertySet += string.Format("Password={0}", propertySet.GetProperty("password"));
return strPropertySet;
}
示例11: GetRecommendedCrawler
/// <summary>
/// Get a crawler recommended by the Raster Type based on the data srouce properties provided.
/// </summary>
/// <param name="pDataSourceProperties">Data source properties.</param>
/// <returns>Data source crawler recommended by the raster type.</returns>
public IDataSourceCrawler GetRecommendedCrawler(IPropertySet pDataSourceProperties)
{
try
{
// This is usually a file crawler because it can crawl directories as well, unless
// special types of data needs to be crawled.
IDataSourceCrawler myCrawler = new FileCrawlerClass();
((IFileCrawler)myCrawler).Path = Convert.ToString(pDataSourceProperties.GetProperty("Source"));
((IFileCrawler)myCrawler).Recurse = Convert.ToBoolean(pDataSourceProperties.GetProperty("Recurse"));
myCrawler.Filter = Convert.ToString(pDataSourceProperties.GetProperty("Filter"));
if (myCrawler.Filter == null || myCrawler.Filter == "")
myCrawler.Filter = "*.dim";
return myCrawler;
}
catch (Exception)
{
throw;
}
}
示例12: Construct
public void Construct(IPropertySet props)
{
configProps = props;
// Read the properties.
if (props.GetProperty("FieldName") != null)
{
m_mapFieldToQuery = props.GetProperty("FieldName") as string;
}
else
{
throw new ArgumentNullException();
}
if (props.GetProperty("LayerName") != null)
{
m_mapLayerNameToQuery = props.GetProperty("LayerName") as string;
}
else
{
throw new ArgumentNullException();
}
try
{
// Get the feature layer to be queried.
// Since the layer is a property of the SOE, this only has to be done once.
IMapServer3 mapServer = (IMapServer3)serverObjectHelper.ServerObject;
string mapName = mapServer.DefaultMapName;
IMapLayerInfo layerInfo;
IMapLayerInfos layerInfos = mapServer.GetServerInfo(mapName).MapLayerInfos;
// Find the index position of the map layer to query.
int c = layerInfos.Count;
int layerIndex = 0;
for (int i = 0; i < c; i++)
{
layerInfo = layerInfos.get_Element(i);
if (layerInfo.Name == m_mapLayerNameToQuery)
{
layerIndex = i;
break;
}
}
// Use IMapServerDataAccess to get the data
IMapServerDataAccess dataAccess = (IMapServerDataAccess)mapServer;
// Get access to the source feature class.
m_fcToQuery = (IFeatureClass)dataAccess.GetDataSource(mapName, layerIndex);
if (m_fcToQuery == null)
{
logger.LogMessage(ServerLogger.msgType.error, "Construct", 8000, "SOE custom error: Layer name not found.");
return;
}
// Make sure the layer contains the field specified by the SOE's configuration.
if (m_fcToQuery.FindField(m_mapFieldToQuery) == -1)
{
logger.LogMessage(ServerLogger.msgType.error, "Construct", 8000, "SOE custom error: Field not found in layer.");
}
}
catch
{
logger.LogMessage(ServerLogger.msgType.error, "Construct", 8000, "SOE custom error: Could not get the feature layer.");
}
}
示例13: OnReadConfiguration
protected override void OnReadConfiguration (ProgressMonitor monitor, ProjectConfiguration config, IPropertySet pset)
{
base.OnReadConfiguration (monitor, config, pset);
// Backwards compatibility. Move parameters to the project parameters object
var prop = pset.GetProperty ("ApplicationIcon");
if (prop != null)
win32Icon = prop.GetPathValue ();
prop = pset.GetProperty ("Win32Resource");
if (prop != null)
win32Resource = prop.GetPathValue ();
prop = pset.GetProperty ("StartupObject");
if (prop != null)
mainclass = prop.Value;
prop = pset.GetProperty ("CodePage");
if (prop != null)
codePage = int.Parse (prop.Value);
}
示例14: IsPropertySame
private bool IsPropertySame(string Property, IPropertySet pProp1, IPropertySet pProp2)
{
object oValue;
string sValue1;
string sValue2;
try
{
oValue = pProp1.GetProperty(Property);
if (oValue == null)
{
return true;
}
sValue1 = Convert.ToString(oValue);
oValue = pProp2.GetProperty(Property);
if (oValue == null)
{
return true;
}
sValue2 = Convert.ToString(oValue);
sValue2 = sValue2.ToUpper();
if (Property == "INSTANCE")
{
if (sValue2.StartsWith("SDE:ORACLE$"))
{
sValue2 = sValue2.Substring(11);
}
}
if (sValue1.ToUpper() != sValue2.ToUpper())
{
//Logger.WriteLine("Property:" + sValue1 + " - " + sValue2);
return false;
}
else
{
return true;
}
}
catch (Exception EX)
{
this.Logger.WriteLine("IsPropertySame Error" + EX.Message + " " + EX.StackTrace);
return true;
}
}