本文整理汇总了C#中SR.StorageLinkRepository方法的典型用法代码示例。如果您正苦于以下问题:C# SR.StorageLinkRepository方法的具体用法?C# SR.StorageLinkRepository怎么用?C# SR.StorageLinkRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR
的用法示例。
在下文中一共展示了SR.StorageLinkRepository方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSupportedAdapter
private bool IsSupportedAdapter(SR sr)
{
bool isSMIS = false;
bool isNetApp = false;
bool isDell = false;
try
{
var storageRepository = sr.StorageLinkRepository(Program.StorageLinkConnections);
if (storageRepository == null)
{
// The CSLG is down, maybe because it was on local storage:
// try the other_config instead: see CA-63607.
string adapter;
if (sr.other_config.TryGetValue("CSLG-adapter", out adapter))
{
isSMIS = (adapter == "SMI-S");
isNetApp = adapter.ToLower().Contains("netapp");
isDell = adapter.ToLower().Contains("equallogic");
}
}
else
{
// The CSLG is up: look up the adapter type, and save it away in the other_config
var storageSystem = storageRepository.StorageLinkSystem;
isSMIS = storageSystem.StorageLinkAdapter.IsSMIS;
isNetApp = storageSystem.StorageLinkAdapter.AdapterName.ToLower().Contains("netapp");
isDell = storageSystem.StorageLinkAdapter.AdapterName.ToLower().Contains("equallogic");
Helpers.SetOtherConfig(sr.Connection.Session, sr, "CSLG-adapter",
isSMIS ? "SMI-S" : storageSystem.StorageLinkAdapter.AdapterName);
}
}
catch
{
}
return (isNetApp || isDell || isSMIS);
}