コード例 #1
0
        public override sealed void LoadFromClipboard(string content)
        {
            bool fileExists;

            try {
                fileExists = File.Exists(content);
            }
            catch {
                fileExists = false;
            }

            string path;

            if (fileExists)
            {
                path = content;
            }
            else
            {
                path = TemporaryFilesManager.GetTemporaryFilePath("clipboard_{0:000}");
                File.WriteAllText(path, content);
            }

            DbDebugItem <TKey> debug = new DbDebugItem <TKey>(this);

            debug.FilePath = path;

            string text = File.ReadAllText(path);

            OnLoadFromClipboard(debug, text, path, this);
            Attached["FromUserRawInput"] = true;
            Table.EnableRawEvents        = true;
            OnLoadDataFromClipboard(debug, text, path, this);
        }
コード例 #2
0
        protected virtual void _loadDb()
        {
            DbDebugItem <TKey> debug = new DbDebugItem <TKey>(this);

            if (!debug.Load())
            {
                return;
            }
            DbLoader(debug, this);
        }
コード例 #3
0
ファイル: AbstractDb.cs プロジェクト: zdurexz/RagnarokSDE
		public override void WriteDb(string dbPath, string subPath, ServerType serverType, FileType fileType = FileType.Detect) {
			DbDebugItem<TKey> debug = new DbDebugItem<TKey>(this);

			if (!debug.Write(dbPath, subPath, serverType, fileType)) return;
			if ((fileType & FileType.Sql) == FileType.Sql && DbWriterSql != null) {
				DbWriterSql(debug, this);
				return;
			}
			DbWriter(debug, this);
		}
コード例 #4
0
 public virtual void OnLoadFromClipboard(DbDebugItem <TKey> debug, string text, string path, AbstractDb <TKey> abstractDb)
 {
     if (text.StartsWith("{") || text.Contains("(\r\n\t") || text.Contains("(\n\t") || path.IsExtension(".conf"))
     {
         debug.FileType = FileType.Conf;
     }
     else if (text.StartsWith("  - "))
     {
         debug.FileType = FileType.Yaml;
     }
     else
     {
         debug.FileType = FileType.Txt;
     }
 }
コード例 #5
0
 public virtual void OnLoadDataFromClipboard(DbDebugItem <TKey> debug, string text, string path, AbstractDb <TKey> abstractDb)
 {
     DbLoader(debug, this);
 }