public override void InitData(IDataNode dataSource, Dictionary <string, string> paras)
        {
            if (dataSource == null)
            {
                return;
            }

            bool   bReadOnly = true;
            string sReadonly = "";

            if (paras.TryGetValue("readonly", out sReadonly))
            {
                bReadOnly = System.Convert.ToBoolean(sReadonly);
            }

            advXmlEditor.ReadOnly = bReadOnly;

            IEntity ent = dataSource.getEntity();

            if (ent is BusinessFile)
            {
                BusinessFile bf   = ent as BusinessFile;
                string       file = bf.GetDownloadPath();
                if (!string.IsNullOrEmpty(file))
                {
                    advXmlEditor.OpenDocument(file);
                }
            }
            else if (ent is IXmlData)
            {
                IXmlData dm = ent as IXmlData;

                if (dm.XMLFile == null)
                {
                    MessageBox.Show("选中的业务数据,没有获取到文件,不能编辑内容!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                dm.DownLoadFiles();
                dm.DownLoadXSDFiles();
                string file = dm.XMLFile.GetDownloadPath();
                if (!string.IsNullOrEmpty(file))
                {
                    if (!string.IsNullOrEmpty(dm.XSDFilePath))
                    {
                        advXmlEditor.OpenDocumentWithSchema(file, dm.XSDFilePath);
                    }
                    else
                    {
                        advXmlEditor.OpenDocument(file);
                    }
                    advXmlEditor.LanguageReader = dm.LanguageReader;
                }
            }
        }
Beispiel #2
0
 public XmlReportsHandler(IXmlData xmlDataToUse, ISqlServerData msSqlDataToUse, IMongoDbData mongoDbDataToUse)
 {
     this.xmlData   = xmlDataToUse;
     this.msSqlData = msSqlDataToUse;
     this.mongoData = mongoDbDataToUse;
 }
Beispiel #3
0
 public static void ToFile(IXmlData Data, string sFileName)
 {
     System.IO.StreamWriter Writer = System.IO.File.CreateText(sFileName);
     Writer.Write(Data.GetAsString());
     Writer.Close();
 }
 public XmlReportsHandler(IXmlData xmlDataToUse, ISqlServerData msSqlDataToUse, IMongoDbData mongoDbDataToUse)
 {
     this.xmlData = xmlDataToUse;
     this.msSqlData = msSqlDataToUse;
     this.mongoData = mongoDbDataToUse;
 }
 // Public constructor
 public XmlHierarchicalData(IXmlData Data)
 {
     Init(Data.GetAsDOM());
 }