public CCCFiller(IntPtr container) { treeView = null; _data = new Hashtable(); //this.ReadData(@"..\..\..\演示数据\3cData.xlsx"); //_fillParameters = this.ReadFillParameter(@"..\..\..\演示数据\CCC\CCC填报规则.xlsx"); this.container = container; }
/// <summary> /// 初始化3C填报管理器。 /// </summary> /// <param name="processId">CCC进程Id。</param> /// <param name="dataFile">数据文件路径。</param> /// <param name="ruleFilePath">填报规则所在文件夹。</param> private CCCFillManager(uint processId, string dataFile, string ruleFilePath) : base(dataFile, ruleFilePath) { base.FillType = "CCC"; treeView = null; _data = new Hashtable(); this.processId = processId; _records = new List <FillRecord>(); _records.Add(new FillRecord(ElementType.Unknown, RecordType.Success)); this.DataProvider = new Default3CDataProvider(); }
private Main_3C(IntPtr hwnd, string dataFile, uint processId) { DataFile = dataFile; _handle = hwnd; _selectedNode = IntPtr.Zero; _keyRelation = new List <KeyValuePair <string, object> >(); _treeView = null; this.processId = processId; hProcess = NativeApi.OpenProcess(0x1FFFFF, false, this.processId); processAddr = NativeApi.VirtualAllocEx(hProcess, IntPtr.Zero, 4096, NativeApi.MEM_COMMIT, NativeApi.PAGE_READWRITE); _asyncHandle = new FillAsyncHandler(); this.GetTreeView(); #if export sheet = null; writer = null; #endif }
private void GetTreeView() { treeView = main.TreeView; FillDialog_3C dialog = null; dialog = FillDialog_3C.GetFillDialog(CCCWindowType.PropertyWindow, main, this.processId); string category = _data["车辆类别"] == null ? "" : (_data["车辆类别"] as FillValue3C).Value; string property = _data["车辆属性"] == null ? "" : (_data["车辆属性"] as FillValue3C).Value; dialog.DoFillWork(new string[] { category, property }); dialog = FillDialog_3C.GetFillDialog(CCCWindowType.InputFileNameWindow, main, this.processId); dialog.DoFillWork(new FillValue3C() { Value = Guid.NewGuid().ToString() }); uint count = 0; while (count == 0) { count = treeView.GetCount(); System.Threading.Thread.Sleep(500); } }
/// <summary> /// 获取当前窗体中的TreeView控件。 /// </summary> /// <returns></returns> public SysTreeView GetTreeView() { IntPtr treeView = IntPtr.Zero; StringBuilder className = new StringBuilder(256); NativeApi.EnumChildWindows(_handle, (handle, lParam) => { className.Clear(); NativeApi.GetClassName(handle, className, 255); string str = className.ToString(); if (str.StartsWith(CCCFillManager.TreeViewClassName)) { treeView = handle; } if (treeView != IntPtr.Zero) { return(false); } return(true); }, IntPtr.Zero); _treeView = treeView == IntPtr.Zero ? null : new SysTreeView(treeView); return(_treeView); }