コード例 #1
0
        public XOPTable(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _name = reader.ReadAttribute("name", true);

            _source = reader.ReadAttribute("source");

            _sourceUpdate = reader.ReadAttribute("sourceUpdate");

            _schemeName = reader.ReadAttribute("schemeName");

            _autoFill = reader.ReadAttributeBool("autoFill", true);

            _persistFill = reader.ReadAttributeBool("persistFill", true);

            _stdCommandsType = reader.ReadAttributeEnumFlags<XOPTableCommandType>("stdCommandsType", XOPTableCommandType.All, XOPTableCommandType.Default);

            XElement xFields = reader.GetChildren("Fields", new DataAvail.Utils.Range(1)).FirstOrDefault();

            _fields = new XOPFields(xFields);

            XElement xFuncs = reader.GetChildren("Functions", new DataAvail.Utils.Range(0, 1)).FirstOrDefault();

            _functions = new XOPFunctions(xFuncs);

        }
コード例 #2
0
        public XWPAppView(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _menuItems = reader.GetChildren("MenuItems", new Range(1, 1)).Select(p=>new XWPMenuItems(p)).FirstOrDefault();

            _misc = reader.GetChildren("Misc", new Range(0, 1)).Select(p => new XWPMisc(p)).FirstOrDefault();

            _keys = reader.GetChildren("Keys", new Range(0, 1)).Select(p => new XWPKeyCommands(p)).FirstOrDefault();
        }
コード例 #3
0
        public XWPApplication(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _name = reader.ReadAttribute("name");

            _dataView = reader.GetChildren("DataView", new Range(0, 1)).Select(p=>new XWPDataView(p)).FirstOrDefault();

            _appView = reader.GetChildren("AppView", new Range(0, 1)).Select(p => new XWPAppView(p)).FirstOrDefault();
        }
コード例 #4
0
        public XWPDataView(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _parentDisplayField = reader.ReadAttribute("parentDisplayField");

            _saveMode = reader.ReadAttributeEnumFlags("saveMode", XWPTableSaveMode.All, XWPTableSaveMode.Default);

            _childSaveMode = reader.ReadAttributeEnumFlags("childSaveMode", XWPTableSaveMode.All, XWPTableSaveMode.Default);

            _tables = reader.GetChildren("Table", Range.NotBound).Select(p => new XWPTable(this, p)).ToArray();

            _relations = reader.GetChildren("Relations", new Range(0, 1)).Select(p => new XWPRelations(p)).FirstOrDefault();
        }
コード例 #5
0
        public XOPFunction(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _name = reader.ReadAttribute("name", true);

            _commandType = reader.ReadAttributeEnumFlags("type", XOPTableCommandType.All, XOPTableCommandType.None);

            _params = reader.GetChildren("Param", new Range(1, -1)).Select(p => new XOPFunctionParam(p)).ToArray();  

            if (!(CommandType == (XOPTableCommandType.Insert | XOPTableCommandType.Update)))
            {
                if (_commandType == XOPTableCommandType.None)
                {
                    XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Attribute commantType of command {0} is None. Command won't be used in project.", _name), false);
                }
                else if (EnumFlags.IsContainMixed(_commandType, XOPTableCommandType.Select))
                {
                    XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Attribute commantType of command {0} mixes Select and another command. Command of this type can't be mixed, will be used as Select.", _name), false);
                }
                else if (EnumFlags.IsContainMixed(_commandType, XOPTableCommandType.Delete))
                {
                    XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Attribute commantType of command {0} mixes Delete and another command. Command of this type can't be mixed, will be used as Delete.", _name), false);
                }
                else if (EnumFlags.IsContainMixed(_commandType, XOPTableCommandType.Insert))
                {
                    XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Attribute commantType of command {0} mixes Insert and command of type diffrent from Update. Command of this type can't be mixed, will be used as Insert.", _name), false);
                }
                else if (EnumFlags.IsContainMixed(_commandType, XOPTableCommandType.Update))
                {
                    XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, string.Format("Attribute commantType of command {0} mixes Update and command of type diffrent from Insert. Command of this type can't be mixed, will be used as Update.", _name), false);
                }
            }
        }
コード例 #6
0
        public XSPTable(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _tableName = reader.ReadAttribute("name", true);

            _mode = reader.ReadAttributeEnumFlags("mode", XOMode.All, XOMode.All);

            _fields = reader.GetChildren("Field", Range.NotBound).Select(p => new XSPField(p)).ToArray();
        }
コード例 #7
0
        public XSPApplication(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _mode = reader.ReadAttributeEnumFlags("mode", XOMode.All, XOMode.All);

            if (_mode == XOMode.None)
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, XElement, "mode", "Mode for application None, in this case project won't have any functionality.", false);

            _tables = reader.GetChildren("Table", Range.NotBound).Select(p => new XSPTable(p)).ToArray();
        }
コード例 #8
0
        public XOPDataSet(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _adapterPath = reader.ReadAttribute("adapterPath");

            _adapterType = reader.ReadAttributeEnum<XOPDataSetAdapterType>("adapterType", XOPDataSetAdapterType.Custom);

            if (string.IsNullOrEmpty(_adapterPath) && _adapterType == XOPDataSetAdapterType.Custom)
            {
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, "Either adapterType or adapterPath should be set for DataSet", true);
            }

            _connectionString = reader.ReadAttribute("connectionString", true);

            _schemeName = reader.ReadAttribute("schemeName");

            _useStdCommands = reader.ReadAttributeBool("useStdCommands", true);

            _tables = reader.GetChildren("Table", new Range(1, -1)).Select(p => new XOPTable(p)).ToArray();

            _relations = reader.GetChildren("Relations", new Range(-1, 1)).Select(p=>new XOPRelations(p)).FirstOrDefault();

        }
コード例 #9
0
        public XWPMenuItem(XElement XElement)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _caption = reader.ReadAttribute("caption", true);

            _tableName = reader.ReadAttribute("tableName");

            _children = reader.GetChildren("MenuItem", Range.NotBound).Select(p=>new XWPMenuItem(p)).ToArray();

            if (!string.IsNullOrEmpty(_tableName) && _children.Length > 0)
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, XElement, (string)null, "Menu item can't have tableName not null along with children menu items, tableName will be ignored.", false);

            if (string.IsNullOrEmpty(_tableName) && _children.Length == 0)
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, XElement, (string)null, "Menu item tableName is empty and doesn't contain children menu items.", false);

            _key = new XWPKeyCommand(XElement, false);

        }
コード例 #10
0
        public XWPTable(XWPDataView XWPDataView, XElement XElement)
        {
            _xWPDataView = XWPDataView;

            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            _tableName = reader.ReadAttribute("name", true);

            _caption = reader.ReadAttribute("caption");

            _itemCaption = reader.ReadAttribute("itemCaption");

            _separateSerialization = reader.ReadAttributeBool("separateSerialization", true);

            _saveMode = reader.ReadAttributeEnumFlags("saveMode", XWPTableSaveMode.All, XWPTableSaveMode.Default);

            _childSaveMode = reader.ReadAttributeEnumFlags("childSaveMode", XWPTableSaveMode.All, XWPTableSaveMode.Default);

            _fields = reader.GetChildren("Fields", new Range(0, 1)).Select(p => new XWPFields(this, p)).FirstOrDefault();
        }
コード例 #11
0
        public XWPKeyCommand(XElement XElement, bool Obrigatory)
        {
            XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog);

            string keyAttr = reader.ReadAttribute("key", Obrigatory);

            if (!string.IsNullOrEmpty(keyAttr))
            {
                _keys = keyAttr.Split(';').Select(p => new XWPKey(this, p)).ToArray();
            }
            else
            {
                _keys = new XWPKey[] { };
            }
            
            _command = reader.ReadAttributeEnum("command", XWPKeyCommandType.none);

            if (_command == XWPKeyCommandType.none)
                XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, XElement, "command", "Command can't have None type. It will be omitted.", false);

            _keyContexts = reader.GetChildren("KeyContext", Range.NotBound).Select(p => new XWPKeyCommandContext(this, p)).ToArray();

        }