当前位置: 首页>>代码示例>>C#>>正文


C# Workspace.Save方法代码示例

本文整理汇总了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();
                }
            }
        }
开发者ID:zfc317,项目名称:mscd,代码行数:50,代码来源:DlgLoginForm.cs

示例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( "文件全部解压完成" );
            }
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:61,代码来源:CurrentImageControl.cs


注:本文中的Workspace.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。