private int FetchElements(BrowseType browseType, int maxElements, UCOMIEnumString enumerator, ArrayList elements) { string[] rgelt = new string[1]; int celt = ((maxElements > 0) && ((maxElements - elements.Count) < rgelt.Length)) ? (maxElements - elements.Count) : rgelt.Length; int pceltFetched = 0; int num3 = enumerator.Next(celt, rgelt, out pceltFetched); while (num3 == 0) { for (int i = 0; i < pceltFetched; i++) { BrowseElement element = new BrowseElement { Name = rgelt[i], QualifiedName = this.GetQualifiedName(rgelt[i], browseType), NodeType = browseType }; elements.Add(element); } if ((maxElements > 0) && (elements.Count >= maxElements)) { return num3; } celt = ((maxElements > 0) && ((maxElements - elements.Count) < rgelt.Length)) ? (maxElements - elements.Count) : rgelt.Length; num3 = enumerator.Next(celt, rgelt, out pceltFetched); } return num3; }
public void BrowseAccessPaths(string p_ItemID, out UCOMIEnumString p_StringEnumerator) { object l_EnumTemp; m_IfBrowse.BrowseAccessPaths(p_ItemID, out l_EnumTemp); p_StringEnumerator = (UCOMIEnumString)l_EnumTemp; }
// Address of the IEnumString pointer variable that receives the interface // pointer to the enumeration object. If the method is unsuccessful, the // value of this output variable is undefined. /// <summary> /// This method creates another enumerator that contains the same enumeration state as the current one. /// Using this function, a client can record a particular point in the enumeration sequence and return to /// that point at a later time. The new enumerator supports the same interface as the original one. /// </summary> public void Clone( out UCOMIEnumString ppenum) { SourceCustomList clone = new SourceCustomList(); clone.currentPosition = currentPosition; clone.StringList = (String[])StringList.Clone(); ppenum = clone; }
public void BrowseAccessPaths(string itemID, out UCOMIEnumString stringEnumerator) { stringEnumerator = null; object enumtemp; ifBrowse.BrowseAccessPaths(itemID, out enumtemp); stringEnumerator = (UCOMIEnumString)enumtemp; enumtemp = null; }
public override void Dispose() { base.Dispose(); if (this.m_enumerator != null) { OpcCom.Interop.ReleaseServer(this.m_enumerator); this.m_enumerator = null; } }
/// <summary> /// This method creates another enumerator that contains the same enumeration state as the current one. /// Using this function, a client can record a particular point in the enumeration sequence and return to /// that point at a later time. The new enumerator supports the same interface as the original one. /// </summary> public void Clone( out UCOMIEnumString ppenum) // Address of the IEnumString pointer variable that receives the interface // pointer to the enumeration object. If the method is unsuccessful, the // value of this output variable is undefined. { SourceCustomList clone = new SourceCustomList(); clone.currentPosition = currentPosition; clone.StringList = (String[])StringList.Clone(); ppenum = clone; }
public void BrowseOPCItemIDs(OPCBROWSETYPE filterType, string filterCriteria, VarEnum dataTypeFilter, OPCACCESSRIGHTS accessRightsFilter, out UCOMIEnumString stringEnumerator) { stringEnumerator = null; object enumtemp; ifBrowse.BrowseOPCItemIDs(filterType, filterCriteria, (short)dataTypeFilter, accessRightsFilter, out enumtemp); stringEnumerator = (UCOMIEnumString)enumtemp; enumtemp = null; }
private void listItems(OPCBROWSETYPE type, out List <string> items, out List <string> paths) { string szFilter = ""; items = new List <string>(); paths = new List <string>(); int m_Res; m_Res = 0; object pIEnumString; m_Res = m_pIBrowse.BrowseOPCItemIDs(type, szFilter, (int)VarEnum.VT_EMPTY, 0, out pIEnumString); if (m_Res >= 0 && pIEnumString != null) { if (pIEnumString is UCOMIEnumString) { int celt = 1; string[] rgelt = new string[1]; int p_celtFetched = 0; UCOMIEnumString stringArray = (UCOMIEnumString)pIEnumString; stringArray.Reset(); int ret = stringArray.Next(celt, rgelt, out p_celtFetched); while (p_celtFetched > 0) { string path = getFullPath(rgelt[0]); items.Add(rgelt[0]); paths.Add(path); celt = 1; p_celtFetched = 0; stringArray.Next(celt, rgelt, out p_celtFetched); } } else { throw new Exception("Browser: IEnumString is not found."); } } else { throw new Exception("Browser: Enumeration Items error."); } }
public BrowseElement[] Browse(string areaID, BrowseType browseType, string browseFilter, int maxElements, out IBrowsePosition position) { position = null; lock (this) { if (base.m_server == null) { throw new NotConnectedException(); } this.InitializeBrowser(); this.ChangeBrowsePosition(areaID); UCOMIEnumString enumerator = (UCOMIEnumString) this.CreateEnumerator(browseType, browseFilter); ArrayList elements = new ArrayList(); if (this.FetchElements(browseType, maxElements, enumerator, elements) != 0) { OpcCom.Interop.ReleaseServer(enumerator); } else { position = new OpcCom.Ae.BrowsePosition(areaID, browseType, browseFilter, enumerator); } return (BrowseElement[]) elements.ToArray(typeof(BrowseElement)); } }
public BrowseElement[] BrowseNext(int maxElements, ref IBrowsePosition position) { lock (this) { if (base.m_server == null) { throw new NotConnectedException(); } if (position == null) { throw new ArgumentNullException("position"); } this.InitializeBrowser(); this.ChangeBrowsePosition(((OpcCom.Ae.BrowsePosition) position).AreaID); UCOMIEnumString enumerator = ((OpcCom.Ae.BrowsePosition) position).Enumerator; ArrayList elements = new ArrayList(); if (this.FetchElements(((OpcCom.Ae.BrowsePosition) position).BrowseType, maxElements, enumerator, elements) != 0) { position.Dispose(); position = null; } return (BrowseElement[]) elements.ToArray(typeof(BrowseElement)); } }
public void BrowseOPCItemIDs(OPCBrowseType p_FilterType, string p_FilterCriteria, VarEnum p_DataTypeFilter, OPCAccessRights p_AccessRightsFilter, out UCOMIEnumString p_StringEnumerator) { object l_EnumTemp; m_IfBrowse.BrowseOPCItemIDs(p_FilterType, p_FilterCriteria, (short)p_DataTypeFilter, p_AccessRightsFilter, out l_EnumTemp); p_StringEnumerator = (UCOMIEnumString)l_EnumTemp; }
public int GetZoneMappings(Interop.URLZONE dwZone, out UCOMIEnumString ppenumString, uint dwFlags) { ppenumString = null; return(Interop.INET_E_DEFAULT_ACTION); }
public void BrowseOPCItemIDs( OPCBROWSETYPE filterType, string filterCriteria, VarEnum dataTypeFilter, OPCACCESSRIGHTS accessRightsFilter, out UCOMIEnumString stringEnumerator) { stringEnumerator = null; object enumtemp; ifBrowse.BrowseOPCItemIDs( filterType, filterCriteria, (short) dataTypeFilter, accessRightsFilter, out enumtemp ); stringEnumerator = (UCOMIEnumString) enumtemp; enumtemp = null; }
public void BrowseAccessPaths( string itemID, out UCOMIEnumString stringEnumerator ) { stringEnumerator = null; object enumtemp; ifBrowse.BrowseAccessPaths( itemID, out enumtemp ); stringEnumerator = (UCOMIEnumString) enumtemp; enumtemp = null; }
public BrowsePosition(string areaID, BrowseType browseType, string browseFilter, UCOMIEnumString enumerator) : base(areaID, browseType, browseFilter) { this.m_enumerator = null; this.m_enumerator = enumerator; }