Smrf.NodeXL.ExcelTemplate.ApplicationUtil.GetMissingTemplateMessage C# (CSharp) Method

GetMissingTemplateMessage() public static method

public static GetMissingTemplateMessage ( ) : String
return String
    GetMissingTemplateMessage()
    {
        String sTemplatePath;

        ApplicationUtil.TryGetTemplatePath(out sTemplatePath);

        return ( String.Format(

            "The {0} Excel template couldn't be found."
            + "\r\n\r\n"
            + "The {0} setup program should have copied the template to"
            + " {1}.  If you moved the template somewhere else, you won't"
            + " be able to use this feature."
            ,
            ApplicationUtil.ApplicationName,
            sTemplatePath
            ) );
    }

Usage Example

コード例 #1
0
        ExportSelectionToNewNodeXLWorkbook()
        {
            AssertValid();

            // Get the path to the application's template.

            String sTemplatePath;

            if (!ApplicationUtil.TryGetTemplatePath(out sTemplatePath))
            {
                throw new ExportWorkbookException(
                          ApplicationUtil.GetMissingTemplateMessage());
            }

            Workbook oNewNodeXLWorkbook = null;

            CopyTableToNewNodeXLWorkbook(WorksheetNames.Edges,
                                         TableNames.Edges, sTemplatePath, ref oNewNodeXLWorkbook);

            CopyTableToNewNodeXLWorkbook(WorksheetNames.Vertices,
                                         TableNames.Vertices, sTemplatePath, ref oNewNodeXLWorkbook);

            if (oNewNodeXLWorkbook == null)
            {
                throw new ExportWorkbookException(
                          "There are no selected edges or vertices to export to a new"
                          + " workbook."
                          );
            }

            return(oNewNodeXLWorkbook);
        }
All Usage Examples Of Smrf.NodeXL.ExcelTemplate.ApplicationUtil::GetMissingTemplateMessage