void m_ImportLayout_Click(object sender, RoutedEventArgs e) { ObjectLoadDialog dlg = new ObjectLoadDialog(GetStorageManager()) { ContentType = StorageContentTypes.ValueCopySettings }; dlg.DialogOk += new EventHandler(LoadDialog_DialogOk); dlg.LogManager = LogManager; dlg.Show(); }
void m_ImportButton_Click(object sender, RoutedEventArgs e) { ObjectLoadDialog dlg = new ObjectLoadDialog(StorageManager) { ContentType = StorageContentTypes.CustomCellStyles }; dlg.DialogOk += new EventHandler(LoadDialog_DialogOk); dlg.LogManager = LogManager; dlg.Show(); }
void LoadDialog_DialogOk(object sender, EventArgs e) { ObjectLoadDialog dlg = sender as ObjectLoadDialog; if (dlg == null) { return; } if (dlg.CurrentObject != null && !String.IsNullOrEmpty(dlg.CurrentObject.ContentFileName)) { StorageActionArgs args = new StorageActionArgs(); args.ActionType = StorageActionTypes.Load; args.ContentType = StorageContentTypes.ValueCopySettings; args.FileDescription = dlg.CurrentObject; StorageManager.Invoke(XmlSerializationUtility.Obj2XmlStr(args, Common.Namespace), args); } }
void LoadDialog_DialogOk(object sender, EventArgs e) { ObjectLoadDialog dlg = sender as ObjectLoadDialog; if (dlg == null) { return; } if (dlg.CurrentObject != null && !String.IsNullOrEmpty(dlg.CurrentObject.ContentFileName)) { EventHandler <CustomEventArgs <ObjectStorageFileDescription> > handler = LoadStyles; if (handler != null) { handler(this, new CustomEventArgs <ObjectStorageFileDescription>(dlg.CurrentObject)); } } }