Exemplo n.º 1
0
        public void SaveSettings(ISettingOwner owner)
        {
            ProjectSettings prjset   = (ProjectSettings)owner;
            PageSettings    ps       = (PageSettings)prjset.SelectedPage;
            string          filePath = ps.FilePath;
            string          fileName = ps.FileName;
            XmlDocument     xmlDoc   = new XmlDocument();

            xmlDoc.Load(filePath);
            XmlElement node         = (XmlElement)xmlDoc.SelectSingleNode("//Settings");
            XmlElement existingNode = (XmlElement)xmlDoc.SelectSingleNode("//ExportFile[@FileName='" + fileName + "']");

            if (existingNode != null)
            {
                existingNode.SetAttribute("Namespace", ps.NameSpace);
                existingNode.SetAttribute("ClassName", ps.ClassName);
            }
            else
            {
                XmlElement child = node.OwnerDocument.CreateElement("ExportFile");
                child.SetAttribute("Namespace", ps.NameSpace);
                child.SetAttribute("ClassName", ps.ClassName);
                child.SetAttribute("FileName", ps.FileName);
                node.AppendChild(child);
            }
            xmlDoc.Save(filePath);
        }
Exemplo n.º 2
0
        public void LoadSettings(ISettingOwner owner)
        {
            ProjectSettings prjset   = (ProjectSettings)owner;
            PageSettings    ps       = (PageSettings)prjset.SelectedPage;
            string          filePath = ps.FilePath;
            string          fileName = ps.FileName;

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(filePath);
            XmlElement node = (XmlElement)xmlDoc.SelectSingleNode("//ExportFile[@FileName='" + fileName + "']");

            if (node != null)
            {
                string       nameSpace = node.GetAttribute("Namespace");
                string       className = node.GetAttribute("ClassName");
                PageSettings newPage   = new PageSettings(filePath, fileName, nameSpace, className);

                prjset.SelectedPage = newPage;
                prjset.IsSetted     = true;
                settingConstructor  = prjset;
            }
            else
            {
                prjset.IsSetted    = false;
                settingConstructor = prjset;
            }
        }
Exemplo n.º 3
0
        public IntPtr AddEvent(ContactInfo associatedContact, object data, ISettingOwner owner, DatabaseEventType type, DatabaseEventProperties flags, DateTime? timestamp, bool throwOnFailure)
        {
            if (owner == null)
                throw new ArgumentNullException("owner");

            return AddEvent(associatedContact, data, owner.Name, type, flags, timestamp, throwOnFailure);
        }
Exemplo n.º 4
0
 public IntPtr AddEvent(ContactInfo associatedContact, object data, ISettingOwner owner, DatabaseEventType type, DatabaseEventProperties flags, DateTime? timestamp)
 {
     return AddEvent(associatedContact, data, owner, type, flags, timestamp, true);
 }