本文整理汇总了C#中esriLicenseProductCode类的典型用法代码示例。如果您正苦于以下问题:C# esriLicenseProductCode类的具体用法?C# esriLicenseProductCode怎么用?C# esriLicenseProductCode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
esriLicenseProductCode类属于命名空间,在下文中一共展示了esriLicenseProductCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InitializeApplication
public void InitializeApplication(esriLicenseProductCode[] products,esriLicenseExtensionCode [] extensions)
{
// Binding a product
RuntimeManager.Bind(ProductCode.EngineOrDesktop);
// Initialize a product code
m_AoInit = new AoInitializeClass();
esriLicenseProductCode currentProduct = new esriLicenseProductCode();
foreach (esriLicenseProductCode prod in products)
{
esriLicenseStatus prodStatus = m_AoInit.IsProductCodeAvailable(prod);
if(prodStatus==esriLicenseStatus.esriLicenseAvailable)
{
prodStatus=m_AoInit.Initialize(prod);
if(prodStatus==esriLicenseStatus.esriLicenseAlreadyInitialized||prodStatus==esriLicenseStatus.esriLicenseCheckedOut)
{
currentProduct = prod;
}
}
}
if(m_AoInit.InitializedProduct()!=null)
{
foreach (esriLicenseExtensionCode ext in extensions)
{
m_RequetedExtensionCodes.Add(ext);
esriLicenseStatus extStatus = m_AoInit.IsExtensionCodeAvailable(currentProduct,ext);
if (extStatus == esriLicenseStatus.esriLicenseAvailable)
m_AoInit.CheckOutExtension(ext);
}
}
}
开发者ID:weigiser,项目名称:LandPriceOnline,代码行数:33,代码来源:LicenseInitializer.cs
示例2: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Binding to ArcGIS Desktop
RuntimeManager.Bind(ProductCode.Desktop);
// Get ESRI License
this._aoInitialize = new AoInitializeClass();
esriLicenseProductCode[] codes = new esriLicenseProductCode[] {
esriLicenseProductCode.esriLicenseProductCodeStandard,
esriLicenseProductCode.esriLicenseProductCodeAdvanced
};
bool ok = false;
foreach (esriLicenseProductCode code in codes) {
if (this._aoInitialize.IsProductCodeAvailable(code) == esriLicenseStatus.esriLicenseAvailable) {
if (this._aoInitialize.Initialize(code) == esriLicenseStatus.esriLicenseCheckedOut) {
ok = true;
break;
}
}
}
if (!ok) {
MessageBox.Show("Unable to checkout Esri license", "Zeta", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
开发者ID:qjw2bqn,项目名称:Esri-Geometry-Network-Configuration-Manager,代码行数:27,代码来源:App.xaml.cs
示例3: InitializeApplication
/// <summary>
/// Initialize the application with the specified product and extension license code.
/// </summary>
/// <returns>Initialization is successful.</returns>
/// <remarks>
/// If no active runtime has been bound to the application before license initialization
/// takes place, the ResolveBindingEvent is raised.
/// </remarks>
public bool InitializeApplication(esriLicenseProductCode[] productCodes, esriLicenseExtensionCode[] extensionLics)
{
//Cache product codes by enum int so can be sorted without custom sorter
m_requestedProducts = new List<int>();
foreach (esriLicenseProductCode code in productCodes)
{
int requestCodeNum = Convert.ToInt32(code);
if (!m_requestedProducts.Contains(requestCodeNum))
{
m_requestedProducts.Add(requestCodeNum);
}
}
AddExtensions(extensionLics);
// Make sure an active version has been loaded before calling any ArcObjects code.
RuntimeInfo boundRuntime = RuntimeManager.ActiveRuntime;
if (boundRuntime != null &&
(this.AllowImplicitRuntimeBinding || boundRuntime.Product > ProductCode.ArcGIS))
{
m_AoInit = new AoInitializeClass();
}
else
{
EventHandler temp = ResolveBindingEvent;
if (temp != null)
{
temp(this, new EventArgs());
if (RuntimeManager.ActiveRuntime != null)
m_AoInit = new AoInitializeClass();
}
}
return Initialize();
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:42,代码来源:LicenseInitializer.Designer.cs
示例4: InitializeApplication
/// <summary>
/// Initialize the application with the specified product and extension license code.
/// </summary>
/// <returns>Initialization is successful.</returns>
/// <remarks>
/// Make sure an active ArcGIS runtime has been bound before license initialization.
/// </remarks>
public bool InitializeApplication(esriLicenseProductCode[] productCodes, esriLicenseExtensionCode[] extensionLics)
{
//Cache product codes by enum int so can be sorted without custom sorter
m_requestedProducts = new List<int>();
foreach (esriLicenseProductCode code in productCodes)
{
int requestCodeNum = Convert.ToInt32(code);
if (!m_requestedProducts.Contains(requestCodeNum))
{
m_requestedProducts.Add(requestCodeNum);
}
}
AddExtensions(extensionLics);
// Make sure an active runtime has been bound before calling any ArcObjects code.
if (RuntimeManager.ActiveRuntime == null)
{
EventHandler temp = ResolveBindingEvent;
if (temp != null)
{
temp(this, new EventArgs());
}
}
return Initialize();
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:33,代码来源:LicenseInitializer.Designer.cs
示例5: CheckOutLicenses
private esriLicenseStatus CheckOutLicenses()
{
esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseNotInitialized;
//Determine if the product is available
for (int i = 0; i < m_productsCode.Length; i++)
{
esriLicenseProductCode pc = m_productsCode[i];
licenseStatus = m_AoInitialize.IsProductCodeAvailable(pc);
if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
{
licenseStatus = m_AoInitialize.Initialize(pc);
if (licenseStatus == esriLicenseStatus.esriLicenseCheckedOut)
{
m_initProduct = pc;
break;
}
}
}
if (m_pExtensionsCode != null)
{
//Checkout the extensions - only when product is initialized
if (licenseStatus == esriLicenseStatus.esriLicenseCheckedOut)
{
System.Collections.ArrayList initExts = new System.Collections.ArrayList(m_pExtensionsCode.Length);
foreach (esriLicenseExtensionCode extLicense in m_pExtensionsCode)
{
//Determine if the extensions are available - some may not be available depending on the product initialized
//If so, initialization fails...
licenseStatus = m_AoInitialize.IsExtensionCodeAvailable(m_initProduct, extLicense);
if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
{
licenseStatus = m_AoInitialize.CheckOutExtension(extLicense);
if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut && licenseStatus != esriLicenseStatus.esriLicenseAlreadyInitialized)
break;
//Add to license initialized list
initExts.Add(extLicense);
}
else
break; //Exit when failed to check out any extension
}
if (initExts.Count > 0)
{
m_initExts = new esriLicenseExtensionCode[initExts.Count];
m_initExts = (esriLicenseExtensionCode[])initExts.ToArray(typeof(esriLicenseExtensionCode));
}
}
}
return licenseStatus;
}
开发者ID:chinasio,项目名称:Control,代码行数:52,代码来源:LicenseInitializer.cs
示例6: InitializeApplication
private bool m_productCheckOrdering = true; //default from low to high
#endregion
public bool InitializeApplication(esriLicenseProductCode[] productCodes, esriLicenseExtensionCode[] extensionLics)
{
//Cache product codes by enum int so can be sorted without custom sorter
m_requestedProducts = new List<int>();
foreach (esriLicenseProductCode code in productCodes)
{
int requestCodeNum = Convert.ToInt32(code);
if (!m_requestedProducts.Contains(requestCodeNum))
{
m_requestedProducts.Add(requestCodeNum);
}
}
AddExtensions(extensionLics);
return Initialize();
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:19,代码来源:LicenseInitializer.cs
示例7: CheckoutESRILicense
public static IAoInitialize CheckoutESRILicense(esriLicenseProductCode pESRIProdCode)
{
ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop); // SET A REFERENCE TO THE ESRI DESKTOP APPLICATION
var license = new AoInitializeClass(); // INSTANTIATE THE LICENSE
esriLicenseStatus pLicenseStatus = (esriLicenseStatus)license.IsProductCodeAvailable(pESRIProdCode); // DETERMINE THE STATUS OF THE REQUESTED LICENSE
if (pLicenseStatus == esriLicenseStatus.esriLicenseCheckedOut) { return license; } // RETURN IF A LICENSE IS ALREADY CHECKED OUT
if (pLicenseStatus == esriLicenseStatus.esriLicenseAvailable) // DETERMINE IF A LICENSE IS AVAILABLE
{
pLicenseStatus = (esriLicenseStatus)license.Initialize(pESRIProdCode);
if (pLicenseStatus == esriLicenseStatus.esriLicenseCheckedOut || pLicenseStatus == esriLicenseStatus.esriLicenseAlreadyInitialized)
return license;
}
return null;
}
开发者ID:Ehryk,项目名称:sde2string,代码行数:18,代码来源:GDBUtilities.cs
示例8: InitializeApplication
public bool InitializeApplication(esriLicenseProductCode[] productCodes, esriLicenseExtensionCode[] extensionLics)
{
bool bInitialized = true;
if (m_AoInitialize == null)
{
bInitialized = false;
}
//Initialize the application
esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable;
m_productsCode = productCodes;
m_pExtensionsCode = extensionLics;
licenseStatus = CheckOutLicenses();
if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut)
{
bInitialized = false;
}
return bInitialized;
}
开发者ID:chinasio,项目名称:Control,代码行数:19,代码来源:LicenseInitializer.cs
示例9: InitializeProduct
/// <summary>
/// 初始化产品,只初始化第一个
/// </summary>
/// <returns></returns>
public bool InitializeProduct()
{
if (RuntimeManager.ActiveRuntime == null)
return false;
if (productCodeList == null || extensionCodeList.Count == 0)
return false;
bool productInitialized = false;
productCodeList.Sort();//对于产品集合进行排序
if (!InitializeLowerProductFirst)
{
productCodeList.Reverse();//反转整个集合
}
aoInitialize = new AoInitializeClass();
esriLicenseProductCode currentProductCode = new esriLicenseProductCode();
foreach (int item in productCodeList)
{
esriLicenseProductCode proCode = (esriLicenseProductCode)Enum.ToObject(typeof(esriLicenseProductCode), item);
esriLicenseStatus status = aoInitialize.IsProductCodeAvailable(proCode);
if (status == esriLicenseStatus.esriLicenseAvailable)
{
status = aoInitialize.Initialize(proCode);
if (status == esriLicenseStatus.esriLicenseAlreadyInitialized || status == esriLicenseStatus.esriLicenseCheckedOut)
{
productInitialized = true;
currentProductCode = aoInitialize.InitializedProduct();
}
}
dic_ProductStatus.Add(proCode, status);
if (productInitialized)
break;//只初始化第一个成功的产品!
}
this.hasInitialProduct = productInitialized;
this.productCodeList.Clear();
if (!productInitialized)//如果所有的产品都不成功
return false;
return CheckOutLicense(currentProductCode);//验证扩展
}
开发者ID:Shen001,项目名称:AEWinForm,代码行数:45,代码来源:InitialLicenseHelper.cs
示例10: GetArcGISLicense
/// <summary>
/// Attempts to checkout a license for the specified ESRI product and returns true if successful.
/// </summary>
public bool GetArcGISLicense(esriLicenseProductCode prodCode)
{
//Create a new AoInitialize object
try
{
_AoInitialize = new AoInitializeClass();
}//The initialization object
catch
{
_log.Warn("Warning: Unable to initialize Arc Objects. License cannot be checked out.");
return false;
}
if (_AoInitialize == null)
{
_log.Warn("Warning: Unable to initialize Arc Objects. License cannot be checked out.");
return false;
}
//Determine if the product is available
esriLicenseStatus licenseStatus = (esriLicenseStatus)_AoInitialize.IsProductCodeAvailable(prodCode);
if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
{
licenseStatus = (esriLicenseStatus)_AoInitialize.Initialize(prodCode);
if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut)
{
_log.Warn("Warning: The license checkout for " + prodCode.ToString() + " failed!");
return false;
}
}
else
{
_log.Warn("Warning: The ArcGIS product " + prodCode.ToString() + " is unavailable!");
return false;
}
return true;
}
开发者ID:RiverTaig,项目名称:GDT,代码行数:40,代码来源:License.cs
示例11: InitialLicensesCode
public bool InitialLicensesCode(esriLicenseProductCode[] esriProductCodes,params esriLicenseExtensionCode[] esriExtensionCodes)
{
if(productCodeList==null)
productCodeList = new List<int>();//将产品码添加到list集合中,Cache product codes by enum int so can be sorted without custom sorter
foreach (esriLicenseProductCode item in esriProductCodes)
{
int codeNum = Convert.ToInt32(item);
if (!productCodeList.Contains(codeNum))
{
productCodeList.Add(codeNum);
}
}
AddExtensions(esriExtensionCodes);
//验证runtime绑定
if (RuntimeManager.ActiveRuntime == null)
{
EventHandler eventHandler = ResolveBindingEvent;
if (eventHandler != null)
{
eventHandler(this,new EventArgs());
}
}
return InitializeProduct();
}
开发者ID:Shen001,项目名称:AEWinForm,代码行数:24,代码来源:InitialLicenseHelper.cs
示例12: CheckOutLicenses
private bool CheckOutLicenses(esriLicenseProductCode currentProduct)
{
bool allSuccessful = true;
//Request extensions
if (m_requestedExtensions != null && currentProduct != 0)
{
foreach (esriLicenseExtensionCode ext in m_requestedExtensions)
{
esriLicenseStatus licenseStatus = m_AoInit.IsExtensionCodeAvailable(currentProduct, ext);
if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)//skip unavailable extensions
{
licenseStatus = m_AoInit.CheckOutExtension(ext);
}
allSuccessful = (allSuccessful && licenseStatus == esriLicenseStatus.esriLicenseCheckedOut);
if (m_extensionStatus.ContainsKey(ext))
m_extensionStatus[ext] = licenseStatus;
else
m_extensionStatus.Add(ext, licenseStatus);
}
m_requestedExtensions.Clear();
}
return allSuccessful;
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:25,代码来源:LicenseInitializer.Designer.cs
示例13: Initialize
private bool Initialize()
{
if (RuntimeManager.ActiveRuntime == null)
return false;
if (m_requestedProducts == null || m_requestedProducts.Count == 0)
return false;
bool productInitialized = false;
m_requestedProducts.Sort();
if (!InitializeLowerProductFirst) //Request license from highest to lowest
m_requestedProducts.Reverse();
m_AoInit = new AoInitializeClass();
esriLicenseProductCode currentProduct = new esriLicenseProductCode();
foreach (int prodNumber in m_requestedProducts)
{
esriLicenseProductCode prod = (esriLicenseProductCode)Enum.ToObject(typeof(esriLicenseProductCode), prodNumber);
esriLicenseStatus status = m_AoInit.IsProductCodeAvailable(prod);
if (status == esriLicenseStatus.esriLicenseAvailable)
{
status = m_AoInit.Initialize(prod);
if (status == esriLicenseStatus.esriLicenseAlreadyInitialized ||
status == esriLicenseStatus.esriLicenseCheckedOut)
{
productInitialized = true;
currentProduct = m_AoInit.InitializedProduct();
}
}
m_productStatus.Add(prod, status);
if (productInitialized)
break;
}
m_hasInitializeProduct = productInitialized;
m_requestedProducts.Clear();
//No product is initialized after trying all requested licenses, quit
if (!productInitialized)
{
return false;
}
//Check out extension licenses
return CheckOutLicenses(currentProduct);
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:49,代码来源:LicenseInitializer.Designer.cs
示例14: IsExtensionCodeAvailable
public esriLicenseStatus IsExtensionCodeAvailable(esriLicenseProductCode p, esriLicenseExtensionCode e)
{
return esriLicenseStatus.esriLicenseCheckedIn;
}
开发者ID:regan-sarwas,项目名称:ThemeManager3.1,代码行数:4,代码来源:DummyLicense.cs
示例15: CheckOutLicenses
/// <summary>
/// Checkout licenses
/// </summary>
/// <param name="currentProduct">producto code</param>
private bool CheckOutLicenses(esriLicenseProductCode currentProduct)
{
var allSuccessful = true;
// Request extensions
if (_requestedExtensions != null && currentProduct != 0)
{
foreach (var ext in _requestedExtensions)
{
var licenseStatus = _aoInit.IsExtensionCodeAvailable(currentProduct, ext);
if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
{
licenseStatus = _aoInit.CheckOutExtension(ext);
}
allSuccessful = allSuccessful && licenseStatus == esriLicenseStatus.esriLicenseCheckedOut;
if (_extensionStatus.ContainsKey(ext))
{
_extensionStatus[ext] = licenseStatus;
}
else
{
_extensionStatus.Add(ext, licenseStatus);
}
}
_requestedExtensions.Clear();
}
return allSuccessful;
}
开发者ID:OliveiraThales,项目名称:GeoCache,代码行数:35,代码来源:LicenseInitializer.cs
示例16: Initialize
/// <summary>
/// Initilize
/// </summary>
private bool Initialize()
{
if (RuntimeManager.ActiveRuntime == null)
{
return false;
}
if (_requestedProducts == null || _requestedProducts.Count == 0)
{
return false;
}
var currentProduct = new esriLicenseProductCode();
var productInitialized = false;
_requestedProducts.Sort();
if (!InitializeLowerProductFirst)
{
_requestedProducts.Reverse();
}
foreach (var prodNumber in _requestedProducts)
{
var prod = (esriLicenseProductCode)System.Enum.ToObject(typeof(esriLicenseProductCode), prodNumber);
var status = _aoInit.IsProductCodeAvailable(prod);
if (status == esriLicenseStatus.esriLicenseAvailable)
{
status = _aoInit.Initialize(prod);
if (status == esriLicenseStatus.esriLicenseAlreadyInitialized || status == esriLicenseStatus.esriLicenseCheckedOut)
{
productInitialized = true;
currentProduct = _aoInit.InitializedProduct();
}
}
_productStatus.Add(prod, status);
if (productInitialized)
{
break;
}
}
_hasInitializeProduct = productInitialized;
_requestedProducts.Clear();
// No product is initialized after trying all requested licenses, quit
return productInitialized && CheckOutLicenses(currentProduct);
}
开发者ID:OliveiraThales,项目名称:GeoCache,代码行数:50,代码来源:LicenseInitializer.cs
示例17: GetLicenseProductName
public string GetLicenseProductName (esriLicenseProductCode code)
{
return string.Empty;
}
开发者ID:regan-sarwas,项目名称:ThemeManager3.1,代码行数:4,代码来源:DummyLicense.cs
示例18: Initialize
public esriLicenseStatus Initialize(esriLicenseProductCode code)
{
return esriLicenseStatus.esriLicenseCheckedOut;
}
开发者ID:regan-sarwas,项目名称:ThemeManager3.1,代码行数:4,代码来源:DummyLicense.cs
示例19: ReportInformation
private string ReportInformation(ILicenseInformation licInfo,
esriLicenseProductCode code, esriLicenseStatus status)
{
string prodName = string.Empty;
try
{
prodName = licInfo.GetLicenseProductName(code);
}
catch
{
prodName = code.ToString();
}
string statusInfo = string.Empty;
switch (status)
{
case esriLicenseStatus.esriLicenseAlreadyInitialized:
case esriLicenseStatus.esriLicenseCheckedOut:
statusInfo = string.Format(MessageProductAvailable, prodName);
break;
default:
statusInfo = string.Format(MessageProductNotLicensed, prodName);
break;
}
return statusInfo;
}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:28,代码来源:LicenseInitializer.Designer.cs
示例20: CheckOutLicense
//根据产品编码检查扩展编码
private bool CheckOutLicense(esriLicenseProductCode currentProduct)
{
bool success = true;
if (extensionCodeList.Count > 0 && currentProduct != 0)
{
foreach (esriLicenseExtensionCode item in extensionCodeList)
{
esriLicenseStatus licenseStatus = aoInitialize.IsExtensionCodeAvailable(currentProduct, item);
if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
{
if (!aoInitialize.IsExtensionCheckedOut(item))
{
licenseStatus = aoInitialize.CheckOutExtension(item);
}
}
success = (success && licenseStatus == esriLicenseStatus.esriLicenseCheckedOut);//如果success是false,那么一直都是false!
if (dic_ExtensionStatus.ContainsKey(item))//将扩展与扩展状态添加到字典中去
{
dic_ExtensionStatus[item] = licenseStatus;
}
else
{
dic_ExtensionStatus.Add(item, licenseStatus);
}
}
extensionCodeList.Clear();//清空扩展列表
}
return success;
}
开发者ID:Shen001,项目名称:AEWinForm,代码行数:30,代码来源:InitialLicenseHelper.cs
注:本文中的esriLicenseProductCode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论