void IndexRevisionRange(int startRevision, int stopRevision) { foreach (var data in _svn.GetRevisionData(startRevision, stopRevision)) { IndexJobData jobData = new IndexJobData(); if (!_args.SingleRevision) { jobData.Path = "$Revision " + data.Revision; jobData.RevisionFirst = data.Revision; jobData.RevisionLast = data.Revision; jobData.Info = new PathInfo(); jobData.Info.Author = data.Author; jobData.Info.Timestamp = data.Timestamp; QueueIndexJob(jobData); } data.Changes.ForEach(QueueAnalyzeJobRecursive); _pendingAnalyzeJobs.Wait(); } foreach (var job in _headJobs.Values) // no lock necessary because no analyzeJobs are running { QueueFetchJob(job); } _headJobs.Clear(); _pendingFetchJobs.Wait(); _indexQueueIsEmpty.WaitOne(); IndexProperty.SetRevision(_indexWriter, stopRevision); Console.WriteLine("Index revision is now " + stopRevision); }
///-------------------------------------------------------------------------------- /// <summary>This method refreshes the view model.</summary> /// /// <param name="refreshChildren">Flag indicating whether children should be refreshed.</param> ///-------------------------------------------------------------------------------- public void Refresh(bool refreshChildren, int refreshLevel = 0) { if (refreshChildren == true || refreshLevel > 0) { } #region protected #endregion protected HasErrors = !IndexProperty.IsValid; HasCustomizations = IndexProperty.IsAutoUpdated == false || IndexProperty.IsEmptyMetadata(IndexProperty.ForwardInstance) == false || ChildrenHaveAnyCustomizations(); if (HasCustomizations == false && IndexProperty.ReverseInstance != null) { // remove customizations if solely due to child customizations no longer present IndexProperty.IsAutoUpdated = true; IndexProperty.SpecSourceName = IndexProperty.ReverseInstance.SpecSourceName; IndexProperty.ResetModified(IndexProperty.ReverseInstance.IsModified); IndexProperty.ResetLoaded(IndexProperty.ReverseInstance.IsLoaded); if (!IndexProperty.IsIdenticalMetadata(IndexProperty.ReverseInstance)) { HasCustomizations = true; IndexProperty.IsAutoUpdated = false; } } if (HasCustomizations == false) { // clear customizations IndexProperty.ForwardInstance = null; IndexProperty.ReverseInstance = null; IndexProperty.IsAutoUpdated = true; } OnPropertyChanged("Items"); OnPropertyChanged("HasCustomizations"); OnPropertyChanged("HasErrors"); }
internal IndexProperties(IndexReader reader) { Revision = IndexProperty.GetRevision(reader); RepositoryName = IndexProperty.GetRepositoryName(reader); RepositoryLocalUri = IndexProperty.GetRepositoryLocalUri(reader); RepositoryExternalUri = IndexProperty.GetRepositoryExternalUri(reader); RepositoryCredentials = IndexProperty.GetRepositoryCredentials(reader); SingleRevision = IndexProperty.GetSingleRevision(reader); TotalCount = reader.MaxDoc(); }
private void ConnectIndex(IDomain domain, IArea currentArea, IObject currentObject, ref bool IsConnected) { IObject Object = IndexObject; IObjectPropertyIndex ObjectProperty = IndexObjectProperty; IsConnected |= IndexProperty.ConnectToObjectIndex(domain, currentArea, currentObject, ref Object, ref ObjectProperty); IndexObject = Object; IndexObjectProperty = ObjectProperty; IndexObjectProperty?.SetIsReadWrite(); }
///-------------------------------------------------------------------------------- /// <summary>This method loads an item of IndexProperty into the view model.</summary> /// /// <param name="indexProperty">The IndexProperty to load.</param> /// <param name="loadChildren">Flag indicating whether to perform a deeper load.</param> ///-------------------------------------------------------------------------------- public void LoadIndexProperty(IndexProperty indexProperty, bool loadChildren = true) { // attach the IndexProperty IndexProperty = indexProperty; ItemID = IndexProperty.IndexPropertyID; Items.Clear(); if (loadChildren == true) { #region protected #endregion protected Refresh(false); } }
///-------------------------------------------------------------------------------- /// <summary>This method sets the default values.</summary> ///-------------------------------------------------------------------------------- protected override void OnSetDefaults() { if (IndexProperty.ReverseInstance != null) { EditIndexProperty.TransformDataFromObject(IndexProperty.ReverseInstance, null, false); } else if (IndexProperty.IsAutoUpdated == true) { EditIndexProperty.TransformDataFromObject(IndexProperty, null, false); } else { IndexProperty newIndexProperty = new IndexProperty(); newIndexProperty.IndexPropertyID = EditIndexProperty.IndexPropertyID; EditIndexProperty.TransformDataFromObject(newIndexProperty, null, false); } EditIndexProperty.ResetModified(true); }
static AppDomainVar() { Vars = new IndexProperty<string, object>(name => { if (dict.ContainsKey(name)) { return dict[name]; } return null; }, (name, obj) => { if (dict.ContainsKey(name)) { dict[name] = obj; } else { dict.Add(name, obj); } }); //Vars = new IndexProperty((name) => //{ // if (dict.ContainsKey(name)) // { // return dict[name]; // } // return null; //}, (name, obj) => //{ // if (dict.ContainsKey(name)) // { // dict[name] = obj; // } // else // { // dict.Add(name, obj); // } //}); }
public void Run() { Console.WriteLine("Begin indexing ..."); DateTime start = DateTime.UtcNow; int startRevision = 1; int stopRevision = Math.Min(_args.MaxRevision, _svn.GetYoungestRevision()); bool optimize; Thread indexThread = new Thread(ProcessIndexQueue); indexThread.Name = "IndexThread"; indexThread.IsBackground = true; indexThread.Start(); // setup message filter for index writer _indexWriterMessageFilter = new FilteredTextWriter(Console.Out, // only allow messages starting with "maxFieldLength" // example message: "maxFieldLength 500000 reached for field content, ignoring following tokens" line => line.ToString().StartsWith("maxFieldLength")); _indexWriterMessageFilter.DefaultLineLength = 256; using (_indexWriterMessageFilter) { if (Command.Create == _args.Command) { _indexWriter = CreateIndexWriter(true); IndexProperty.SetSingleRevision(_indexWriter, _args.SingleRevision); QueueAnalyzeJob(new PathChange { Path = "/", Revision = 1, Change = Change.Add }); // add root directory manually optimize = true; } else // Command.Update { IndexReader reader = IndexReader.Open(_indexDirectory); // important: create reader before creating indexWriter! _highestRevision.Reader = reader; startRevision = IndexProperty.GetRevision(reader) + 1; _args.SingleRevision = IndexProperty.GetSingleRevision(reader); if (_args.SingleRevision) { Console.WriteLine("SingleRevision index"); } _indexWriter = CreateIndexWriter(false); optimize = stopRevision % _args.Optimize == 0 || stopRevision - startRevision > _args.Optimize; } IndexProperty.SetRepositoryLocalUri(_indexWriter, _args.RepositoryLocalUri); IndexProperty.SetRepositoryExternalUri(_indexWriter, _args.RepositoryExternalUri); IndexProperty.SetRepositoryName(_indexWriter, _args.RepositoryName); IndexProperty.SetRepositoryCredentials(_indexWriter, _args.Credentials); while (startRevision <= stopRevision) { IndexRevisionRange(startRevision, Math.Min(startRevision + _args.CommitInterval - 1, stopRevision)); startRevision += _args.CommitInterval; if (startRevision <= stopRevision) { if (_highestRevision.Reader != null) { _highestRevision.Reader.Close(); } CommitIndex(); _highestRevision.Reader = IndexReader.Open(_indexDirectory); _indexWriter = CreateIndexWriter(false); } } _stopIndexThread.Set(); if (_highestRevision.Reader != null) { _highestRevision.Reader.Close(); } _highestRevision.Reader = null; if (optimize) { Console.WriteLine("Optimizing index ..."); _indexWriter.Optimize(); } CommitIndex(); } _indexWriterMessageFilter = null; TimeSpan time = DateTime.UtcNow - start; Console.WriteLine("Finished in {0:00}:{1:00}:{2:00}", time.Hours, time.Minutes, time.Seconds); }
private static void InitVars() { Vars = new IndexProperty<string, object>(name => { return varsImpl[name]; }, (name, value) => { varsImpl[name] = value; }); }
///-------------------------------------------------------------------------------- /// <summary>Interpret this node to produce code, output, or model data..</summary> /// /// <param name="interpreterType">The type of interpretation to perform.</param> /// <param name="solutionContext">The associated solution.</param> /// <param name="templateContext">The associated template.</param> /// <param name="modelContext">The associated model context.</param> ///-------------------------------------------------------------------------------- public void InterpretNode(InterpreterTypeCode interpreterType, Solution solutionContext, ITemplate templateContext, IDomainEnterpriseObject modelContext) { try { if (CurrentItem != null) { if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentAuditProperty)) { if (solutionContext.CurrentAuditProperty != null) { AuditProperty.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- AuditProperty: ").Append(solutionContext.CurrentAuditProperty.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentCollection)) { if (solutionContext.CurrentCollection != null) { Collection.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Collection: ").Append(solutionContext.CurrentCollection.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEntity)) { if (solutionContext.CurrentEntity != null) { Entity.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Entity: ").Append(solutionContext.CurrentEntity.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEntityReference)) { if (solutionContext.CurrentEntityReference != null) { EntityReference.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- EntityReference: ").Append(solutionContext.CurrentEntityReference.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEnumeration)) { if (solutionContext.CurrentEnumeration != null) { Enumeration.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Enumeration: ").Append(solutionContext.CurrentEnumeration.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentFeature)) { if (solutionContext.CurrentFeature != null) { Feature.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Feature: ").Append(solutionContext.CurrentFeature.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentIndex)) { if (solutionContext.CurrentIndex != null) { Index.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Index: ").Append(solutionContext.CurrentIndex.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentIndexProperty)) { if (solutionContext.CurrentIndexProperty != null) { IndexProperty.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- IndexProperty: ").Append(solutionContext.CurrentIndexProperty.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentMethod)) { if (solutionContext.CurrentMethod != null) { Method.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Method: ").Append(solutionContext.CurrentMethod.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentMethodRelationship)) { if (solutionContext.CurrentMethodRelationship != null) { MethodRelationship.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- MethodRelationship: ").Append(solutionContext.CurrentMethodRelationship.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModel)) { if (solutionContext.CurrentModel != null) { Model.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Model: ").Append(solutionContext.CurrentModel.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModelObject)) { if (solutionContext.CurrentModelObject != null) { ModelObject.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- ModelObject: ").Append(solutionContext.CurrentModelObject.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModelProperty)) { if (solutionContext.CurrentModelProperty != null) { ModelProperty.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- ModelProperty: ").Append(solutionContext.CurrentModelProperty.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentObjectInstance)) { if (solutionContext.CurrentObjectInstance != null) { ObjectInstance.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- ObjectInstance: ").Append(solutionContext.CurrentObjectInstance.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentParameter)) { if (solutionContext.CurrentParameter != null) { Parameter.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Parameter: ").Append(solutionContext.CurrentParameter.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentProject)) { if (solutionContext.CurrentProject != null) { Project.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Project: ").Append(solutionContext.CurrentProject.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentProperty)) { if (solutionContext.CurrentProperty != null) { Property.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Property: ").Append(solutionContext.CurrentProperty.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyInstance)) { if (solutionContext.CurrentPropertyInstance != null) { PropertyInstance.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- PropertyInstance: ").Append(solutionContext.CurrentPropertyInstance.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyReference)) { if (solutionContext.CurrentPropertyReference != null) { PropertyReference.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- PropertyReference: ").Append(solutionContext.CurrentPropertyReference.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyRelationship)) { if (solutionContext.CurrentPropertyRelationship != null) { PropertyRelationship.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- PropertyRelationship: ").Append(solutionContext.CurrentPropertyRelationship.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentRelationship)) { if (solutionContext.CurrentRelationship != null) { Relationship.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Relationship: ").Append(solutionContext.CurrentRelationship.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentRelationshipProperty)) { if (solutionContext.CurrentRelationshipProperty != null) { RelationshipProperty.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- RelationshipProperty: ").Append(solutionContext.CurrentRelationshipProperty.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStage)) { if (solutionContext.CurrentStage != null) { Stage.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Stage: ").Append(solutionContext.CurrentStage.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStageTransition)) { if (solutionContext.CurrentStageTransition != null) { StageTransition.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- StageTransition: ").Append(solutionContext.CurrentStageTransition.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentState)) { if (solutionContext.CurrentState != null) { State.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- State: ").Append(solutionContext.CurrentState.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStateModel)) { if (solutionContext.CurrentStateModel != null) { StateModel.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- StateModel: ").Append(solutionContext.CurrentStateModel.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStateTransition)) { if (solutionContext.CurrentStateTransition != null) { StateTransition.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- StateTransition: ").Append(solutionContext.CurrentStateTransition.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStep)) { if (solutionContext.CurrentStep != null) { Step.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Step: ").Append(solutionContext.CurrentStep.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStepTransition)) { if (solutionContext.CurrentStepTransition != null) { StepTransition.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- StepTransition: ").Append(solutionContext.CurrentStepTransition.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentValue)) { if (solutionContext.CurrentValue != null) { Value.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Value: ").Append(solutionContext.CurrentValue.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentView)) { if (solutionContext.CurrentView != null) { View.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- View: ").Append(solutionContext.CurrentView.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentViewProperty)) { if (solutionContext.CurrentViewProperty != null) { ViewProperty.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- ViewProperty: ").Append(solutionContext.CurrentViewProperty.InnerXmlData); } } } else if (CurrentItem.CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentWorkflow)) { if (solutionContext.CurrentWorkflow != null) { Workflow.DeleteCurrentItemFromSolution(solutionContext); if (solutionContext.IsSampleMode == true) { templateContext.MessageBuilder.Append("\r\n- Workflow: ").Append(solutionContext.CurrentWorkflow.InnerXmlData); } } } #region protected #endregion protected else { LogException(solutionContext, templateContext, modelContext, String.Format(DisplayValues.Exception_CouldNotDeleteItem, CurrentItem.CurrentItemName), interpreterType); } } } catch (ApplicationAbortException) { throw; } catch (System.Exception ex) { LogException(solutionContext, templateContext, modelContext, ex, interpreterType); } }
set => this.SetValue(IndexProperty, value);
///-------------------------------------------------------------------------------- /// <summary>This method gets the collection context associated with this node.</summary> /// /// <param name="solutionContext">The associated solution.</param> /// <param name="templateContext">The associated template.</param> /// <param name="modelContext">The associated model context.</param> ///-------------------------------------------------------------------------------- public IEnterpriseEnumerable GetCollection(Solution solutionContext, ITemplate templateContext, IDomainEnterpriseObject modelContext) { IDomainEnterpriseObject nodeContext = modelContext; if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentAuditProperty)) { return(AuditProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentCollection)) { return(Collection.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEntity)) { return(Entity.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEntityReference)) { return(EntityReference.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentEnumeration)) { return(Enumeration.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentFeature)) { return(Feature.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentIndex)) { return(Index.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentIndexProperty)) { return(IndexProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentMethod)) { return(Method.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentMethodRelationship)) { return(MethodRelationship.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModel)) { return(Model.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModelObject)) { return(ModelObject.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentModelProperty)) { return(ModelProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentObjectInstance)) { return(ObjectInstance.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentParameter)) { return(Parameter.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentProject)) { return(Project.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentProperty)) { return(Property.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyInstance)) { return(PropertyInstance.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyReference)) { return(PropertyReference.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentPropertyRelationship)) { return(PropertyRelationship.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentRelationship)) { return(Relationship.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentRelationshipProperty)) { return(RelationshipProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStage)) { return(Stage.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStageTransition)) { return(StageTransition.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentState)) { return(State.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStateModel)) { return(StateModel.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStateTransition)) { return(StateTransition.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStep)) { return(Step.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentStepTransition)) { return(StepTransition.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentValue)) { return(Value.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentView)) { return(View.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentViewProperty)) { return(ViewProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (CurrentItemName == Enum.GetName(typeof(CurrentItemTypeCode), CurrentItemTypeCode.CurrentWorkflow)) { return(Workflow.GetCollectionContext(solutionContext, nodeContext)); } #region protected #endregion protected else if (solutionContext.ModelObjectNames.AllKeys.Contains(CurrentItemName.Substring(7)) == true) { return(ObjectInstance.GetCollectionContext(solutionContext, CurrentItemName.Substring(7), nodeContext)); } return(null); }
///-------------------------------------------------------------------------------- /// <summary>This method gets the collection context associated with this node.</summary> /// /// <param name="solutionContext">The associated solution.</param> /// <param name="templateContext">The associated template.</param> /// <param name="modelContext">The associated model context.</param> ///-------------------------------------------------------------------------------- public IEnterpriseEnumerable GetCollection(Solution solutionContext, ITemplate templateContext, IDomainEnterpriseObject modelContext) { IDomainEnterpriseObject nodeContext = modelContext; bool isValidContext; if (ModelContext != null) { nodeContext = ModelContext.GetModelContext(solutionContext, templateContext, modelContext, out isValidContext); } if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.AuditProperty)) { return(AuditProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Collection)) { return(Collection.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Entity)) { return(Entity.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.EntityReference)) { return(EntityReference.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Enumeration)) { return(Enumeration.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Feature)) { return(Feature.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Index)) { return(Index.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.IndexProperty)) { return(IndexProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Method)) { return(Method.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.MethodRelationship)) { return(MethodRelationship.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Model)) { return(Model.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ModelObject)) { return(ModelObject.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ModelProperty)) { return(ModelProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ObjectInstance)) { return(ObjectInstance.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Parameter)) { return(Parameter.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Project)) { return(Project.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Property)) { return(Property.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyInstance)) { return(PropertyInstance.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyReference)) { return(PropertyReference.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyRelationship)) { return(PropertyRelationship.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Relationship)) { return(Relationship.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.RelationshipProperty)) { return(RelationshipProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Solution)) { return(Solution.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Stage)) { return(Stage.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StageTransition)) { return(StageTransition.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.State)) { return(State.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StateModel)) { return(StateModel.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StateTransition)) { return(StateTransition.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Step)) { return(Step.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StepTransition)) { return(StepTransition.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Value)) { return(Value.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.View)) { return(View.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ViewProperty)) { return(ViewProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Workflow)) { return(Workflow.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlColumn)) { return(SqlColumn.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlDatabase)) { return(SqlDatabase.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlExtendedProperty)) { return(SqlExtendedProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlForeignKey)) { return(SqlForeignKey.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlForeignKeyColumn)) { return(SqlForeignKeyColumn.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlIndex)) { return(SqlIndex.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlIndexedColumn)) { return(SqlIndexedColumn.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlProperty)) { return(SqlProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlTable)) { return(SqlTable.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlView)) { return(SqlView.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlViewProperty)) { return(SqlViewProperty.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlAttribute)) { return(XmlAttribute.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlDocument)) { return(XmlDocument.GetCollectionContext(solutionContext, nodeContext)); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlNode)) { return(XmlNode.GetCollectionContext(solutionContext, nodeContext)); } #region protected else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Tag)) { return(Tag.GetCollectionContext(solutionContext, modelContext)); } #endregion protected else if (solutionContext.ModelObjectNames.AllKeys.Contains(ModelContextName) == true) { return(ObjectInstance.GetCollectionContext(solutionContext, ModelContextName, nodeContext)); } LogException(solutionContext, templateContext, modelContext, String.Format(DisplayValues.Exception_InvalidModelContext, ModelContextName, modelContext.GetType().Name), InterpreterTypeCode.None); return(null); }
///-------------------------------------------------------------------------------- /// <summary>This method gets the model context associated with this node.</summary> /// /// <param name="solutionContext">The associated solution.</param> /// <param name="templateContext">The associated template.</param> /// <param name="modelContext">The associated model context.</param> /// <param name="isValidContext">Output flag, signifying whether context returned is a valid one.</param> ///-------------------------------------------------------------------------------- public IDomainEnterpriseObject GetModelContext(Solution solutionContext, ITemplate templateContext, IDomainEnterpriseObject modelContext, out bool isValidContext) { IDomainEnterpriseObject nodeContext = modelContext; IDomainEnterpriseObject currentContext = modelContext; ModelContextNode leafModelContext = ModelContext; isValidContext = false; if (ThisContext != null) { templateContext.PopCount = templateContext.ModelContextStack.Count - 1; } else if (PopContext != null) { // go through pop context nodes directly here ModelContextNode contextNode = this; while (contextNode != null) { if (contextNode.PopContext != null) { leafModelContext = contextNode.ModelContext; templateContext.PopCount++; } contextNode = contextNode.ModelContext; } } if (templateContext.PopCount > 0) { // pop context executes first nodeContext = templateContext.GetModelContext(templateContext.PopCount); templateContext.PopCount = 0; } if (leafModelContext != null) { // model context nodes execute next (then, nodes are evaluated) nodeContext = leafModelContext.GetModelContext(solutionContext, templateContext, nodeContext, out isValidContext); } if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.AuditProperty)) { nodeContext = AuditProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Collection)) { nodeContext = Collection.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Entity)) { nodeContext = Entity.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.EntityReference)) { nodeContext = EntityReference.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Enumeration)) { nodeContext = Enumeration.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Feature)) { nodeContext = Feature.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Index)) { nodeContext = Index.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.IndexProperty)) { nodeContext = IndexProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Method)) { nodeContext = Method.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.MethodRelationship)) { nodeContext = MethodRelationship.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Model)) { nodeContext = Model.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ModelObject)) { nodeContext = ModelObject.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ModelProperty)) { nodeContext = ModelProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ObjectInstance)) { nodeContext = ObjectInstance.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Parameter)) { nodeContext = Parameter.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Project)) { nodeContext = Project.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Property)) { nodeContext = Property.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyInstance)) { nodeContext = PropertyInstance.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyReference)) { nodeContext = PropertyReference.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.PropertyRelationship)) { nodeContext = PropertyRelationship.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Relationship)) { nodeContext = Relationship.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.RelationshipProperty)) { nodeContext = RelationshipProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Solution)) { nodeContext = Solution.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Stage)) { nodeContext = Stage.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StageTransition)) { nodeContext = StageTransition.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.State)) { nodeContext = State.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StateModel)) { nodeContext = StateModel.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StateTransition)) { nodeContext = StateTransition.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Step)) { nodeContext = Step.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.StepTransition)) { nodeContext = StepTransition.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Value)) { nodeContext = Value.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.View)) { nodeContext = View.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.ViewProperty)) { nodeContext = ViewProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(ModelContextTypeCode), ModelContextTypeCode.Workflow)) { nodeContext = Workflow.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlColumn)) { nodeContext = SqlColumn.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlDatabase)) { nodeContext = SqlDatabase.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlExtendedProperty)) { nodeContext = SqlExtendedProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlForeignKey)) { nodeContext = SqlForeignKey.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlForeignKeyColumn)) { nodeContext = SqlForeignKeyColumn.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlIndex)) { nodeContext = SqlIndex.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlIndexedColumn)) { nodeContext = SqlIndexedColumn.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlProperty)) { nodeContext = SqlProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlTable)) { nodeContext = SqlTable.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlView)) { nodeContext = SqlView.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.SqlViewProperty)) { nodeContext = SqlViewProperty.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlAttribute)) { nodeContext = XmlAttribute.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlDocument)) { nodeContext = XmlDocument.GetModelContext(solutionContext, nodeContext, out isValidContext); } else if (ModelContextName == Enum.GetName(typeof(SpecModelContextTypeCode), SpecModelContextTypeCode.XmlNode)) { nodeContext = XmlNode.GetModelContext(solutionContext, nodeContext, out isValidContext); } #region protected else if (ModelContextName == "ReferencedEntity") { currentContext = nodeContext; nodeContext = Collection.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is Collection) { nodeContext = (nodeContext as Collection).ReferencedEntity; } else { nodeContext = EntityReference.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is EntityReference) { nodeContext = (nodeContext as EntityReference).ReferencedEntity; } else { nodeContext = Relationship.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is Relationship) { nodeContext = (nodeContext as Relationship).ReferencedEntity; } else { nodeContext = Parameter.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is Parameter) { nodeContext = (nodeContext as Parameter).ReferencedEntity; } } } } } else if (ModelContextName == "ReferencedProperty") { currentContext = nodeContext; nodeContext = RelationshipProperty.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is RelationshipProperty) { nodeContext = (nodeContext as RelationshipProperty).ReferencedProperty; } else { nodeContext = PropertyReference.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is PropertyReference) { nodeContext = (nodeContext as PropertyReference).ReferencedProperty; } else { nodeContext = Parameter.GetModelContext(solutionContext, currentContext, out isValidContext); if (nodeContext is Parameter) { nodeContext = (nodeContext as Parameter).ReferencedPropertyBase as Property; } } } } else if (ModelContextName == "BaseEntity") { nodeContext = Entity.GetModelContext(solutionContext, nodeContext, out isValidContext); if (nodeContext is Entity) { nodeContext = (nodeContext as Entity).BaseEntity; } } else if (solutionContext.ModelObjectPropertyNames[ModelContextName] != null) { nodeContext = ObjectInstance.GetModelContextViaProperty(solutionContext, ModelContextName, nodeContext, out isValidContext); } #endregion protected else if (solutionContext.ModelObjectNames.AllKeys.Contains(ModelContextName) == true) { return(ObjectInstance.GetModelContext(solutionContext, ModelContextName, nodeContext, out isValidContext)); } if (nodeContext == null && isValidContext == false) { LogException(solutionContext, templateContext, modelContext, String.Format(DisplayValues.Exception_InvalidModelContext, ModelContextName, modelContext.Name, modelContext.GetType().Name), InterpreterTypeCode.None); } return(nodeContext); }
public void OnClick() { _mapContext.Select(IndexProperty.GetValue()); }
/// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary> public IndexPropertyTest() { _dictionary = new Dictionary <int, string>(); OneDimensionWritableProperty = new IndexProperty <string, int>(GetOneDimensionValue, SetOneDimensionValue); }
public MapItemContext(string name, int index, MapContext context) { _mapContext = context; NameProperty.SetValue(name); IndexProperty.SetValue(index); }
public CharacterItemContext(string name, int index, CharacterContext context) { _characterContext = context; NameProperty.SetValue(name); IndexProperty.SetValue(index); }
internal set => SetValue(IndexProperty, value);
///-------------------------------------------------------------------------------- /// <summary>This method updates the view model data and sends update command back /// to the solution builder.</summary> ///-------------------------------------------------------------------------------- protected override void OnUpdate() { // set up reverse engineering instance if not present if (IndexProperty.ReverseInstance == null && IndexProperty.IsAutoUpdated == true) { IndexProperty.ReverseInstance = new IndexProperty(); IndexProperty.ReverseInstance.TransformDataFromObject(IndexProperty, null, false); // perform the update of EditIndexProperty back to IndexProperty IndexProperty.TransformDataFromObject(EditIndexProperty, null, false); IndexProperty.IsAutoUpdated = false; } else if (IndexProperty.ReverseInstance != null) { EditIndexProperty.ResetModified(IndexProperty.ReverseInstance.IsModified); if (EditIndexProperty.Equals(IndexProperty.ReverseInstance)) { // perform the update of EditIndexProperty back to IndexProperty IndexProperty.TransformDataFromObject(EditIndexProperty, null, false); IndexProperty.IsAutoUpdated = true; } else { // perform the update of EditIndexProperty back to IndexProperty IndexProperty.TransformDataFromObject(EditIndexProperty, null, false); IndexProperty.IsAutoUpdated = false; } } else { // perform the update of EditIndexProperty back to IndexProperty IndexProperty.TransformDataFromObject(EditIndexProperty, null, false); IndexProperty.IsAutoUpdated = false; } IndexProperty.ForwardInstance = null; if (PropertyIDCustomized || OrderCustomized || DescriptionCustomized || TagsCustomized) { IndexProperty.ForwardInstance = new IndexProperty(); IndexProperty.ForwardInstance.IndexPropertyID = EditIndexProperty.IndexPropertyID; IndexProperty.SpecSourceName = IndexProperty.DefaultSourceName; if (PropertyIDCustomized) { IndexProperty.ForwardInstance.PropertyID = EditIndexProperty.PropertyID; } if (OrderCustomized) { IndexProperty.ForwardInstance.Order = EditIndexProperty.Order; } if (DescriptionCustomized) { IndexProperty.ForwardInstance.Description = EditIndexProperty.Description; } if (TagsCustomized) { IndexProperty.ForwardInstance.Tags = EditIndexProperty.Tags; } } EditIndexProperty.ResetModified(false); OnUpdated(this, null); // send update back to solution builder SendEditIndexPropertyPerformed(); }
public void OnClick() { _characterContext.Select(IndexProperty.GetValue()); }
///-------------------------------------------------------------------------------- /// <summary>Create the instance with the designer view and other data.</summary> /// /// <param name="indexProperty">The IndexProperty to load.</param> /// <param name="solution">The associated solution.</param> /// <param name="loadChildren">Flag indicating if child information should be loaded.</param> ///-------------------------------------------------------------------------------- public IndexPropertyViewModel(IndexProperty indexProperty, Solution solution, bool loadChildren = true) { WorkspaceID = Guid.NewGuid(); Solution = solution; LoadIndexProperty(indexProperty, loadChildren); }
private void InitDynamicModel() { this.values = new IndexProperty<string, object>(name => { return this.GetValue(name); }, (name, value) => { this.SetValue(name, value); }); }
set => SetValue(IndexProperty, value);
get => (int)GetValue(IndexProperty); set => SetValue(IndexProperty, value);