本文整理汇总了C#中IData.CalcLength方法的典型用法代码示例。如果您正苦于以下问题:C# IData.CalcLength方法的具体用法?C# IData.CalcLength怎么用?C# IData.CalcLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IData
的用法示例。
在下文中一共展示了IData.CalcLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveToDataView
public static void SaveToDataView(IData data, string fileName)
{
XmlSerializer serializer;
if (typeof(NaccsData).IsInstanceOfType(data))
{
serializer = new XmlSerializer(typeof(NaccsData));
}
else
{
serializer = new XmlSerializer(typeof(IData));
}
TextWriter textWriter = new StreamWriter(fileName);
data.CalcLength();
serializer.Serialize(textWriter, data);
textWriter.Close();
}
示例2: Printing
public void Printing(object Sender, string Key, IData Data, int PrintFlg, bool PreviewFlg)
{
if (PrintFlg == 0)
{
if (this.mManualFlg)
{
return;
}
this.mManualFlg = true;
}
this.mSender = Sender;
this.SettingsRead();
if ((PrintFlg != 2) || this.IsAutomaticPrint(Data))
{
int length = Data.Header.Length;
if (length <= 400)
{
length = Data.CalcLength();
}
if (PrintFlg == 0)
{
if (ConfigFiles.printerSettings.DefaultInfo.SizeWarning && (length > this.mBorderByte))
{
string str;
if (!PreviewFlg)
{
str = "W601";
}
else
{
str = "W602";
}
IMessageDialog dialog = new MessageDialog();
if (dialog.ShowMessage(str, Math.Truncate((double) (((double) this.mBorderByte) / 1024.0)).ToString(), "") != DialogResult.Yes)
{
this.mManualFlg = false;
return;
}
}
try
{
AbstractJobConfig config;
this.GetJobConfig(Data, out config);
if (this.mCombi)
{
Data.Style = JobStyle.combi;
Data.JobIndex = 1;
}
PrintThread thread = new PrintThread();
thread.OnThPrintEnd += new OnThPrintEndHandler(this.PrintManager_OnPrintEnd);
thread.OnThPrintError += new OnThPrintErrorHandler(this.PrintManager_OnPrintError);
thread.TmThreadPrint(PrintStatus.Print, Sender, Key, PrintFlg, config, Data, PreviewFlg);
}
catch (NaccsException exception)
{
this.mManualFlg = false;
if (this.OnPrintError != null)
{
this.OnPrintError(exception, Key, PrintFlg);
}
else
{
this.PrintErrMsg(exception);
}
}
catch (Exception exception2)
{
this.mManualFlg = false;
NaccsException sender = new NaccsException(Naccs.Common.MessageKind.Error, 0x261, exception2.Message);
if (this.OnPrintError != null)
{
this.OnPrintError(sender, Key, PrintFlg);
}
else
{
this.PrintErrMsg(sender);
}
}
}
else if (!ConfigFiles.printerSettings.DefaultInfo.SizeWarning || (length <= this.mBorderByte))
{
PQRecAttr rec = new PQRecAttr {
Key = Key,
Data = (NaccsData) Data,
PrintFlg = PrintFlg
};
this.QueueThreadStart(rec);
}
}
}