コード例 #1
0
ファイル: AliaserService.cs プロジェクト: jiriKuba/Aliaser
        public String GetTransformedText(String selectedText, TransformationFlow flow, out Boolean wasChangesMade)
        {
            wasChangesMade = false;

            if (String.IsNullOrEmpty(selectedText) || this._typeDictionary == null || this._typeDictionary.Count == 0)
                return selectedText;
            else
            {
                String resultText = selectedText;
                foreach (KeyValuePair<String, String> item in this._typeDictionary)
                {
                    KeyValuePair<String, String> transPair = item;

                    if (flow == TransformationFlow.TO_INSTANCE)
                        transPair = new KeyValuePair<String, String>(transPair.Value, transPair.Key);
                    
                    if (resultText.Contains(transPair.Key))
                    {
                        resultText = resultText.Replace(transPair.Key, transPair.Value);
                        wasChangesMade = true;
                    }
                }

                return resultText;
            }
        }
コード例 #2
0
ファイル: AliaserService.cs プロジェクト: larrynung/Aliaser
        public String GetTransformedText(String selectedText, TransformationFlow flow, out Boolean wasChangesMade)
        {
            wasChangesMade = false;

            if (String.IsNullOrEmpty(selectedText) || this._typeDictionary == null || this._typeDictionary.Count == 0)
            {
                return(selectedText);
            }
            else
            {
                String resultText = selectedText;
                foreach (KeyValuePair <String, String> item in this._typeDictionary)
                {
                    KeyValuePair <String, String> transPair = item;

                    if (flow == TransformationFlow.TO_INSTANCE)
                    {
                        transPair = new KeyValuePair <String, String>(transPair.Value, transPair.Key);
                    }

                    if (resultText.Contains(transPair.Key))
                    {
                        resultText     = resultText.Replace(transPair.Key, transPair.Value);
                        wasChangesMade = true;
                    }
                }

                return(resultText);
            }
        }
コード例 #3
0
ファイル: AliaserService.cs プロジェクト: jiriKuba/Aliaser
 public String GetTransformedText(String selectedText, TransformationFlow flow)
 {
     Boolean wasChangesMade = false;
     return this.GetTransformedText(selectedText, flow, out wasChangesMade);
 }
コード例 #4
0
ファイル: AliaserService.cs プロジェクト: larrynung/Aliaser
        public String GetTransformedText(String selectedText, TransformationFlow flow)
        {
            Boolean wasChangesMade = false;

            return(this.GetTransformedText(selectedText, flow, out wasChangesMade));
        }