Example #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);
        }
Example #2
0
        protected virtual void _loadDb()
        {
            DbDebugItem <TKey> debug = new DbDebugItem <TKey>(this);

            if (!debug.Load())
            {
                return;
            }
            DbLoader(debug, this);
        }
Example #3
0
		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);
		}
Example #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;
     }
 }
Example #5
0
 public virtual void OnLoadDataFromClipboard(DbDebugItem <TKey> debug, string text, string path, AbstractDb <TKey> abstractDb)
 {
     DbLoader(debug, this);
 }