void LoadTreeView() { StandardLoader loader = new StandardLoader(); //LYTunnelStandard = loader.GetStandard("LYTunnel"); LYTunnelTreeview.DataContext = new TreeViewData(LYTunnelStandard); }
/// <summary> /// Returns the test suite from a given class. /// </summary> /// <remarks> /// The assemblyQualifiedName parameter needs to be in form: /// "full.qualified.class.name,Assembly" /// </remarks> private ITest GetSuite(string assemblyQualifiedName) { // Don't worry about catching exceptions in this method. The // NUnitTask will catch them and throw a BuildException back to // NAnt with the correct location in the build file. [gs] StandardLoader loader = new StandardLoader(); ITest test = loader.LoadTest(assemblyQualifiedName); return(test); }
private void LoadStandard(string StandardName) { StandardName = StandardName ?? "Geology"; IDSImporter importer = new StandardImport_Exl(); if (importer.Import(StandardName) != null) { StandardLoader standardLoader = new StandardLoader(); Standard = standardLoader.GetStandard(StandardName); System.Windows.MessageBox.Show(StandardName + " Standard imported succeessfully"); filter = standardLoader.CreateFilter(); ReloadWindow(); } }
/// <summary> /// load Data /// </summary> public void Load() { IDSImporter importer = new StandardImport_Exl(); if (importer.Import("Geology") != null) { System.Windows.MessageBox.Show("Standard import succeeded"); } StandardLoader standardLoader = new StandardLoader(); Standard = standardLoader.GetStandard(); filter = standardLoader.CreateFilter(); TunnelTypeCB.ItemsSource = filter.Tunnels; TunnelTypeCB.SelectedIndex = 0; ShowEmptyData(); //ClassGenerator generator = new ClassGenerator(); //generator.GenerateClass(Standard); }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { //step1 : find the aim object def string aimDGObjectType = "Borehole"; StandardLoader loader = new StandardLoader();//get standard from local json file in debug catagory //IDSImporter idsImporter = null; //DataStandardDef def = idsImporter.Import(null); DataStandardDef standard = loader.getStandard(); IDSExporter exporter = new Exporter_For_JSON(); exporter.Export(standard, AppDomain.CurrentDomain.BaseDirectory);//输出 DGObjectDef aimDGObjectDef = standard.getDGObjectDefByCode(aimDGObjectType); //step2 : create a instance of dataSchema for data importer DataSchema dataSchema = new DataSchema(); //step3 : choose the type of data source and convert to the commonDataFormat dataSchema.dataFormatConverter = null; CommonDataFormat rawCDF = dataSchema.dataFormatConverter.Convert(null); //setp4 : choose the mapping rule between the commonDataFormat and aimDGObjectDef dataSchema.dataPropertyMapping = new CommonPropertyMapping(); CommonDataFormat mappingCDF = dataSchema.dataPropertyMapping.Mapping(rawCDF); //step5 : verify the data dataSchema.dataVerification = new CommonDataVerification(); CommonDataFormat verificationCDF = dataSchema.dataVerification.Verification(mappingCDF); //step6 : set the data access frequency, such as one time access, access at a time, realtime access ,push access //------- //setp7 : save the data //step8 : exporter the data }
/// <summary> /// Returns the test suite from a given class. /// </summary> /// <remarks> /// The assemblyQualifiedName parameter needs to be in form: /// "full.qualified.class.name,Assembly" /// </remarks> private ITest GetSuite(string assemblyQualifiedName) { // Don't worry about catching exceptions in this method. The // NUnitTask will catch them and throw a BuildException back to // NAnt with the correct location in the build file. [gs] StandardLoader loader = new StandardLoader(); ITest test = loader.LoadTest(assemblyQualifiedName); return test; }
// Runtime constructor public LandClassScatterLoader(PQSLandControl.LandClassScatter value) { Value = value; if (CustomMaterial) { if (NormalDiffuse.UsesSameShader(CustomMaterial)) { CustomMaterial = new NormalDiffuseLoader(CustomMaterial); } else if (NormalBumped.UsesSameShader(CustomMaterial)) { CustomMaterial = new NormalBumpedLoader(CustomMaterial); } else if (NormalDiffuseDetail.UsesSameShader(CustomMaterial)) { CustomMaterial = new NormalDiffuseDetailLoader(CustomMaterial); } else if (DiffuseWrap.UsesSameShader(CustomMaterial)) { CustomMaterial = new DiffuseWrapLoader(CustomMaterial); } else if (AlphaTestDiffuse.UsesSameShader(CustomMaterial)) { CustomMaterial = new AlphaTestDiffuseLoader(CustomMaterial); } else if (AerialTransCutout.UsesSameShader(CustomMaterial)) { CustomMaterial = new AerialTransCutoutLoader(CustomMaterial); } else if (Standard.UsesSameShader(CustomMaterial)) { CustomMaterial = new StandardLoader(CustomMaterial); } } // Get the Scatter-Parent GameObject scatterParent = typeof(PQSLandControl.LandClassScatter) .GetFields(BindingFlags.Instance | BindingFlags.NonPublic) .FirstOrDefault(f => f.FieldType == typeof(GameObject))?.GetValue(Value) as GameObject; // If the GameObject is null, create one if (scatterParent == null) { scatterParent = new GameObject("Scatter"); scatterParent.transform.parent = Utility.Deactivator; } // Add the scatter module Scatter = scatterParent.AddOrGetComponent <ModularScatter>(); Scatter.scatter = Value; // Create the Component callback Components = new CallbackList <ComponentLoader <ModularScatter> >(e => { Scatter.Components = Components.Select(c => c.Value).ToList(); }); // Load existing Modules foreach (IComponent <ModularScatter> component in Scatter.Components) { Type componentType = component.GetType(); Type componentLoaderType = typeof(ComponentLoader <>).MakeGenericType(Value.GetType(), componentType); foreach (Type loaderType in Parser.ModTypes) { if (!componentLoaderType.IsAssignableFrom(loaderType)) { continue; } // We found our loader type ComponentLoader <ModularScatter> loader = (ComponentLoader <ModularScatter>)Activator.CreateInstance(loaderType); loader.Create(component); Components.Add(loader); } } }