本文整理汇总了C#中ID类的典型用法代码示例。如果您正苦于以下问题:C# ID类的具体用法?C# ID怎么用?C# ID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ID类属于命名空间,在下文中一共展示了ID类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
开发者ID:snosrap,项目名称:nhapi,代码行数:12,代码来源:MO.cs
示例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());
}
开发者ID:aokour,项目名称:sitecore.taxonomy,代码行数:28,代码来源:SetTags.cs
示例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");
}
开发者ID:liddictm,项目名称:nHapi,代码行数:12,代码来源:QSC.cs
示例4: SectionInfo
public SectionInfo(string name, ID sectionId, ID templateId, int sectionSortOrder)
{
Name = name;
SectionId = sectionId;
TemplateId = templateId;
SectionSortOrder = sectionSortOrder;
}
开发者ID:csteeg,项目名称:Glass.Sitecore.Mapper,代码行数:7,代码来源:SectionInfo.cs
示例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"}
}
}}
};
}
开发者ID:hermanussen,项目名称:Sitecore-BasicDataProvider,代码行数:29,代码来源:BasicDataProvider3.cs
示例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);
}
开发者ID:robearlam,项目名称:Habitat,代码行数:26,代码来源:FieldRendererService.cs
示例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;
}
开发者ID:maxshell,项目名称:Sitecore.FakeDb,代码行数:34,代码来源:FakeStandardValuesProvider.cs
示例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;
}
开发者ID:BIGANDYT,项目名称:paddypower,代码行数:30,代码来源:AnalyticsHelper.cs
示例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");
}
开发者ID:liddictm,项目名称:nHapi,代码行数:12,代码来源:EI.cs
示例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");
}
开发者ID:snosrap,项目名称:nhapi,代码行数:12,代码来源:PT.cs
示例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);
}
}
}
开发者ID:boro2g,项目名称:sitecore-contact-utilities,代码行数:25,代码来源:UpdateIDTable.cs
示例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");
}
开发者ID:liddictm,项目名称:nHapi,代码行数:12,代码来源:RP.cs
示例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;
}
开发者ID:Vittel,项目名称:Rhino,代码行数:25,代码来源:SerializedIndex.cs
示例14: JsonItem
public JsonItem()
{
this.ID = ID.Null;
this.ParentID = ID.Null;
JsonDataProvider.InitializeDefaultValues(this.Fields);
}
开发者ID:Sitecore,项目名称:Sitecore.JsonDataProvider,代码行数:7,代码来源:JsonItem.cs
示例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");
}
开发者ID:RickIsWright,项目名称:nHapi,代码行数:12,代码来源:CK.cs
示例16: GetControllerType
public static ControllerType GetControllerType(ID parentId, ID id)
{
ControllerType type;
if (GetControllerIds(parentId.ToGuid()).TryGetValue(id.ToGuid(), out type))
return type;
return null;
}
开发者ID:bplasmeijer,项目名称:BoC.Sitecore.MVC,代码行数:7,代码来源:ControllerType.cs
示例17: StoreData
/// <summary>
/// Make a mesage to store the given data.
/// </summary>
/// <param name="nodeID">The sender identificator</param>
/// <param name="request">The StoreResponse message that originated this message</param>
/// <param name="theData">The CompleteTag to store</param>
/// <param name="originalPublication">The publication datetime</param>
/// <param name="nodeEndpoint">The sender node's kademlia address</param>
/// <param name="transportUri">The sender node's transport uri</param>
public StoreData(ID nodeID, StoreResponse request, CompleteTag theData, DateTime originalPublication, Uri nodeEndpoint, Uri transportUri)
: base(nodeID, request, nodeEndpoint)
{
this.data = theData;
this.publication = originalPublication;
this.transportUri = transportUri;
}
开发者ID:zencoders,项目名称:sambatyon,代码行数:16,代码来源:StoreData.cs
示例18: DeserializeTemplate
private static void DeserializeTemplate(DataStorage dataStorage, ID templateId, string serializationFolderName)
{
var filePath = templateId.FindFilePath(serializationFolderName);
if (string.IsNullOrWhiteSpace(filePath) || !File.Exists(filePath))
{
return;
}
var dsDbTemplate = new DsDbTemplate(templateId, serializationFolderName);
dataStorage.AddFakeItem(dsDbTemplate);
// Deserialize base templates
var baseTemplatesField = dsDbTemplate.Fields.FirstOrDefault(f => f.ID == FieldIDs.BaseTemplate);
if (baseTemplatesField == null || string.IsNullOrWhiteSpace(baseTemplatesField.Value))
{
return;
}
foreach (var baseTemplateId in baseTemplatesField.Value.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
.Where(ID.IsID)
.Select(ID.Parse)
.Where(baseTemplateId => dataStorage.GetFakeItem(baseTemplateId) == null))
{
DeserializeTemplate(dataStorage, baseTemplateId, dsDbTemplate.SerializationFolderName);
}
}
开发者ID:maxshell,项目名称:Sitecore.FakeDb,代码行数:30,代码来源:DeserializeLinkedTemplate.cs
示例19: ItemSaved
public void ItemSaved(object sender, EventArgs args)
{
var item = Event.ExtractParameter(args, 0) as Item;
if (item != null && m_templateNames.Contains(item.TemplateName.ToLower()))
{
if (item.ID != m_processing && item.Paths.FullPath.ToLower().StartsWith(RootPath.ToLower()))
{
if (string.IsNullOrEmpty(item["related pages"]))
{
var home = item.GetHomeByTraversal();
var relatedByTemplate = ItemReferences.GetItemsByTemplate(item.Template, home);
var relatedCount = relatedByTemplate.Count();
if (relatedCount > 0)
{
var random = new Random();
var select = new int[] { random.Next(0, relatedCount - 1), random.Next(0, relatedCount - 1), random.Next(0, relatedCount - 1) };
item.Editing.BeginEdit();
((MultilistField)item.Fields["related pages"]).Add(relatedByTemplate.ElementAt(select[0]).ID.ToString());
((MultilistField)item.Fields["related pages"]).Add(relatedByTemplate.ElementAt(select[1]).ID.ToString());
((MultilistField)item.Fields["related pages"]).Add(relatedByTemplate.ElementAt(select[2]).ID.ToString());
m_processing = item.ID;
item.Editing.EndEdit();
m_processing = ID.Null;
}
}
}
}
}
开发者ID:simonproctor,项目名称:Testing-Framework,代码行数:32,代码来源:AutoPopulateArticles.cs
示例20: VH
///<summary>
/// Creates a VH.
/// <param name="message">The Message to which this Type belongs</param>
/// <param name="description">The description of this type</param>
///</summary>
public VH(IMessage message, string description) : base(message, description){
data = new IType[4];
data[0] = new ID(message, 0,"Start day range");
data[1] = new ID(message, 0,"End day range");
data[2] = new TM(message,"Start hour range");
data[3] = new TM(message,"End hour range");
}
开发者ID:liddictm,项目名称:nHapi,代码行数:12,代码来源:VH.cs
注:本文中的ID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论