public RuleGeneratedData(MapReferences aMap) { Result = aMap; InitializeComponent(); LoadObjectToTree(); mppedObjectsTree.Nodes[0].Expand(); }
private void projectView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Parent == null) { return; } string clicked = e.Node.Parent.Text.Trim(); if (clicked.Equals("Assemblies")) { SampleAssembly = (AssemblyDescriptor)e.Node.Tag; UIServices.AssemblyUtilities.LoadAssemblyToList(SampleAssembly.Assembly, lstVwAssemblies); } else if (clicked.Equals("Mapped Objects")) { MapReferences select = (MapReferences)e.Node.Tag; ctxMapForMethods.DropDownItems.Clear(); ctxDataForMethods.DropDownItems.Clear(); foreach (MethodParameterMap aMap in select.ViableInfo.TheMap.MethodParameters) { string method = Parameters.FormParameterMethod(aMap); var aMenuItem = ctxMapForMethods.DropDownItems.Add(method); aMenuItem.Click += mnuMapWindow_Click; aMenuItem.Tag = aMap; aMenuItem = ctxDataForMethods.DropDownItems.Add(method); aMenuItem.Click += mnuQueryWindow_Click; aMenuItem.Tag = aMap; } } }
private void mnuRandomGenerated_Click(object sender, EventArgs e) { if (projectView.SelectedNode != null && projectView.SelectedNode.Parent.Text.Trim().Equals("Mapped Objects")) { MapReferences maps = (MapReferences)projectView.SelectedNode.Tag; RuleGeneratedData ruleDataGen = new RuleGeneratedData(maps); if (ruleDataGen.ShowDialog() == DialogResult.OK) { } } }
private void ctxLoadMap_Click(object sender, EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.Filter = "References |*.ref"; if (openFile.ShowDialog() == DialogResult.OK) { MapReferences newRef = new MapReferences(); newRef.ReferenceInfo = ReadReferenceFiles.ReadFile(openFile.FileName); newRef.ViableInfo = ReadReferenceFiles.LoadMap(newRef.ReferenceInfo.RefreshFile); Mapped.LoadReferencesToTree(projectView, newRef, ctxTreeMenu); } }
private void mnuMapWindow_Click(object sender, EventArgs e) { try { if (projectView.SelectedNode.Parent.Text.Trim().Equals("Mapped Objects")) { ToolStripMenuItem sentIt = (ToolStripMenuItem)sender; MapReferences aRef = (MapReferences)projectView.SelectedNode.Tag; Tuple <String, int> parsed = ParseTextLabel(sentIt.Text); BaseStore store = null; Guid mapGuid = Guid.Empty; aRef.LastMap = ConvertMenuToMapType(parsed.Item1); currentMode = aRef.LastMap; if (aRef.LastMap == DataMapType.MethodParameterMap) { aRef.LastMethodMap = (MethodParameterMap)sentIt.Tag; mapGuid = aRef.LastMethodMap.ID; store = MapManager.FindStore(aRef.LastMethodMap.MethodName, mapGuid, aRef.ReferenceInfo); } else { store = MapManager.FindStore(aRef.LastMap.ToString(), mapGuid, aRef.ReferenceInfo); } UIMapper autoMapIt = null; if (store != null && store.GetType().Equals(typeof(RuleStore))) { autoMapIt = new UIMapper(aRef.ViableInfo.TheMap, ((RuleStore)store).Rules, aRef.LastMethodMap, currentMode); } else { autoMapIt = new UIMapper(aRef.ViableInfo.TheMap, aRef.LastMethodMap, currentMode); } //autoMapIt.AutoMap = true; if (autoMapIt.ShowDialog() == DialogResult.OK) { aRef.ViableInfo.TheMap = UIMapper.Result; if (store.GetType().Equals(typeof(RuleStore))) { ((RuleStore)store).Rules = UIMapper.RuleSets; } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void mnuQueryWindow_Click(object sender, EventArgs e) { if (projectView.SelectedNode.Parent.Text.Trim().Equals("Mapped Objects")) { if (aDataObject != null) { dgTableView.Tag = null; MapReferences aRef = (MapReferences)projectView.SelectedNode.Tag; ToolStripMenuItem sentIt = (ToolStripMenuItem)sender; Tuple <String, int> parsed = ParseTextLabel(sentIt.Text); aRef.LastMap = ConvertMenuToMapType(parsed.Item1); currentMode = aRef.LastMap; //aRef.MethodName = parsed.Item1; if (viewSql == null || viewSql.IsDisposed) { viewSql = new Thyme.UI(aDataObject); this.AddOwnedForm(viewSql); viewSql.Show(); } else { viewSql.ApplyDataObject(aDataObject); viewSql.WindowState = FormWindowState.Maximized; } ReturnData editing = new ReturnData(); string storeName = String.Empty; Guid mapGuid = Guid.Empty; if (aRef.LastMap == DataMapType.MethodParameterMap) { aRef.LastMethodMap = (MethodParameterMap)sentIt.Tag; mapGuid = aRef.LastMethodMap.ID; editing.QueryResult = MapManager.FindQueryInfo(aRef.ViableInfo.StoredData, aRef.LastMethodMap.MethodName, currentMode, mapGuid, out storeName); } else { editing.QueryResult = MapManager.FindQueryInfo(aRef.ViableInfo.StoredData, null, currentMode, Guid.Empty, out storeName); } editing.SQLText = MapManager.GetSQL(storeName, mapGuid, aRef.ReferenceInfo); viewSql.SetEditData(editing); } else { MessageBox.Show("Select a database to connect to.", "Problem!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void SaveMapNode() { SaveFileDialog saveFile = new SaveFileDialog(); saveFile.AddExtension = true; saveFile.Filter = "References |*.ref"; saveFile.FileName = projectView.SelectedNode.Text.Trim(); if (saveFile.ShowDialog() == DialogResult.OK) { MapReferences aRef = (MapReferences)projectView.SelectedNode.Tag; aRef.ReferenceInfo.RefreshFile = saveFile.FileName.Replace(".ref", ".all"); Store.StoreMapAndData(aRef.ReferenceInfo, saveFile.FileName); Store.StoreMapAndData(aRef.ViableInfo, aRef.ReferenceInfo.RefreshFile); } }
void SetupReferences() { MapReferences spriteLocation = Map.instance.GetComponent <MapReferences>(); m_TilePrefab = spriteLocation.m_TilePrefab; m_WallPrefab = spriteLocation.m_WallPrefab; m_WallSpriteListT1 = spriteLocation.m_WallSpriteListT1; m_WallSpriteListT2 = spriteLocation.m_WallSpriteListT2; m_WallSpriteListT3 = spriteLocation.m_WallSpriteListT3; m_ShopWallPrefab = spriteLocation.m_ShopWallPrefab; //KeyValuePair<int, int> shoopCoordinates = Map.instance.GetCoordinates("Shop"); //m_ShopX = shoopCoordinates.Key; //m_ShopY = shoopCoordinates.Value; }
private void ctxCreateLoadTemplate_Click(object sender, EventArgs e) { SaveFileDialog saveFile = new SaveFileDialog(); saveFile.Filter = "Text | *.txt"; if (saveFile.ShowDialog() == DialogResult.OK) { MapReferences aRef = (MapReferences)projectView.SelectedNode.Tag; if (aRef.ViableInfo.TheMap.MethodParameters.Count == 0) { Store.SaveTextOutput(OutputTemplate.CreateTemplateNoParams(aRef.ViableInfo), saveFile.FileName); } else { Store.SaveTextOutput(OutputTemplate.CreateTemplateParams(aRef.ViableInfo), saveFile.FileName); } } }
public static void LoadReferencesToTree(TreeView projectView, MapReferences newRef, ContextMenuStrip mapMenu) { MapReferences pseudoRef = null; if (!FindMap(projectView, newRef.ViableInfo.TheMap.ClassName, out pseudoRef)) { TreeNode aNode = projectView.Nodes[0].Nodes[3].Nodes.Add(NameSpaceManager.RemoveNameSpace(newRef.ViableInfo.TheMap.ClassName)); aNode.Tag = newRef; aNode.ToolTipText = newRef.ViableInfo.TheMap.ClassName; aNode.ContextMenuStrip = mapMenu; projectView.SelectedNode = aNode; } else { projectView.SelectedNode.Tag = newRef; projectView.SelectedNode.ToolTipText = newRef.ViableInfo.TheMap.ClassName; } }
public static bool FindMap(TreeView projectView, string className, out MapReferences refInfo) { bool result = false; refInfo = null; foreach (TreeNode aNode in projectView.Nodes[0].Nodes[3].Nodes) { if (aNode.ToolTipText.Trim().Equals(className)) { refInfo = (MapReferences)aNode.Tag; projectView.SelectedNode = aNode; result = true; break; } } return(result); }
private void ApplyField(UIMapper aMapper) { if (aMapper != null && aMapper.ShowDialog() == DialogResult.OK) { MapReferences mapRef = Mapped.LoadMapToTree(projectView, UIMapper.Result, ctxTreeMenu); mapRef.LastMap = currentMode; mapRef.LastMethodMap = aMapper.MethodMap; if (UIMapper.RuleSets.Count > 0) { string storeName = currentMode.ToString(); Guid anId = Guid.Empty; if (currentMode == DataMapType.MethodParameterMap) { anId = aMapper.MethodMap.ID; storeName = mapRef.LastMethodMap.MethodName; } MapManager.FindRuleAndUpdate(storeName, mapRef.ReferenceInfo, UIMapper.RuleSets, currentMode, anId); } } }
public static MapReferences LoadMapToTree(TreeView projectView, MapedObject aMap, ContextMenuStrip mapMenu) { MapReferences newRef = null; if (!FindMap(projectView, aMap.ClassName, out newRef)) { newRef = new MapReferences(); newRef.ViableInfo = new ViableMapAndData(); newRef.ViableInfo.TheMap = aMap; TreeNode aNode = projectView.Nodes[0].Nodes[3].Nodes.Add(NameSpaceManager.RemoveNameSpace(aMap.ClassName)); aNode.Tag = newRef; aNode.ToolTipText = aMap.ClassName; aNode.ContextMenuStrip = mapMenu; projectView.SelectedNode = aNode; } return(newRef); }
public static bool LoadDataTableToMapNode(TreeView projectView, String className, ReturnData data, DataMapType mode) { MapReferences newRef = null; if (!FindMap(projectView, className, out newRef)) { return(false); } Guid anId = Guid.Empty; string methodName = mode.ToString(); if (mode == DataMapType.MethodParameterMap) { methodName = newRef.LastMethodMap.MethodName; anId = newRef.LastMethodMap.ID; } if (MapManager.FindStoreAndUpdate(newRef.ViableInfo.StoredData, mode, methodName, data.QueryResult, anId)) { MapManager.FindSQLAndUpdate(methodName, anId, data.QueryResult.Columns.Count, newRef.ReferenceInfo, data.SQLText); } return(true); }