Dev2.Studio.Core.Utils.NewWorkflowNames.GetNext C# (CSharp) 메소드

GetNext() 공개 메소드

Gets the next available name to use for createing new workflow
public GetNext ( ) : string
리턴 string
        public string GetNext()
        {
            string newWorkflowBaseName = StringResources.NewWorkflowBaseName;

            int counter = 1;
            string fullName = StringResources.NewWorkflowBaseName + " " + counter;

            while(Contains(fullName))
            {
                counter++;
                fullName = newWorkflowBaseName + " " + counter;
            }

            Add(fullName);

            return fullName;
        }

Usage Example

        public void CanFunctionNormallyWithMixedAddRemoveOdd()
        {
            NewWorkflowNames workflowNames = new NewWorkflowNames();
            int cnt = 1;

            for(int i = cnt; i < 10; i++)
            {
                string name = "Unsaved " + i;
                workflowNames.Add(name);
            }

            for(int i = 1; i < 10; i += 2)
            {
                string name = "Unsaved " + i;
                workflowNames.Remove(name);
            }

            var next = workflowNames.GetNext();

            Assert.AreEqual("Unsaved 1", next);
        }
All Usage Examples Of Dev2.Studio.Core.Utils.NewWorkflowNames::GetNext