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


C# Document.Load方法代码示例

本文整理汇总了C#中System.Windows.Forms.Document.Load方法的典型用法代码示例。如果您正苦于以下问题:C# Document.Load方法的具体用法?C# Document.Load怎么用?C# Document.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Document的用法示例。


在下文中一共展示了Document.Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnOK_Click

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.txtProjectFile.Text))
            {
                if (!string.IsNullOrEmpty(DBGlobalService.ProjectFile))
                {
                    DBGlobalService.Save();
                }
                DBGlobalService.ProjectFile = this.txtProjectFile.Text.Trim();

                //ProjectDoc doc = new ProjectDoc();
                var doc = new Document();
                doc.Load(DBGlobalService.ProjectFile);
                DBGlobalService.CurrentProject = new ProjectType(doc);
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }
开发者ID:koksaver,项目名称:CodeHelper,代码行数:18,代码来源:OpenProjectFrm.cs

示例2: Open

		/// <summary>
		/// Open an existing file 
		/// </summary>
		/// <param name="path">Path for note</param>
		private void Open(string path)
		{
			try
			{
				using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
				{
					Document document = new Document();
					document.Load(fs);
					fNoteBox.Document = document;
					fFilePath = path;
					fFileName = System.IO.Path.GetFileNameWithoutExtension(path);
					Text = fFileName + " - " + TITLE;
					fNoteBox.Modified = false;
				}
			}
			catch (Exception e)
			{
				MessageBox.Show(this, "Unable to open file: " + path + "\n" + e.Message, "Error opening file", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:24,代码来源:NoteApp.cs

示例3: Open

		private void Open(string filename)
		{
			try
			{
				using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
				{
					Document document = new Document();
					document.Load(fs);
					fScribble.Document = document;
					//fScribble.Scribble.Highlight(new object[] { "the" });
					fFilePath = filename;
					fFileName = System.IO.Path.GetFileNameWithoutExtension(filename);
					Text = fFileName + " - " + TITLE;
					fScribble.Modified = false;
				}
			}
			catch (Exception e)
			{
				MessageBox.Show(this, "Unable to open file: " + filename + "\n" + e.Message, "Error opening file", MessageBoxButtons.OK, MessageBoxIcon.Error);
			}
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:21,代码来源:Form1.cs

示例4: LoadDB

        private void LoadDB()
        {
            string selectDir = GlobalService.CurrentPrj_Dir;
            string projectName = GlobalService.CurrentPrj_Name;

            string path = System.IO.Path.Combine(selectDir, "");

            DBGlobalService.ProjectFile = System.IO.Path.Combine(path, projectName + ".xml");
            var doc = new Document();
            ProjectType prj = null;
            if (!System.IO.File.Exists(DBGlobalService.ProjectFile))
            {
                var stream = System.IO.File.Create(DBGlobalService.ProjectFile);
                stream.Close();
                prj = doc.CreateNode<ProjectType>();
            }
            else
            {
                doc.Load(DBGlobalService.ProjectFile);
                prj = new ProjectType(doc);
            }

            DBGlobalService.CurrentProjectDoc = doc;

            DBGlobalService.CurrentProject = prj;
            DBGlobalService.CurrentProject.Name = projectName;

            doc.Save(DBGlobalService.ProjectFile);

            this.CreateDBTree();
        }
开发者ID:koksaver,项目名称:CodeHelper,代码行数:31,代码来源:ProjectPanel.Receiver.cs


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