public void addSong(string nm, string alb, string art, string tm) { XmlDataProvider prov = (XmlDataProvider)plist.DataContext; if (prov == null) { prov = new XmlDataProvider(); XmlDocument doc = new XmlDocument(); doc.CreateXmlDeclaration("1.0", "utf-8", "yes"); XmlNode r = doc.CreateNode(XmlNodeType.Element, "songs", ""); doc.AppendChild(r); prov.Document = doc; } XmlNode songNode = prov.Document.CreateNode(XmlNodeType.Element, "song", ""); XmlNode nameNode = prov.Document.CreateNode(XmlNodeType.Element, "name", ""); nameNode.InnerText = nm+"\n"; XmlNode albumNode = prov.Document.CreateNode(XmlNodeType.Element, "album", ""); albumNode.InnerText = " " + alb + "\n"; XmlNode artistNode = prov.Document.CreateNode(XmlNodeType.Element, "artist", ""); artistNode.InnerText = " " + art + "\n"; XmlNode timeNode = prov.Document.CreateNode(XmlNodeType.Element, "time", ""); timeNode.InnerText = " " + tm + "\n"; songNode.AppendChild(nameNode); songNode.AppendChild(artistNode); songNode.AppendChild(albumNode); songNode.AppendChild(timeNode); prov.Document.DocumentElement.AppendChild(songNode); plist.DataContext = prov; }
public AlarmService() { setDirectory(@"C:\appData\Machine Tag Editor\"); setFileName(@"alarms.xml"); alarmDataProvider = new XmlDataProvider(); alarmDataProvider.Document = new XmlDocument(); try { alarmDataProvider.Document.Load(FullFilePath); } catch { alarmDataProvider.Document.AppendChild(alarmDataProvider.Document.CreateElement("tags")); alarmDataProvider.Document.Save(FullFilePath); } alarmDataProvider.Source = new Uri(FullFilePath); alarmDataProvider.XPath = _rootName; alarmDataTags = new ObservableCollection<DataTag>(); alarmVirtualTags = new ObservableCollection<DataTag>(); reloadTags(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpWines = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.btnGet = ((System.Windows.Controls.Button)(target)); #line 15 "..\..\MainWindow.xaml" this.btnGet.Click += new System.Windows.RoutedEventHandler(this.btnGet_Click); #line default #line hidden return; case 3: this.cbCountry = ((System.Windows.Controls.ComboBox)(target)); #line 16 "..\..\MainWindow.xaml" this.cbCountry.Loaded += new System.Windows.RoutedEventHandler(this.cbCountry_Loaded); #line default #line hidden return; case 4: this.dgdWines = ((System.Windows.Controls.DataGrid)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpMovies = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.lbxMovies = ((System.Windows.Controls.ListBox)(target)); return; case 3: this.txtName = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtDirector = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.txtCountry = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.chkChecked = ((System.Windows.Controls.CheckBox)(target)); return; case 7: this.btnCreate = ((System.Windows.Controls.Button)(target)); #line 40 "..\..\Movies2.xaml" this.btnCreate.Click += new System.Windows.RoutedEventHandler(this.btnCreate_Click); #line default #line hidden return; case 8: this.btnDelete = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\Movies2.xaml" this.btnDelete.Click += new System.Windows.RoutedEventHandler(this.btnDelete_Click); #line default #line hidden return; case 9: this.btnSave = ((System.Windows.Controls.Button)(target)); #line 42 "..\..\Movies2.xaml" this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click); #line default #line hidden return; } this._contentLoaded = true; }
public ViewContainer(XmlDataProvider provider) { XMLDataProvider = provider; XMLDataProvider.DataChanged += XMLDataProvider_DataChanged; FullFilePath = provider.Source.LocalPath; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ListGrid = ((System.Windows.Controls.Grid)(target)); return; case 2: this.NotesData = ((System.Windows.Data.XmlDataProvider)(target)); return; case 3: this.Viewer = ((System.Windows.Controls.ScrollViewer)(target)); return; case 4: this.StPList = ((System.Windows.Controls.StackPanel)(target)); return; case 5: this.DelBtn = ((MaterialDesignThemes.Wpf.Badged)(target)); return; case 6: #line 21 "..\..\UserControlList.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.RemoveEvent_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpWines = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.txtName = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.txtPoints = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtCountry = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.btnCreate = ((System.Windows.Controls.Button)(target)); #line 21 "..\..\CreateWine.xaml" this.btnCreate.Click += new System.Windows.RoutedEventHandler(this.btnCreate_Click); #line default #line hidden return; } this._contentLoaded = true; }
public void SetData(XmlDataProvider data) { Binding bind = new Binding(); bind.XPath = "*"; bind.Source = data; BindingOperations.SetBinding(treeTest, TreeView.ItemsSourceProperty, bind); }
public void AddFile(string filePath) { XmlDataProvider provider = new XmlDataProvider(); provider.Source = new Uri(filePath); provider.XPath = "tags"; if (!XMLDataProviderList.Contains(provider)) XMLDataProviderList.Add(provider); }
public DBTreeOperation(string strDBPath) { ConnString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source="; ConnString += strDBPath; m_conn = new OleDbConnection(ConnString); m_dicDirNames = new Dictionary<string, string>(); m_dirProvider = new XmlDataProvider(); m_dirProvider.XPath = "*"; }
public MainWindow() { InitializeComponent(); xml_provider = (XmlDataProvider)this.Resources["ScenarioConfigXML"]; string appPath = System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().CodeBase); xml_provider.Source = new Uri(appPath + @"\Config\scenario_chemotaxis.xml"); }
private void ButtonXML_Click_1(object sender, RoutedEventArgs e) { XmlDataProvider xpd = new XmlDataProvider(); xpd.Source = new Uri(@"..\..\StuInfo.xml",UriKind.Relative); xpd.XPath = @"/students/student"; listviewXML.DataContext = xpd; listviewXML.SetBinding(ListView.ItemsSourceProperty, new Binding()); }
private void InitializeDummyFolders() { if (xdp != null) return; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(Application.GetResourceStream(new Uri(@"pack://application:,,,/EmailService;component/Data/FolderList.xml", UriKind.Absolute)).Stream); xdp = new XmlDataProvider(); xdp.Document = xmlDoc; xdp.XPath = "FolderList"; }
public MainWindow() { InitializeComponent(); xmlData.ReadXml(loc); DataView palautteetView = new DataView(); XmlDataProvider xml = new XmlDataProvider(); xml.Source = loca; xml.XPath = "Palaute"; palautteetGrid.ItemsSource = xml.Document; }
private void BindXMLDocument() { if (_xmldocument == null) { xmlTree.ItemsSource = null; return; } var provider = new XmlDataProvider {Document = _xmldocument}; var binding = new Binding {Source = provider, XPath = "child::node()"}; xmlTree.SetBinding(TreeView.ItemsSourceProperty, binding); }
/// <summary>Binds the XML document to the viewer.</summary> private void BindXMLDocument() { if (_xmldocument == null) { xmlTree.ItemsSource = null; return; } XmlDataProvider provider = new XmlDataProvider(); provider.Document = _xmldocument; Binding binding = new Binding(); binding.Source = provider; binding.XPath = "child::node()"; xmlTree.SetBinding(TreeView.ItemsSourceProperty, binding); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.projects = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.activityProject = ((System.Windows.Controls.ListBox)(target)); #line 24 "..\..\..\View\UpdateProject.xaml" this.activityProject.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.SelectProject); #line default #line hidden return; case 3: this.projectName = ((System.Windows.Controls.TextBox)(target)); return; case 4: #line 31 "..\..\..\View\UpdateProject.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Close); #line default #line hidden return; case 5: #line 33 "..\..\..\View\UpdateProject.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Update); #line default #line hidden return; case 6: #line 35 "..\..\..\View\UpdateProject.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Delete); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpWines = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.lbWines = ((System.Windows.Controls.ListBox)(target)); return; } this._contentLoaded = true; }
public EarthquakeWidget() { InitializeComponent(); Caption = "New Earthquake Widget"; // Retrieve the symbols used to show earthquake epicenters, defined in the Widget.xaml resources. _sym = (client.Symbols.SimpleMarkerSymbol)this.TryFindResource("EpicenterSymbol"); // Set up XmlDataProvider here, so we can later change the source property if required. _xmlData = this.TryFindResource("atomProvider") as XmlDataProvider; // Hook to the data change event on this. _xmlData.DataChanged += _xmlData_DataChanged; }
private void deleteall_Click(object sender, System.Windows.RoutedEventArgs e) { var key = System.Windows.MessageBox.Show("删除全部数据吗?", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel); if (key.ToString() != "OK") { return; } System.Windows.Data.XmlDataProvider jiluy = this.FindResource("ExercisesDataSource") as XmlDataProvider; XmlNode selectnode = jiluy.Document.SelectSingleNode("exercises"); //xml文件的根节点 selectnode.RemoveAll(); jiluy.Document.Save("xml/Exercises.xml"); this.deleteall.IsEnabled = false; }
public XmlDataProvider LoadFromXML(string path) { var _dataProvider = new XmlDataProvider(); _dataProvider.Document = new XmlDocument(); _dataProvider.XPath = "tags"; try { _dataProvider.Document.Load(path); /*foreach (XmlNode node in _dataProvider.Document.ChildNodes) { switch (node.Name.ToLower()) { case "enum": case "bits": ParseEnum(node); break; case "virtual": case "tag": ParseTag(node); break; case "array": ParseArray(node); break; case "copy": ParseCopy(node); break; case "table": ParseTable(node); break; case "mod": ParseMod(node); break; default: throw new XmlException("Unknown node " + node.Name + "."); } }*/ } catch { return null; } return _dataProvider; }
public void BindData(byte[] data, SerializerType serializerType) { string viewType; var encoding = new UTF8Encoding(false); switch (serializerType) { case SerializerType.Xml: case SerializerType.XmlDataContract: viewType = "xml"; _xmldocument = new XmlDocument(); _xmldocument.LoadXml(encoding.GetString(data, 0, data.Length)); var provider = new XmlDataProvider { Document = _xmldocument }; var binding = new Binding { Source = provider, XPath = "child::node()" }; XmlView.SetBinding(ItemsControl.ItemsSourceProperty, binding); break; case SerializerType.JsonDataContract: case SerializerType.JsonNewtonsoft: viewType = "json"; XmlView.SetBinding(ItemsControl.ItemsSourceProperty, new Binding()); JsonView.Text = encoding.GetString(data, 0, data.Length); break; default: viewType = "binary"; BinaryView.BindData(data); break; } foreach (TabItem item in ViewTabControl.Items) { var tag = item.Tag as string; Debug.Assert(!String.IsNullOrWhiteSpace(tag)); if (string.Compare(tag, viewType, StringComparison.OrdinalIgnoreCase) == 0) { ViewTabControl.SelectedItem = item; } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.projects = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.activityProject = ((System.Windows.Controls.ListBox)(target)); return; case 3: this.activityDescription = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.activityDate = ((System.Windows.Controls.DatePicker)(target)); return; case 5: this.activityDuration = ((System.Windows.Controls.ListBox)(target)); return; case 6: #line 51 "..\..\..\View\CreateActivity.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Close); #line default #line hidden return; case 7: #line 52 "..\..\..\View\CreateActivity.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Save); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpMovies = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.lbMovies = ((System.Windows.Controls.ListBox)(target)); return; case 3: this.btnAddNew = ((System.Windows.Controls.Button)(target)); #line 40 "..\..\Movies2.xaml" this.btnAddNew.Click += new System.Windows.RoutedEventHandler(this.btnAddNew_Click); #line default #line hidden return; case 4: this.btnDelete = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\Movies2.xaml" this.btnDelete.Click += new System.Windows.RoutedEventHandler(this.btnDelete_Click); #line default #line hidden return; case 5: this.btnSave = ((System.Windows.Controls.Button)(target)); #line 42 "..\..\Movies2.xaml" this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click); #line default #line hidden return; } this._contentLoaded = true; }
public MainWindowViewModel() { Locations = new LocationCollection(); TestContent = "Wahaha"; Locations.Add(new Location(0, 0)); Locations.Add(new Location(101, 110)); Locations.Add(new Location(390, 450)); Person person = new Person(); person.Name = "Steve Ballmer"; person.Image = new BitmapImage(new Uri("image/photo.png", UriKind.Relative)); Location loc = new Location(500, 583); loc.PersonInfo = person; Locations.Add(loc); string dataPath = Environment.CurrentDirectory; CallRecordData = new XmlDataProvider(); CallRecordData.Source = new Uri(dataPath + "/data/2013-03-16.xml"); CallRecordData.InitialLoad(); }
public bool AddGroup(string name) { if(AllTags.ContainsKey(name)) return false; AllTags.Add(name, new Dictionary<string, DataTagContainer>()); var filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) +name + ".xml"; var provider = new XmlDataProvider(); if (AllXMLFiles.ContainsKey(filePath)) return false; provider.Source = new Uri(filePath); AllXMLFiles.Add(filePath, provider); return true; }
public MainWindow() { InitializeComponent(); // Asetetaan XmlDataProviderin lähde App.Config:in mukaisesti. dataProvider = (Resources["Viinit"] as XmlDataProvider); string path = ConfigurationManager.AppSettings["fileLocation"]; // Jos tiedostoa ei ole olemassa, luodaan uusi. if (!File.Exists(path)) { dataProvider.Document = CreateNewDocument(); tbStatus.Text = "Tiedostoa " + path + " ei löytynyt. Luotiin uusi tiedosto."; } else { dataProvider.Source = new Uri(path); tbStatus.Text = "Viinit ladattu tiedostosta " + path; } }
private void deletecurrent_Click(object sender, System.Windows.RoutedEventArgs e) { //取当前选择行date属性值 string cell = this.datagrid1.Columns[0].GetCellContent(this.datagrid1.SelectedItem).GetValue(TextBlock.TextProperty).ToString(); System.Windows.Data.XmlDataProvider jiluy = this.FindResource("ExercisesDataSource") as XmlDataProvider; XmlNode selectnode = jiluy.Document.SelectSingleNode("exercises"); //xml文件的根结点 XmlNodeList nodelist = jiluy.Document.SelectSingleNode("exercises").ChildNodes; //获得xml文件根结点下的所有子节点 //遍历所有节点 foreach (XmlNode nodem in nodelist) { //转换xml文件抽象型节点为行元素型节点,便于行数据属性访问 XmlElement nodex = (XmlElement)nodem; if (nodex.GetAttribute("date") == cell) //如果节点date属性为选择项 { //移除满足条件节点 selectnode.RemoveChild(nodex); jiluy.Document.Save("xml/Exercises.xml"); this.deletecurrent.IsEnabled = false; } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpWines = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.btnGetWines = ((System.Windows.Controls.Button)(target)); #line 21 "..\..\MainWindow.xaml" this.btnGetWines.Click += new System.Windows.RoutedEventHandler(this.btnGetWines_Click); #line default #line hidden return; case 3: this.cboCountry = ((System.Windows.Controls.ComboBox)(target)); return; case 4: this.lblPath = ((System.Windows.Controls.TextBlock)(target)); return; case 5: this.lblInfo = ((System.Windows.Controls.TextBlock)(target)); return; case 6: this.grdWines = ((System.Windows.Controls.DataGrid)(target)); return; } this._contentLoaded = true; }
private void save_Click(object sender, System.Windows.RoutedEventArgs e) { System.Windows.Data.XmlDataProvider jiluy = this.FindResource("ExercisesDataSource") as XmlDataProvider; XmlNode selectnode = jiluy.Document.SelectSingleNode("exercises"); //xml文件的根节点 XmlElement newnode = jiluy.Document.CreateElement("exercise"); //设置节点名 DateTime datetime = DateTime.Now; newnode.SetAttribute("date", datetime.ToString("f")); //不显示秒 newnode.SetAttribute("danxuanti", MainWindow.mw.danxuanhjtext.Text); newnode.SetAttribute("xz1", MainWindow.mw.danxuanEnter.Text); newnode.SetAttribute("rt1", MainWindow.mw.danxuanRight.Text); newnode.SetAttribute("duoxuanti", MainWindow.mw.duoxuanhjtext.Text); newnode.SetAttribute("xz2", MainWindow.mw.danxuanEnter.Text); newnode.SetAttribute("rt2", MainWindow.mw.duoxuanRight.Text); newnode.SetAttribute("panduanti", MainWindow.mw.panduanhjtext.Text); newnode.SetAttribute("xz3", MainWindow.mw.panduanEnter.Text); newnode.SetAttribute("rt3", MainWindow.mw.panduanRight.Text); newnode.SetAttribute("zongfen", MainWindow.mw.zongfenhjtext.Text); newnode.SetAttribute("time", MainWindow.mw.Timertb.Text); selectnode.AppendChild(newnode); jiluy.Document.Save("xml/Exercises.xml"); System.Windows.MessageBox.Show("xml/Exercises.xml文件保存成功!"); this.deleteall.IsEnabled = true; }
public void LoadXmlDataProviders() { XMLDataProviderList.Clear(); TagCollection.ClearTags(); //required to flag the removal of the file from the list after the foreach block has finished enumerating. List<int> indexFlags = new List<int>(); foreach (string fn in Properties.Settings.Default.filePaths) { try { XmlDataProvider provider = new XmlDataProvider(); provider.Source = new Uri(fn); provider.XPath = "tags"; if(!XMLDataProviderList.Contains(provider)) XMLDataProviderList.Add(provider); TagCollection.LoadTags(fn); } catch (Exception ex) { MessageBox.Show(ex.Message); if (MessageBox.Show("File failed to load: " + fn + System.Environment.NewLine + " Remove from file List?", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) indexFlags.Add(XMLDataProviderList.IndexOf(XMLDataProviderList.Single(x => x.Source.LocalPath == fn))); } } foreach(int index in indexFlags) { XMLDataProviderList.RemoveAt(index); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.urlTextBox = ((System.Windows.Controls.TextBox)(target)); return; case 2: this.usernameTextBox = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.passwordTextbox = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.listDataXml = ((System.Windows.Data.XmlDataProvider)(target)); return; case 5: this.ScheduleListBox = ((System.Windows.Controls.ListBox)(target)); return; case 6: #line 72 "..\..\AddNewSchedule.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Plus_Button_Click); #line default #line hidden return; case 7: #line 75 "..\..\AddNewSchedule.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Minus_Button_Click); #line default #line hidden return; case 8: this.Hours = ((System.Windows.Controls.TextBox)(target)); return; case 9: this.Minutes = ((System.Windows.Controls.TextBox)(target)); return; case 10: this.amRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 11: this.pmRadio = ((System.Windows.Controls.RadioButton)(target)); return; case 12: #line 106 "..\..\AddNewSchedule.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Validate_Button_Click); #line default #line hidden return; case 13: #line 107 "..\..\AddNewSchedule.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Cancel_Button_Click); #line default #line hidden return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.xdpMovies = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.lbMovies = ((System.Windows.Controls.ListBox)(target)); return; case 3: this.txtName = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtDirector = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.txtCountry = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.chkChecked = ((System.Windows.Controls.CheckBox)(target)); return; case 7: this.btnCreate = ((System.Windows.Controls.Button)(target)); #line 40 "..\..\Movies2.xaml" this.btnCreate.Click += new System.Windows.RoutedEventHandler(this.btnCreate_Click); #line default #line hidden return; case 8: this.btnSave = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\Movies2.xaml" this.btnSave.Click += new System.Windows.RoutedEventHandler(this.btnSave_Click); #line default #line hidden return; case 9: this.btnDelete = ((System.Windows.Controls.Button)(target)); #line 42 "..\..\Movies2.xaml" this.btnDelete.Click += new System.Windows.RoutedEventHandler(this.btnDelete_Click); #line default #line hidden return; } this._contentLoaded = true; }
//动态设置数据绑定 private void SetBindingOfTreeView(string strSourceFileUri) { XmlDataProvider myXmlDataProvider = new XmlDataProvider(); myXmlDataProvider.Source = new Uri(strSourceFileUri); //myXmlDataProvider.XPath = "Ad-BAT";//必须为根节点 myXmlDataProvider.XPath = "Ad-BAT"; Binding newbinding = new Binding(); newbinding.Mode = BindingMode.OneWay; newbinding.Source = myXmlDataProvider; //newbinding.XPath = "PIDLIST";//第一级节点 newbinding.XPath = "PID"; RuleTree_tv.SetBinding(TreeView.ItemsSourceProperty, newbinding); //Binding ImageBinding = new Binding(); //ImageBinding.Mode = BindingMode.OneWay; //ImageBinding.Source = myXmlDataProvider; //newbinding.XPath = "PID"; //image3.Source = ICO.getICO("/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEh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6kAPlkeWhHVtowfw6/lWFpFq93cfapSdiH82/wDrU+XzNf1RmRBDbg54HCj/ABNaGotFpelyvC2xY4iFHqx6H65qFHmlc6JT5IKCPJdVCm7nYDkuSOfesiVu/IJroJ/KmOXth16g8/rWfLYxSIAoljAYkU3EhSMosNo56ml3AZ7ccVebS933JV/EVAdOukkY7UcHqFIFLlYORnMCTlc4oq3/AGZdkDMTAgYOKKOVhzI9ZciWI5OCaw4vOCFfNYlSQwbn+dXvLvo5gRFlCcFQeFHrUmki3h1cPeJugSbfKmMggcn61djK9zsvBmnNo9k2tX1sGuJci1HTCH+LvyR7Zxn1rH8R68s7Tq6qVZiQM5xzTte8aW2pkRIFjhAxGg4wK881TVM3CwBsu5Cpnpk8c1aaS0FZ31Oj8LzzDXptZQjFhGXJZsDcwKqD+efwNaGo61c6jMEuJHdjjknlvw7fSt7TNB0tPBtvAdRkuHdRK724UIHPQ7WBIOOPXjtWMtla2TFtpLKcrKeT25P/ANapcG0maQrRjdFhdRh0PTi9xF8oBYlGGWP0P0x1rhPE/i3+1LpGszMtui/dcgEtzzwTTfFernU5Ugh/1cOcnsxrl3G1S2wg+uc0m7aInd3ZppqrHIZckHuOtXraaOcfNhTnHWubSRTtIYc9QTirEDyK2M8Z4pczEzqVsYZV+bke44qQ6MhAI3AY49KxYLh4j82OT27VdivJV4MnG3oRVXRN2XhpRUYGKKpDUpAo6Nx1C5/lRT0FzG9calc2kLLG3BZCd2TyQeaJndNFubjeWllZVZj1wRnFFFTLYqG5y87FmRCflJ5FYepExXIZDhlIIPoRRRURNKm56El5PcJC7OVIiXGw7cZHtUOrapdQaTOivn5Bhj1GWCnn6GiinH4h1F7pzEiqd2RVZwDHyP4aKKTIRn6hGoVMD+CsR5ZIZCY3ZDnqpxRRVCRat9YvI2GZBIM5+cZ/XrXWWMhuLcTuAGYcgdKKKBMcV38k8/QUUUUxH//Z"); }
static Lang() { Provider = new XmlDataProvider { XPath = "LanguagesResource", IsAsynchronous = false }; IsRegistrated = false; }
private void bload_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofdialog = new OpenFileDialog(); ofdialog.CheckFileExists = true; ofdialog.Filter = "eXtensible Markup Language Files|*.xml"; ofdialog.Title = "Select XML playlist file !"; ofdialog.Multiselect = false; ofdialog.InitialDirectory = "U:\\stravos\\DOTNET\\wpf\\wpf"; ofdialog.ShowDialog(); try { XmlDocument doc = new XmlDocument(); doc.Load(ofdialog.FileName); XmlDataProvider prov = new XmlDataProvider(); prov.Document = doc; prov.XPath = "/songs/song"; plist.DataContext = prov; } catch (Exception ex) { } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.tabRetention = ((System.Windows.Controls.TabItem)(target)); return; case 2: this.dgRetention = ((System.Windows.Controls.DataGrid)(target)); return; case 3: this.retentionData = ((System.Windows.Data.XmlDataProvider)(target)); return; case 4: this.tabCompress = ((System.Windows.Controls.TabItem)(target)); return; case 5: this.tabSynch = ((System.Windows.Controls.TabItem)(target)); return; case 6: this.tabRemote = ((System.Windows.Controls.TabItem)(target)); return; case 7: this.tabLog = ((System.Windows.Controls.TabItem)(target)); return; } this._contentLoaded = true; }
public void init(string dir = null, string fileName = null) { if (dir != null) setDirectory(dir); if (fileName != null) setFileName(fileName); if (String.IsNullOrEmpty(_fileDirectory) || String.IsNullOrEmpty(_fileName)) { throw new Exception("File name or directory not set when writing XML"); } DataProvider = new XmlDataProvider(); DataProvider.Document = new XmlDocument(); if (File.Exists(FullFilePath)) DataProvider.Document.Load(FullFilePath); else { Document.AppendChild(Document.CreateXmlDeclaration("1.0", "utf-16", "yes")); Document.AppendChild(Document.CreateElement("tags")); DataProvider.Document.Save(FullFilePath); } DataProvider.Source = new Uri(FullFilePath); DataProvider.XPath = _rootName; DataTags = new ObservableCollection<DataTag>(); VirtualTags = new ObservableCollection<DataTag>(); reloadTags(); }
public MainScreen() { LogManager.WriteLog("MainScreen() (START)", LogManager.enumLogLevel.Info); GC.Collect(); InitializeComponent(); btn_Notifications.Visibility = Visibility.Collapsed; ActiveInstance = this; MessageBox.parentOwner = this; LicenseScreenActive = false; CheckAppLaucherStatus(); _loadView += new Action<string>(this.LoadView); _listSelectionChanged += new Action<object, SelectionChangedEventArgs>(this.ListBoxSelectionChanged); CPerformDrop.BusyPropertyChanged += new PropertyChangedEventHandler(propChangedEventHandler); CDeclaration.BusyPropertyChanged += new PropertyChangedEventHandler(propChangedEventHandler); _enableControls += new Action<bool>(this.EnableControls); ColorBrush(); IsMinimizeBtnEnabled = CheckMinimizeBtnEnabled(); if (!IsMinimizeBtnEnabled) { btnMinimize.Visibility = Visibility.Collapsed; } #if INBUILD_XML Uri xmlUri = new Uri("/XMLData/Menudata.xml", UriKind.Relative); if (string.Compare(((App)Application.Current).CurrentCultureName, "en-US", true) != 0) { xmlUri = new Uri("/XMLData/Menudata_" + ((App)Application.Current).CurrentCultureName + ".XML", UriKind.Relative); } var xmlDataProvider = new XmlDataProvider { Source = xmlUri, IsAsynchronous = false, XPath = "/Root/ImageList/Image" }; #else string baseUri = Path.GetDirectoryName(typeof(MainScreen).Assembly.Location); string xmlUri = Path.Combine(baseUri, "Menudata.xml"); if (string.Compare(((App)Application.Current).CurrentCultureName, "en-US", true) != 0) { xmlUri = Path.Combine(baseUri, "Menudata_" + ((App)Application.Current).CurrentCultureName + ".XML"); } XmlDocument doc = new XmlDocument(); doc.Load(xmlUri); var xmlDataProvider = new XmlDataProvider { Document = doc, IsAsynchronous = false, XPath = "/Root/ImageList/Image" }; #endif _exchangeConnectionString = oCommonUtilities.CreateInstance().GetConnectionString(); lstLeftPane.ItemsSource = xmlDataProvider.Data as IEnumerable; bool isThemeRequiered = false; //Boolean.TryParse(BMC.Common.ConfigurationManagement.ConfigManager.Read("ThemeRequiered"),out isThemeRequiered); //if (isThemeRequiered) // btnTheme.Visibility = Visibility.Visible; //else btnTheme.Visibility = Visibility.Collapsed; _bLogout = false; lblDate.Visibility = Visibility.Hidden; lblwelcome.Visibility = Visibility.Hidden; if (oCommonUtilities.CreateInstance().GetSiteDetails() != null) _site = oCommonUtilities.CreateInstance().GetSiteDetails().Tables[0]; if ((_site != null) && (_site.Rows.Count > 0)) { lblPropertyName.Content = _site.Rows[0]["Name"] + " - " + _site.Rows[0]["Code"]; Settings.SiteCode = _site.Rows[0]["Code"].ToString(); Settings.SiteName = _site.Rows[0]["Name"].ToString(); Settings.Site_Address_1 = _site.Rows[0]["Site_Address_1"].ToString(); Settings.Site_Address_2 = _site.Rows[0]["Site_Address_2"].ToString(); string str_Header = ""; if (Settings.PrintHeaderFormat != null && Settings.PrintHeaderFormat != string.Empty) { foreach (string s in Settings.PrintHeaderFormat.Split(new string[1] { ";" }, StringSplitOptions.RemoveEmptyEntries)) { if (_site.Rows[0][s] != null) { str_Header += _site.Rows[0][s] + " "; } } str_Header = str_Header.Remove(str_Header.Length - 1, 1); Settings.PrintHeaderFormat = str_Header; } else { Settings.PrintHeaderFormat = Settings.SiteName; } } int nTimeOutSeconds = Settings.AUTOLOGOFF_TIMEOUT; timerLogoff = new System.Windows.Forms.Timer { Interval = 1000, Enabled = true }; timerLogoff.Tick += (sender, e) => { if (IdleTime.Milliseconds <= nTimeOutSeconds) return; if (PromotionActiveElement != null || CDeclaration.IsBusy || CPerformDrop.IsBusy) { return; } timerLogoff.Stop(); if (TimerMessageBox.ShowBox() == "NO") { LogOffScreen(); } else timerLogoff.Start(); }; #if! FLOORVIEW_REFRESH_NEW App.siteLicensingClient.SendToServer(App.siteLicensingClientObj, null); App.siteLicensingClientObj.ClientReceived += new ClientReceivedEvent(clientObj_SiteLicensingClientReceived); #else this.InitClientSubscriber(); #endif _serviceDetails = new SortedDictionary<string, ServiceDetail>(StringComparer.InvariantCultureIgnoreCase); CheckForLicenseActivation(); LogManager.WriteLog("Timer Started for AutoLogoff", LogManager.enumLogLevel.Info); LogManager.WriteLog("MainScreen() (END)", LogManager.enumLogLevel.Info); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.batData = ((System.Windows.Data.XmlDataProvider)(target)); return; case 2: this.gridSplitter = ((System.Windows.Controls.GridSplitter)(target)); return; case 3: this.ButtonPanel = ((System.Windows.Controls.StackPanel)(target)); return; case 4: this.MoveUpRecordButton = ((System.Windows.Controls.Button)(target)); #line 58 "..\..\BatEditor.xaml" this.MoveUpRecordButton.Click += new System.Windows.RoutedEventHandler(this.MoveUpRecordButton_Click); #line default #line hidden return; case 5: this.MoveDownRecordButton = ((System.Windows.Controls.Button)(target)); #line 64 "..\..\BatEditor.xaml" this.MoveDownRecordButton.Click += new System.Windows.RoutedEventHandler(this.MoveDownRecordButton_Click); #line default #line hidden return; case 6: this.AddRecordButton = ((System.Windows.Controls.Button)(target)); #line 71 "..\..\BatEditor.xaml" this.AddRecordButton.Click += new System.Windows.RoutedEventHandler(this.AddRecordButton_Click); #line default #line hidden return; case 7: this.DelRecordButton = ((System.Windows.Controls.Button)(target)); #line 77 "..\..\BatEditor.xaml" this.DelRecordButton.Click += new System.Windows.RoutedEventHandler(this.DelRecordButton_Click); #line default #line hidden return; case 8: this.OKButton = ((System.Windows.Controls.Button)(target)); #line 84 "..\..\BatEditor.xaml" this.OKButton.Click += new System.Windows.RoutedEventHandler(this.OKButton_Click); #line default #line hidden return; case 9: this.CancelButton = ((System.Windows.Controls.Button)(target)); return; case 10: this.BatNameTagListBox = ((System.Windows.Controls.TextBox)(target)); return; case 11: this.BatNameListBox = ((System.Windows.Controls.ListBox)(target)); #line 98 "..\..\BatEditor.xaml" this.BatNameListBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.BatNameListBox_SelectionChanged); #line default #line hidden return; case 12: this.BatEditorGroupBox = ((System.Windows.Controls.GroupBox)(target)); return; case 13: this.BatDetailsStackPanel = ((System.Windows.Controls.StackPanel)(target)); return; case 14: this.BatDetailsWrapPanel = ((System.Windows.Controls.WrapPanel)(target)); return; case 15: this.PrefferredCommonNameLabel = ((System.Windows.Controls.Label)(target)); return; case 16: this.CommonNameUpButton = ((System.Windows.Controls.Button)(target)); #line 142 "..\..\BatEditor.xaml" this.CommonNameUpButton.Click += new System.Windows.RoutedEventHandler(this.CommonNameUpButton_Click); #line default #line hidden return; case 17: this.CommonNameDownButton = ((System.Windows.Controls.Button)(target)); #line 150 "..\..\BatEditor.xaml" this.CommonNameDownButton.Click += new System.Windows.RoutedEventHandler(this.CommonNameDownButton_Click); #line default #line hidden return; case 18: this.CommonNameAddButton = ((System.Windows.Controls.Button)(target)); #line 158 "..\..\BatEditor.xaml" this.CommonNameAddButton.Click += new System.Windows.RoutedEventHandler(this.CommonNameAddButton_Click); #line default #line hidden return; case 19: this.CommonNameDelButton = ((System.Windows.Controls.Button)(target)); #line 166 "..\..\BatEditor.xaml" this.CommonNameDelButton.Click += new System.Windows.RoutedEventHandler(this.CommonNameDelButton_Click); #line default #line hidden return; case 20: this.CommonNameEditBox = ((System.Windows.Controls.TextBox)(target)); #line 172 "..\..\BatEditor.xaml" this.CommonNameEditBox.LostFocus += new System.Windows.RoutedEventHandler(this.CommonNameEditBox_LostFocus); #line default #line hidden return; case 21: this.CommonNameListView = ((System.Windows.Controls.ListView)(target)); #line 180 "..\..\BatEditor.xaml" this.CommonNameListView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.CommonNameListView_SelectionChanged); #line default #line hidden return; case 22: this.GenusTextBlock = ((System.Windows.Controls.TextBox)(target)); #line 201 "..\..\BatEditor.xaml" this.GenusTextBlock.LostFocus += new System.Windows.RoutedEventHandler(this.GenusTextBlock_LostFocus); #line default #line hidden return; case 23: this.SpeciesTextBlock = ((System.Windows.Controls.TextBox)(target)); #line 215 "..\..\BatEditor.xaml" this.SpeciesTextBlock.LostFocus += new System.Windows.RoutedEventHandler(this.SpeciesTextBlock_LostFocus); #line default #line hidden return; case 24: this.TagUpButton = ((System.Windows.Controls.Button)(target)); #line 233 "..\..\BatEditor.xaml" this.TagUpButton.Click += new System.Windows.RoutedEventHandler(this.TagUpButton_Click); #line default #line hidden return; case 25: this.TagDownButton = ((System.Windows.Controls.Button)(target)); #line 241 "..\..\BatEditor.xaml" this.TagDownButton.Click += new System.Windows.RoutedEventHandler(this.TagDownButton_Click); #line default #line hidden return; case 26: this.TagAddButton = ((System.Windows.Controls.Button)(target)); #line 249 "..\..\BatEditor.xaml" this.TagAddButton.Click += new System.Windows.RoutedEventHandler(this.TagAddButton_Click); #line default #line hidden return; case 27: this.TagDelButton = ((System.Windows.Controls.Button)(target)); #line 257 "..\..\BatEditor.xaml" this.TagDelButton.Click += new System.Windows.RoutedEventHandler(this.TagDelButton_Click); #line default #line hidden return; case 28: this.IDTagEditBox = ((System.Windows.Controls.TextBox)(target)); #line 263 "..\..\BatEditor.xaml" this.IDTagEditBox.LostFocus += new System.Windows.RoutedEventHandler(this.IDTagEditBox_LostFocus); #line default #line hidden return; case 29: this.BatTagsListView = ((System.Windows.Controls.ListView)(target)); #line 270 "..\..\BatEditor.xaml" this.BatTagsListView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.BatTagsListView_SelectionChanged); #line default #line hidden return; } this._contentLoaded = true; }
internal XmlIslandSerializer(XmlDataProvider host) { _host = host; }