Example #1
0
        public static string GetPath(IScope scope, string folder)
        {
            StringBuilder builder = new StringBuilder();
            IScope        scope2  = ScopeUtils.FindApplication(scope);

            if (scope2 != null)
            {
                do
                {
                    builder.Insert(0, scope.Name + Path.DirectorySeparatorChar);
                    scope = scope.Parent;
                }while (scope.Depth >= scope2.Depth);
                builder.Insert(0, "apps" + Path.DirectorySeparatorChar);
            }
            builder.Insert(0, "~");
            builder.Append(folder);
            builder.Append(Path.DirectorySeparatorChar);
            return(builder.ToString());
        }
        public static string GetPath(IScope scope, string folder)
        {
            StringBuilder result = new StringBuilder();
            IScope        app    = ScopeUtils.FindApplication(scope);

            if (app != null)
            {
                do
                {
                    result.Insert(0, scope.Name + Path.DirectorySeparatorChar);
                    scope = scope.Parent;
                }while (scope.Depth >= app.Depth);
                result.Insert(0, "apps" + Path.DirectorySeparatorChar);
            }
            result.Insert(0, "~");
            result.Append(folder);
            result.Append(Path.DirectorySeparatorChar);
            return(result.ToString());
        }