本文整理匯總了C#中System.ComponentModel.Model.GetConnectionStatus方法的典型用法代碼示例。如果您正苦於以下問題:C# Model.GetConnectionStatus方法的具體用法?C# Model.GetConnectionStatus怎麽用?C# Model.GetConnectionStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.ComponentModel.Model
的用法示例。
在下文中一共展示了Model.GetConnectionStatus方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PrintToFile
private bool PrintToFile(Drawing currentDrawing)
{
bool Result = false;
double scale = 1.0;
if (rbtnSCALE.Checked)
{
//get scale of the first view
//scale = GetScaleFromTheView();
}
DrawingHandler MyDrawingHandler = new DrawingHandler();
PrintAttributes printAttributes = new PrintAttributes();
printAttributes.Scale = scale;
printAttributes.PrintToMultipleSheet = false;
printAttributes.NumberOfCopies = 1;
printAttributes.Orientation = DotPrintOrientationType.Auto;
printAttributes.PrintArea = DotPrintAreaType.EntireDrawing;
printAttributes.PrinterInstance = "DWG";
string DrawingType = GetDrawingTypeCharacter(currentDrawing);
/*
set XS_DRAWING_PLOT_FILE_DIRECTORY=.\PlotFiles
set XS_DRAWING_PLOT_FILE_NAME_A=%%UDA:PROJECT_USERFIELD_1%%-%%NAME.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
set XS_DRAWING_PLOT_FILE_NAME_W=%%UDA:PROJECT_USERFIELD_1%%-%%NAME.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
set XS_DRAWING_PLOT_FILE_NAME_C=%%UDA:PROJECT_USERFIELD_1%%-%%NAME.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
set XS_DRAWING_PLOT_FILE_NAME_G=%%UDA:PROJECT_USERFIELD_1%%-%%TITLE.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
set XS_DRAWING_PLOT_FILE_NAME_M=%%UDA:PROJECT_USERFIELD_1%%-%%TITLE.-%%%%REV_MARK?_Rev%%%%REV_MARK%%
*/
//string output_path = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_DIRECTORY");
string output_path = "c:\\pdf";
string output_file = "out.dwg";
Model CurrentModel = new Model();
ProjectInfo ProjectInfo = CurrentModel.GetProjectInfo();
if (CurrentModel.GetConnectionStatus())
{
output_file = ProjectInfo.ProjectNumber;
}
string DrawingName = "";
//TSM.Operations.Operation.DisplayPrompt("DrawingType" + DrawingType);
switch (DrawingType)
{
case "A":
//output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_A");
case "W":
//output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_W");
case "C":
//output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_C");
DrawingName = currentDrawing.Mark;
DrawingName = RemoveBrackets(DrawingName);
break;
case "G":
//output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_G");
case "M":
//output_file = Environment.GetEnvironmentVariable("XS_DRAWING_PLOT_FILE_NAME_M");
DrawingName = currentDrawing.Name;
break;
default:
goto case "A";
}
DrawingName = DrawingName.Replace('.', '-');
output_file += "-" + DrawingName + ".dwg";
if (!String.IsNullOrEmpty(output_path) && !String.IsNullOrEmpty(output_file))
Result = MyDrawingHandler.PrintDrawing(currentDrawing, printAttributes, output_path + "\\" + output_file);
return Result;
}