本文整理汇总了C#中Workspace.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Workspace.Save方法的具体用法?C# Workspace.Save怎么用?C# Workspace.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workspace
的用法示例。
在下文中一共展示了Workspace.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitWorkspace
/// <summary>
/// 初始化工作空间
/// </summary>
private void InitWorkspace()
{
SplashScreenManager.ShowForm(typeof(MyWaitForm), false, true);
SplashScreenManager.Default.SetWaitFormCaption("系统初始化");
SplashScreenManager.Default.SetWaitFormDescription("正在初始化工作空间,请稍候...");
Workspace = new Workspace();
var workspaceConnectionInfo = new WorkspaceConnectionInfo
{
Type = WorkspaceType.SQL,
Driver = ConfigHelper.GetConfig("WorkspaceDriver"),
Server = ConfigHelper.GetConfig("WorkspaceServer"),
Database = ConfigHelper.GetConfig("WorkspaceDatabase"),
Name = ConfigHelper.GetConfig("WorkspaceName"),
User = ConfigHelper.GetConfig("WorkspaceUser"),
Password = ConfigHelper.GetConfig("WorkspacePassword")
};
var workspaceOpened = Workspace.Open(workspaceConnectionInfo);
SplashScreenManager.CloseForm();
if (workspaceOpened)
{
var datasoureName = ConfigHelper.GetConfig("StationDatasourceName");
if (Workspace.Datasources.Contains(datasoureName))
{
var datasource = Workspace.Datasources[datasoureName];
if (!datasource.IsConnected)
{
Workspace.Datasources.Close(datasoureName);
Workspace.Datasources.Open(CreateDatasourceConnectionInfo(datasoureName));
Workspace.Save();
}
}
else
{
var datasource = Workspace.Datasources.Open(CreateDatasourceConnectionInfo(datasoureName));
Workspace.Save();
}
}
else
{
var dlgConfigWorkspace = new DlgConfigWorkspace();
if (dlgConfigWorkspace.ShowDialog() == DialogResult.Cancel)
{
this.Close();
}
}
}
示例2: axPushButton_ClickEvent
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void axPushButton_ClickEvent( object sender, EventArgs e )
{
MessageBox.Show( "解压的可能时间比较长 请等待分钟 或更长的时间" );
if ( m_FolderBrowserDialog.ShowDialog() == DialogResult.OK )
{
for ( int i = 0; i < m_SGLEditorDocumentForm.m_SglFileInfo.SGLImage.Length; i++ )
{
SGLImage sglImage = m_SGLEditorDocumentForm.m_SglFileInfo.SGLImage[i];
for ( int i2 = 0; i2 < sglImage.SGLFrames.Length; i2++ )
{
SGLFrame sglFrame = sglImage.SGLFrames[i2];
if ( sglFrame.SGLFrameFormat11Or12Or22.DecodeFrame32Stream == null )
{
if ( sglFrame.SGLFrameFormat11Or12Or22.LoadImage() == false )
break;
else
{
Workspace workspace = new Workspace();
workspace.Open( sglFrame.SGLFrameFormat11Or12Or22.DecodeFrame32Stream );
TgaEncoder encoder = new TgaEncoder();
StringBuilder strBuilder = new StringBuilder();
strBuilder.Append( m_FolderBrowserDialog.SelectedPath );
strBuilder.Append( "\\[" );
strBuilder.Append( Path.GetFileNameWithoutExtension( m_SGLEditorDocumentForm.m_SglFileName ) );
strBuilder.Append( "]Image[" );
strBuilder.Append( i.ToString( "D5" ) );
strBuilder.Append( "]" );
strBuilder.Append( "Frame[" );
strBuilder.Append( i2.ToString( "D3" ) );
strBuilder.Append( "]" );
strBuilder.Append( "Offset[" );
strBuilder.Append( sglFrame.CenterX.ToString( "D4" ) );
strBuilder.Append( "X" );
strBuilder.Append( sglFrame.CenterY.ToString( "D4" ) );
strBuilder.Append( "]" );
strBuilder.Append( ".tga" );
string imageName = strBuilder.ToString();
workspace.Save( imageName, encoder );
}
}
}
}
MessageBox.Show( "文件全部解压完成" );
}
}