예제 #1
0
        public void PackXsltFunction(PackageCreator pc)
        {
            IXsltFunction xsltFunction;
            try
            {
                xsltFunction = (from i in DataFacade.GetData<IXsltFunction>()
                                where i.Namespace + "." + i.Name == this.Id
                                select i).First();
            }
            catch (Exception)
            {
                throw new ArgumentException(string.Format(@"XSLT Function '{0}' doesn't exists", this.Id));
            }

            var newXslFilePath = "\\" + xsltFunction.Namespace.Replace(".", "\\") + "\\" + xsltFunction.Name + ".xsl";

            pc.AddFile("App_Data\\Xslt" + xsltFunction.XslFilePath, "App_Data\\Xslt" + newXslFilePath);
            xsltFunction.XslFilePath = newXslFilePath;

            pc.AddData(xsltFunction);

            var parameters = from i in DataFacade.GetData<IParameter>()
                             where i.OwnerId == xsltFunction.Id
                             orderby i.Position
                             select i;

            foreach (var parameter in parameters) pc.AddData(parameter);

            var namedFunctionCalls = from i in DataFacade.GetData<INamedFunctionCall>()
                                     where i.XsltFunctionId == xsltFunction.Id
                                     orderby i.Name
                                     select i;

            foreach (var namedFunctionCall in namedFunctionCalls) pc.AddData(namedFunctionCall);
        }
        public void PackUserControlFunction(PackageCreator pc, IFunction function)
        {
            if (function.EntityToken is FileBasedFunctionEntityToken)
            {
                var functionEntityToken = (FileBasedFunctionEntityToken)function.EntityToken;
                if (functionEntityToken.FunctionProviderName == PackageCreatorFacade.UserControlFunctionProviderName)
                {
                    var virtualPath = function.GetProperty("VirtualPath");
                    pc.AddFile(virtualPath);

                    string codeFile = virtualPath + ".cs";
                    if (C1File.Exists(PathUtil.Resolve(codeFile)))
                    {
                        pc.AddFile(codeFile);
                    }
                }
            }
        }
예제 #3
0
        public void PackUserControlFunction(PackageCreator pc, IFunction function)
        {
            if (function.EntityToken is FileBasedFunctionEntityToken)
            {
                var functionEntityToken = (FileBasedFunctionEntityToken)function.EntityToken;
                if (functionEntityToken.FunctionProviderName == PackageCreatorFacade.UserControlFunctionProviderName)
                {
                    var virtualPath = function.GetProperty("VirtualPath");
                    pc.AddFile(virtualPath);

                    string codeFile = virtualPath + ".cs";
                    if (C1File.Exists(PathUtil.Resolve(codeFile)))
                    {
                        pc.AddFile(codeFile);
                    }
                }
            }
        }
예제 #4
0
 public void PackRazorFunction(PackageCreator pc, IFunction function)
 {
     if (function.EntityToken is FileBasedFunctionEntityToken)
     {
         var functionEntityToken = (FileBasedFunctionEntityToken)function.EntityToken;
         if (functionEntityToken.FunctionProviderName == PackageCreatorFacade.RazorFunctionProviderName)
         {
             var virtualPath = function.GetProperty("VirtualPath");
             pc.AddFile(virtualPath);
         }
     }
 }
예제 #5
0
 public void PackRazorFunction(PackageCreator pc, IFunction function)
 {
     if (function.EntityToken is FileBasedFunctionEntityToken)
     {
         var functionEntityToken = (FileBasedFunctionEntityToken)function.EntityToken;
         if (functionEntityToken.FunctionProviderName == PackageCreatorFacade.RazorFunctionProviderName)
         {
             var virtualPath = function.GetProperty("VirtualPath");
             pc.AddFile(virtualPath);
         }
     }
 }
예제 #6
0
        public void Pack(PackageCreator creator)
        {
            var pageTemplate = PageTemplateFacade.GetPageTemplates().FirstOrDefault(t => t.Title == Id);

            if (pageTemplate == null)
            {
                throw new InvalidOperationException(string.Format("Template '{0}' does not exists", Id));
            }

            if (pageTemplate.GetType().Name.Contains("MasterPagePageTemplateDescriptor"))
            {
                var codeBehindFilePath = pageTemplate.GetProperty("CodeBehindFilePath");
                var filePath           = pageTemplate.GetProperty("FilePath");
                creator.AddFile("~" + PathUtil.GetWebsitePath(codeBehindFilePath));
                creator.AddFile("~" + PathUtil.GetWebsitePath(filePath));
            }
            else if (pageTemplate.GetType().Name.Contains("RazorPageTemplateDescriptor"))
            {
                var virtualPath = pageTemplate.GetProperty("VirtualPath");
                creator.AddFile(virtualPath);
            }
        }
예제 #7
0
        public void PackInlineFunction(PackageCreator creator)
        {
            var inlineFunction = DataFacade.GetData<IInlineFunction>(data => (data.Namespace + "." + data.Name) == this.Name).FirstOrDefault();
            if (inlineFunction != null)
            {

                var inlineFunctionId = inlineFunction.Id;
                creator.AddData(inlineFunction);
                creator.AddData<IInlineFunctionAssemblyReference>(d => d.Function == inlineFunctionId);
                creator.AddData<IParameter>(d => d.OwnerId == inlineFunctionId);

                creator.AddFile(string.Format(@"App_Data\Composite\InlineCSharpFunctions\{0}", inlineFunction.CodePath));
            }
        }
예제 #8
0
        public void PackInlineFunction(PackageCreator creator)
        {
            var inlineFunction = DataFacade.GetData <IInlineFunction>(data => (data.Namespace + "." + data.Name) == this.Name).FirstOrDefault();

            if (inlineFunction != null)
            {
                var inlineFunctionId = inlineFunction.Id;
                creator.AddData(inlineFunction);
                creator.AddData <IInlineFunctionAssemblyReference>(d => d.Function == inlineFunctionId);
                creator.AddData <IParameter>(d => d.OwnerId == inlineFunctionId);

                creator.AddFile(string.Format(@"App_Data\Composite\InlineCSharpFunctions\{0}", inlineFunction.CodePath));
            }
        }
예제 #9
0
        public void PackXsltFunction(PackageCreator pc)
        {
            IXsltFunction xsltFunction;

            try
            {
                xsltFunction = (from i in DataFacade.GetData <IXsltFunction>()
                                where i.Namespace + "." + i.Name == this.Id
                                select i).First();
            }
            catch (Exception)
            {
                throw new ArgumentException(string.Format(@"XSLT Function '{0}' doesn't exists", this.Id));
            }

            var newXslFilePath = "\\" + xsltFunction.Namespace.Replace(".", "\\") + "\\" + xsltFunction.Name + ".xsl";


            pc.AddFile("App_Data\\Xslt" + xsltFunction.XslFilePath, "App_Data\\Xslt" + newXslFilePath);
            xsltFunction.XslFilePath = newXslFilePath;

            pc.AddData(xsltFunction);

            var parameters = from i in DataFacade.GetData <IParameter>()
                             where i.OwnerId == xsltFunction.Id
                             orderby i.Position
                             select i;

            foreach (var parameter in parameters)
            {
                pc.AddData(parameter);
            }

            var namedFunctionCalls = from i in DataFacade.GetData <INamedFunctionCall>()
                                     where i.XsltFunctionId == xsltFunction.Id
                                     orderby i.Name
                                     select i;

            foreach (var namedFunctionCall in namedFunctionCalls)
            {
                pc.AddData(namedFunctionCall);
            }
        }
예제 #10
0
        public void Pack(PackageCreator creator)
        {
            var pageTemplate = PageTemplateFacade.GetPageTemplates().FirstOrDefault(t => t.Title == Id);

            if (pageTemplate == null)
                throw new InvalidOperationException(string.Format("Template '{0}' does not exists", Id));

            if (pageTemplate.GetType().Name.Contains("MasterPagePageTemplateDescriptor"))
            {
                var codeBehindFilePath = pageTemplate.GetProperty("CodeBehindFilePath");
                var filePath = pageTemplate.GetProperty("FilePath");
                creator.AddFile("~" + PathUtil.GetWebsitePath(codeBehindFilePath));
                creator.AddFile("~" + PathUtil.GetWebsitePath(filePath));
            }
            else if (pageTemplate.GetType().Name.Contains("RazorPageTemplateDescriptor"))
            {
                var virtualPath = pageTemplate.GetProperty("VirtualPath");
                creator.AddFile(virtualPath);
            }
        }