本文整理汇总了C#中ModelNode类的典型用法代码示例。如果您正苦于以下问题:C# ModelNode类的具体用法?C# ModelNode怎么用?C# ModelNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModelNode类属于命名空间,在下文中一共展示了ModelNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FileDeployer
public FileDeployer(ModelNode site, ModelNode web, ListDefinition rootNode, string sourcePath)
{
Site = site;
Web = web;
RootNode = rootNode;
SourcePath = sourcePath;
}
开发者ID:tarurar,项目名称:SPMeta2Contrib,代码行数:7,代码来源:FileDeployer.cs
示例2: GenerateTermsTree
protected void GenerateTermsTree(ModelNode termSetOrTermNode, int deep, bool cleanGuid)
{
if (deep == 0)
return;
if (termSetOrTermNode is TaxonomyTermModelNode)
{
(termSetOrTermNode as TaxonomyTermModelNode).AddRandomTerm(term =>
{
var termDef = term.Value as TaxonomyTermDefinition;
termDef.Name = string.Format("InvertedLevel_{0}_{1}", deep, termDef.Name);
if (cleanGuid)
termDef.Id = null;
GenerateTermsTree(term, --deep, cleanGuid);
});
}
else if (termSetOrTermNode is TaxonomyTermSetModelNode)
{
(termSetOrTermNode as TaxonomyTermSetModelNode).AddRandomTerm(term =>
{
var termDef = term.Value as TaxonomyTermDefinition;
termDef.Name = string.Format("InvertedLevel_{0}_{1}", deep, termDef.Name);
if (cleanGuid)
termDef.Id = null;
GenerateTermsTree(term, --deep, cleanGuid);
});
}
}
开发者ID:karayakar,项目名称:spmeta2,代码行数:34,代码来源:TaxonomyScenariousTest.cs
示例3: GenerateNodesCore
protected override void GenerateNodesCore(ModelNode node)
{
if (!Debugger.IsAttached || !AurumMenuModule.GenerateDefaultMenus)
{
return;
}
IModelMenus modelMenus = (IModelMenus)node;
IModelGroups groups = node.Root.Application.Aurum().AurumLists().Groups;
foreach (IModelNavigationItem current in ((IModelApplicationNavigationItems)node.Root.Application).NavigationItems.Items)
{
if (modelMenus.GetNode(current.Id) == null)
{
IModelMenu modelMenu = modelMenus.AddNode<IModelMenu>(current.Id);
modelMenu.Caption = current.Caption;
modelMenu.Group = groups["Admin"];
foreach (IModelNavigationItem current2 in current.Items)
{
if (current2.Visible)
{
IModelMenuViewItem modelMenuViewItem = modelMenu.AddNode<IModelMenuViewItem>(current2.Id);
modelMenuViewItem.View = current2.View;
modelMenuViewItem.ImageName = current2.ImageName;
modelMenuViewItem.ObjectKey = current2.ObjectKey;
}
}
}
}
}
开发者ID:LSTANCZYK,项目名称:devexpress_xaf_aurum,代码行数:28,代码来源:MenuNodesGenerator.cs
示例4: DeployModel
public override void DeployModel(ModelHostBase modelHost, ModelNode model)
{
if (!(modelHost is CSOMModelHostBase))
throw new ArgumentException("model host for CSOM needs to be inherited from CSOMModelHostBase");
base.DeployModel(modelHost, model);
}
开发者ID:nklychnikov,项目名称:spmeta2,代码行数:7,代码来源:CSOMProvisionService.cs
示例5: LoadModuleFilesFromLocalFolder
/// <summary>
/// Reads the giving directory and populates the node with folders/files structure
/// </summary>
/// <param name="hostNode"></param>
/// <param name="folderPath"></param>
internal static void LoadModuleFilesFromLocalFolder(ModelNode hostNode, string folderPath)
{
var files = Directory.GetFiles(folderPath);
var folders = Directory.GetDirectories(folderPath);
foreach (var file in files)
{
hostNode.AddDefinitionNode(new ModuleFileDefinition
{
Content = File.ReadAllBytes(file),
FileName = Path.GetFileName(file),
Overwrite = true
});
}
foreach (var subFolder in folders)
{
var subFolderPath = subFolder;
var folderDef = new FolderDefinition
{
Name = Path.GetFileName(subFolderPath)
};
hostNode.AddDefinitionNode(folderDef, folderNode => LoadModuleFilesFromLocalFolder(folderNode, subFolderPath));
}
}
开发者ID:ReneHezser,项目名称:spmeta2,代码行数:32,代码来源:ModuleFileUtils.cs
示例6: GenerateNodesCore
protected override void GenerateNodesCore(ModelNode node) {
node.AddNode<IModelFilterDataStoreSystemTable>("SecurityRole");
node.AddNode<IModelFilterDataStoreSystemTable>("SecurityUser");
node.AddNode<IModelFilterDataStoreSystemTable>("PropertyBag");
node.AddNode<IModelFilterDataStoreSystemTable>("PropertyBagDescriptor");
node.AddNode<IModelFilterDataStoreSystemTable>("PropertyDescriptor");
node.AddNode<IModelFilterDataStoreSystemTable>("PropertyDescriptorPropertyDescriptors_PropertyBagDescriptorPropertyBags");
node.AddNode<IModelFilterDataStoreSystemTable>("PropertyValue");
node.AddNode<IModelFilterDataStoreSystemTable>("ServerPrefix");
node.AddNode<IModelFilterDataStoreSystemTable>("XpoSequencer");
node.AddNode<IModelFilterDataStoreSystemTable>("XpoServerId");
node.AddNode<IModelFilterDataStoreSystemTable>("AuditDataItemPersistent");
node.AddNode<IModelFilterDataStoreSystemTable>("AuditedObjectWeakReference");
node.AddNode<IModelFilterDataStoreSystemTable>("XPWeakReference");
node.AddNode<IModelFilterDataStoreSystemTable>("ModuleInfo");
node.AddNode<IModelFilterDataStoreSystemTable>("User");
node.AddNode<IModelFilterDataStoreSystemTable>("SimpleUser");
node.AddNode<IModelFilterDataStoreSystemTable>("Party");
node.AddNode<IModelFilterDataStoreSystemTable>("Person");
node.AddNode<IModelFilterDataStoreSystemTable>("Role");
node.AddNode<IModelFilterDataStoreSystemTable>("RoleBase");
node.AddNode<IModelFilterDataStoreSystemTable>("PersistentPermission");
node.AddNode<IModelFilterDataStoreSystemTable>("UserUsers_RoleRoles");
node.AddNode<IModelFilterDataStoreSystemTable>("XPObjectType");
node.AddNode<IModelFilterDataStoreSystemTable>("ModelDifferenceObject");
node.AddNode<IModelFilterDataStoreSystemTable>("AspectObject");
node.AddNode<IModelFilterDataStoreSystemTable>("PersistentApplication");
node.AddNode<IModelFilterDataStoreSystemTable>("RoleModelDifferenceObject");
node.AddNode<IModelFilterDataStoreSystemTable>("UserModelDifferenceObject");
node.AddNode<IModelFilterDataStoreSystemTable>("RoleRoles_RoleModelDifferenceObjectRoleModelDifferenceObjects");
node.AddNode<IModelFilterDataStoreSystemTable>("UserUsers_UserModelDifferenceObjectUserModelDifferenceObjects");
}
开发者ID:kevin3274,项目名称:eXpand,代码行数:32,代码来源:ModelSystemTablesNodesGenerator.cs
示例7: Calculate
public object Calculate(ModelNode node, string propertyName) {
var modelClass = ((IModelObjectView)node.Parent).ModelClass;
var friendlyKeyProperty = modelClass.FriendlyKeyProperty;
return friendlyKeyProperty != null
? modelClass.FindMember(friendlyKeyProperty).Name
: (modelClass.KeyProperty != null ? modelClass.FindMember(modelClass.KeyProperty).Name : null);
}
开发者ID:aries544,项目名称:eXpand,代码行数:7,代码来源:Model.cs
示例8: RetractModel
public override void RetractModel(ModelHostBase modelHost, ModelNode model)
{
if (!(modelHost is SSOMModelHostBase))
throw new ArgumentException("model host for SSOM needs to be inherited from SSOMModelHostBase.");
base.RetractModel(modelHost, model);
}
开发者ID:ReneHezser,项目名称:spmeta2,代码行数:7,代码来源:SSOMProvisionService.cs
示例9: NewModel_Click
void NewModel_Click(object sender, EventArgs args)
{
ModelNode child = new ModelNode();
child.Text = child.Name = Guid.NewGuid().ToString();
child.ModelType = ModelNode.SourceType.FromCustom;
this.Children.Add(child);
}
开发者ID:koksaver,项目名称:CodeHelper,代码行数:7,代码来源:CustomModelSetNode.cs
示例10: CheckProvisionCompatibility
public override ModelProvisionCompatibilityResult CheckProvisionCompatibility(ModelNode model)
{
var result = new ModelProvisionCompatibilityResult
{
Model = model
};
var modelNodes = model.Flatten();
var rootNode = model;
foreach (var modelNode in modelNodes)
{
var def = modelNode.Value;
var defType = def.GetType();
var defResult = new ModelProvisionCompatibilityResultValue();
var attrs = (SPObjectTypeAttribute[])defType
.GetCustomAttributes(typeof(SPObjectTypeAttribute), true);
defResult.ModelNode = modelNode;
defResult.Definition = def;
if (attrs.Length > 0)
{
defResult.IsCSOMCompatible = attrs.Any(a => a.ObjectModelType == SPObjectModelType.CSOM);
defResult.IsSSOMCompatible = attrs.Any(a => a.ObjectModelType == SPObjectModelType.SSOM);
}
// temporary fix for SiteDefinition, it cannot be yet provisioned with M2 CSOM
if (def.GetType() == typeof(SiteDefinition))
{
if (modelNode.Options.RequireSelfProcessing)
{
// that's farm / web model or an attempt to provision a new site w/ M2
defResult.IsCSOMCompatible = false;
}
else
{
// SiteModel, all valid
defResult.IsCSOMCompatible = true;
}
}
// fixing up root definitions
// farm and web app model cannot be provisioned with M2
if (modelNode == rootNode)
{
if (defType == typeof(FarmDefinition)
|| defType == typeof(WebApplicationDefinition))
{
defResult.IsCSOMCompatible = false;
}
}
result.Result.Add(defResult);
}
return result;
}
开发者ID:avishnyakov,项目名称:spmeta2,代码行数:59,代码来源:DefaultModelCompatibilityService.cs
示例11: DeployWebModel
public override void DeployWebModel(ModelNode model)
{
WithSSOMContext((site, web) =>
{
_provisionService.DeployModel(WebModelHost.FromWeb(web), model);
_validationService.DeployModel(WebModelHost.FromWeb(web), model);
});
}
开发者ID:nklychnikov,项目名称:spmeta2,代码行数:8,代码来源:SSOMProvisionRunner.cs
示例12: DeployWebModelAsCSOM
protected void DeployWebModelAsCSOM(ModelNode model)
{
using (var clientContext = new ClientContext(SampleConsts.CSOM_SiteUrl))
{
var csomProvisionService = new CSOMProvisionService();
csomProvisionService.DeployModel(SPMeta2.CSOM.ModelHosts.WebModelHost.FromClientContext(clientContext), model);
}
}
开发者ID:Rtoribiog,项目名称:spmeta2.contoso,代码行数:8,代码来源:ProvisionTestBase.cs
示例13: DeploySiteModelAsSSOM
protected void DeploySiteModelAsSSOM(ModelNode model)
{
using (var site = new SPSite(SampleConsts.SSOM_SiteUrl))
{
var ssomProvisionService = new SSOMProvisionService();
ssomProvisionService.DeployModel(SPMeta2.SSOM.ModelHosts.SiteModelHost.FromSite(site), model);
}
}
开发者ID:Rtoribiog,项目名称:spmeta2.contoso,代码行数:8,代码来源:ProvisionTestBase.cs
示例14: DeployModel
public override void DeployModel(ModelHostBase modelHost, ModelNode model)
{
// before model provision
if (IsRegisteredModel(model))
{
AttachToOnProvisionedEvents(model);
CalculateIncrementalModel(model);
}
}
开发者ID:karayakar,项目名称:spmeta2,代码行数:9,代码来源:ConditionalProvisionServiceBase.cs
示例15: DeployListModel
public static void DeployListModel(this SSOMProvisionService modelHost, SPList list, ModelNode model)
{
var listHost = ModelHostBase.Inherit<ListModelHost>(WebModelHost.FromWeb(list.ParentWeb), h =>
{
h.HostList = list;
});
modelHost.DeployModel(listHost, model);
}
开发者ID:maratbakirov,项目名称:spmeta2,代码行数:9,代码来源:SSOMProvisionService.cs
示例16: Validate
public override void Validate(ModelNode model, List<ValidationResult> result)
{
ValidateAllowedTypes<ContentTypeDefinition>(model,
new[]
{
typeof (ContentTypeFieldLinkDefinition),
typeof (FolderDefinition)
}, result);
}
开发者ID:nklychnikov,项目名称:spmeta2,代码行数:9,代码来源:ContentTypeDefinitionModelNodeValidator.cs
示例17: NewSiteModel
/// <summary>
/// Creates a new instance of the ModelNode adding site model provided.
/// If RequireSelfProcessing set as 'true', then site model is going to be processed and pushed by SPMeta2 API.
/// Use action to get access to the "site model node" and construct model tree.
/// </summary>
/// <param name="siteDefinition"></param>
/// <param name="action"></param>
/// <returns></returns>
public static ModelNode NewSiteModel(SiteDefinition siteDefinition, Action<ModelNode> action)
{
var newModelNode = new ModelNode { Value = siteDefinition ?? new SiteDefinition { RequireSelfProcessing = false } };
if (action != null)
action(newModelNode);
return newModelNode;
}
开发者ID:nklychnikov,项目名称:spmeta2,代码行数:17,代码来源:SPMeta2Model.cs
示例18: ValidateModelNode
private void ValidateModelNode(ModelNode modelNode, List<ValidationResult> result)
{
var modelDefinition = modelNode.Value;
foreach (var v in DefinitionValidators)
v.Validate(modelNode.Value, result);
foreach (var v in RelationshipValidators)
v.Validate(modelNode, result);
}
开发者ID:karayakar,项目名称:spmeta2,代码行数:10,代码来源:ValidationPreDeploymentService.cs
示例19: Validate
public override void Validate(ModelNode model, List<ValidationResult> result)
{
ValidateAllowedTypes<FolderDefinition>(model,
new[]
{
typeof (FolderDefinition),
typeof (ListItemDefinition),
typeof (SecurityGroupLinkDefinition)
}, result);
}
开发者ID:karayakar,项目名称:spmeta2,代码行数:10,代码来源:FolderDefinitionModelNodeValidator.cs
示例20: PrintModel
public override string PrintModel(ModelNode modelNode)
{
var result = new StringBuilder();
result.AppendFormat("{0}{1}", GetDefinitionValue(modelNode), NewLineString);
WalkModelNodes(modelNode, result, IndentString);
return result.ToString();
}
开发者ID:maratbakirov,项目名称:spmeta2,代码行数:10,代码来源:DefaultModelPrettyPrintService.cs
注:本文中的ModelNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论