本文整理汇总了C#中ID类的典型用法代码示例。如果您正苦于以下问题:C# ID类的具体用法?C# ID怎么用?C# ID使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ID类属于命名空间,在下文中一共展示了ID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MO
///<summary>
/// Creates a MO.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public MO(IMessage message, string description)
: base(message, description)
{
data = new IType[2];
data[0] = new NM(message,"Quantity");
data[1] = new ID(message, 0,"Denomination");
}
示例2: GetCategories
private string GetCategories(string itemPath)
{
List<string> categories = new List<string>();
Database db = Sitecore.Context.ContentDatabase ?? Sitecore.Context.Database;
Item item = db.GetItem(itemPath);
ID categoriesRootId = new ID("{41E44203-3CB9-45DD-8EED-9E36B5282D68}");
string source = item.Fields[new ID("{0F347169-F131-4276-A69D-187C0CAC3740}")].Source;
if (!string.IsNullOrEmpty(source))
{
var classificationSourceItems = LookupSources.GetItems(item, source);
if ((classificationSourceItems != null) && (classificationSourceItems.Length>0))
{
Item taxonomies = classificationSourceItems.ToList().Find(sourceItem => sourceItem.Name.Equals("Taxonomies"));
if (taxonomies != null)
{
categoriesRootId = taxonomies.ID;
}
}
}
Item categoriesRoot = db.GetItem(categoriesRootId);
foreach (Item categoryGroupItem in categoriesRoot.Children)
{
categories.AddRange(GetCategories(categoryGroupItem.DisplayName, categoryGroupItem));
}
return string.Join("|", categories.ToArray());
}
示例3: QSC
///<summary>
/// Creates a QSC.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public QSC(IMessage message, string description) : base(message, description){
data = new IType[4];
data[0] = new ST(message,"Name of field");
data[1] = new ID(message, 0,"Relational operator");
data[2] = new ST(message,"Value");
data[3] = new ID(message, 0,"Relational conjunction");
}
示例4: SectionInfo
public SectionInfo(string name, ID sectionId, ID templateId, int sectionSortOrder)
{
Name = name;
SectionId = sectionId;
TemplateId = templateId;
SectionSortOrder = sectionSortOrder;
}
示例5: BasicDataProvider3
public BasicDataProvider3(string joinParentId)
{
Assert.ArgumentNotNull(joinParentId, "joinParentId");
Assert.IsTrue(ID.IsID(joinParentId), "joinParentId must be a valid Sitecore ID");
JoinParentId = new ID(joinParentId);
Items = new Dictionary<ID, dynamic>()
{
{ GetIdForIdentifierString("one"), new
{
Name = "First item",
Fields = new Dictionary<ID,string>
{
{_titleFieldId, "First item title"},
{_textFieldId, "First item text"}
}
}},
{ GetIdForIdentifierString("two"), new
{
Name = "Second item",
Fields = new Dictionary<ID,string>
{
{_titleFieldId, "Second item title"},
{_textFieldId, "Second item text"}
}
}}
};
}
示例6: BeginField
public static HtmlString BeginField(ID fieldId, Item item, object parameters)
{
Assert.ArgumentNotNull(fieldId, "fieldName");
var renderFieldArgs = new RenderFieldArgs
{
Item = item,
FieldName = item.Fields[fieldId].Name
};
if (parameters != null)
{
CopyProperties(parameters, renderFieldArgs);
CopyProperties(parameters, renderFieldArgs.Parameters);
}
renderFieldArgs.Item = renderFieldArgs.Item ?? CurrentItem;
if (renderFieldArgs.Item == null)
{
EndFieldStack.Push(string.Empty);
return new HtmlString(string.Empty);
}
CorePipeline.Run("renderField", renderFieldArgs);
var result1 = renderFieldArgs.Result;
var str = result1.ValueOrDefault(result => result.FirstPart).OrEmpty();
EndFieldStack.Push(result1.ValueOrDefault(result => result.LastPart).OrEmpty());
return new HtmlString(str);
}
示例7: FindStandardValueInTheTemplate
protected string FindStandardValueInTheTemplate(DbTemplate template, ID fieldId)
{
if (template.StandardValues.ContainsKey(fieldId))
{
return template.StandardValues[fieldId].Value;
}
if (template.BaseIDs == null || template.BaseIDs.Length <= 0)
{
return null;
}
foreach (var baseId in template.BaseIDs)
{
if (ID.IsNullOrEmpty(baseId))
{
continue;
}
var baseTemplate = this.DataStorage.GetFakeTemplate(baseId);
if (baseTemplate == null)
{
throw new TemplateNotFoundException("The template \"{0}\" was not found.".FormatWith(baseId.ToString()));
}
var value = this.FindStandardValueInTheTemplate(baseTemplate, fieldId);
if (value != null)
{
return value;
}
}
return null;
}
示例8: TriggerGoal
public static bool TriggerGoal(ID goalID)
{
if (goalID == (ID)null)
{
Log.Warn("GoalID is empty", typeof(AnalyticsHelper));
return false;
}
if (!Tracker.IsActive)
{
Tracker.StartTracking();
}
if (Tracker.Current == null || Tracker.Current.Interaction == null || Tracker.Current.Interaction.CurrentPage == null)
{
Log.Warn("Tracker.Current == null || Tracker.Current.Interaction.CurrentPage == null", typeof(AnalyticsHelper));
return false;
}
var goalItem = Sitecore.Context.Database.GetItem(goalID);
if (goalItem == null)
{
Log.Warn("Goal Item is empty from ID: " + goalID, typeof(AnalyticsHelper));
return false;
}
var goal = new PageEventItem(goalItem);
Tracker.Current.Interaction.CurrentPage.Register(goal);
return true;
}
示例9: EI
///<summary>
/// Creates a EI.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public EI(IMessage message, string description) : base(message, description){
data = new IType[4];
data[0] = new ST(message,"Entity identifier");
data[1] = new IS(message, 300,"Namespace ID");
data[2] = new ST(message,"Universal ID");
data[3] = new ID(message, 301,"Universal ID type");
}
示例10: PT
///<summary>
/// Creates a PT.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public PT(IMessage message, string description)
: base(message, description)
{
data = new IType[2];
data[0] = new ID(message, 103,"Processing ID");
data[1] = new ID(message, 207,"Processing Mode");
}
示例11: AddContactFacetMember
protected virtual void AddContactFacetMember(string facetName, ID parentId)
{
var contractType = ContactFacetHelper.GetContractTypeForFacet(facetName);
foreach (string memberName in FacetReflectionUtil.NonFacetMemberNames(contractType))
{
var memberId = IDTableHelper.GenerateIdForFacetMember(memberName, parentId,
Sitecore.Strategy.Contacts.DataProviders.TemplateIDs.ContactFacetMemberTemplate);
AddContactFacetMemberValues(facetName, memberName, memberId);
}
foreach (string memberName in FacetReflectionUtil.FacetMemberNames(contractType))
{
foreach (
string subMemberName in
FacetReflectionUtil.NonFacetMemberNames(contractType.GetProperty(memberName).PropertyType))
{
string key = $"{memberName}{NestedFacets.Delimeter}{subMemberName}";
var memberId = IDTableHelper.GenerateIdForFacetMember(key, parentId,
Sitecore.Strategy.Contacts.DataProviders.TemplateIDs.ContactFacetMemberTemplate);
AddContactFacetMemberValues(facetName, key, memberId);
}
}
}
示例12: RP
///<summary>
/// Creates a RP.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public RP(IMessage message, string description) : base(message, description){
data = new IType[4];
data[0] = new ST(message,"Pointer");
data[1] = new HD(message,"Application ID");
data[2] = new ID(message, 0,"Type of data");
data[3] = new ID(message, 0,"Subtype");
}
示例13: GetItem
public SyncItem GetItem(ID id)
{
Assert.ArgumentNotNull(id, "id");
SyncItem resultItem;
if (!_idLookup.TryGetValue(id, out resultItem))
{
lock (_idLookupLock)
{
if (!_idLookup.TryGetValue(id, out resultItem))
{
string stringId = id.ToString();
SyncItem item = _innerItems.Find(x => x.ID == stringId);
if (item != null)
{
_idLookup.Add(id, item);
}
return item;
}
}
}
return resultItem;
}
示例14: JsonItem
public JsonItem()
{
this.ID = ID.Null;
this.ParentID = ID.Null;
JsonDataProvider.InitializeDefaultValues(this.Fields);
}
示例15: CK
///<summary>
/// Creates a CK.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public CK(IMessage message, string description) : base(message, description){
data = new IType[4];
data[0] = new NM(message,"ID number (NM)");
data[1] = new ST(message,"Check digit");
data[2] = new ID(message, 0,"Code identifying the check digit scheme employed");
data[3] = new HD(message,"Assigning authority");
}