Esempio n. 1
0
        private EnumString GetEnumerator(string itemID, BrowseFilters filters, bool branches, bool flat)
        {
            IOPCBrowseServerAddressSpace iOPCBrowseServerAddressSpace = (IOPCBrowseServerAddressSpace)m_server;

            if (!flat)
            {
                string text = (itemID != null) ? itemID : "";
                try
                {
                    iOPCBrowseServerAddressSpace.ChangeBrowsePosition(OPCBROWSEDIRECTION.OPC_BROWSE_TO, text);
                }
                catch
                {
                    try
                    {
                        iOPCBrowseServerAddressSpace.ChangeBrowsePosition(OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, text);
                    }
                    catch
                    {
                        try
                        {
                            while (true)
                            {
                                iOPCBrowseServerAddressSpace.ChangeBrowsePosition(OPCBROWSEDIRECTION.OPC_BROWSE_UP, string.Empty);
                            }
                        }
                        catch
                        {
                        }

                        string[] array = null;
                        lock (m_separatorsLock)
                        {
                            array = ((m_separators == null) ? text.Split(m_separators) : text.Split(m_separators));
                        }

                        for (int i = 0; i < array.Length; i++)
                        {
                            if (array[i] != null && array[i].Length != 0)
                            {
                                try
                                {
                                    iOPCBrowseServerAddressSpace.ChangeBrowsePosition(OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, array[i]);
                                }
                                catch
                                {
                                    throw new ResultIDException(ResultID.Da.E_UNKNOWN_ITEM_NAME, "Cannot browse because the server is not compliant because it does not support the BROWSE_TO function.");
                                }
                            }
                        }
                    }
                }
            }

            try
            {
                IEnumString   ppIEnumString      = null;
                OPCBROWSETYPE dwBrowseFilterType = branches ? OPCBROWSETYPE.OPC_BRANCH : OPCBROWSETYPE.OPC_LEAF;
                if (flat)
                {
                    dwBrowseFilterType = OPCBROWSETYPE.OPC_FLAT;
                }

                iOPCBrowseServerAddressSpace.BrowseOPCItemIDs(dwBrowseFilterType, (filters.ElementNameFilter != null) ? filters.ElementNameFilter : "", 0, 0, out ppIEnumString);
                return(new EnumString(ppIEnumString));
            }
            catch
            {
                throw new ResultIDException(ResultID.Da.E_UNKNOWN_ITEM_NAME);
            }
        }
Esempio n. 2
0
            private List <string> GetOptionIdsImpl()
            {
                IEnumString optionIds = _speller.Value.OptionIds;

                return((optionIds != null) ? optionIds.ToList(false, true) : null);
            }
Esempio n. 3
0
            public void BrowseOPCItemIDs(OPCBROWSETYPE dwBrowseFilterType, string szFilterCriteria, short vtDataTypeFilter, int dwAccessRightsFilter, out IEnumString ppIEnumString)
            {
                var methodName = nameof(IOPCBrowseServerAddressSpace) + "." + nameof(IOPCBrowseServerAddressSpace.BrowseOPCItemIDs);

                try
                {
                    var server = BeginComCall <IOPCBrowseServerAddressSpace>(methodName, true);
                    server.BrowseOPCItemIDs(dwBrowseFilterType, szFilterCriteria, vtDataTypeFilter, dwAccessRightsFilter, out ppIEnumString);
                }
                finally
                {
                    EndComCall(methodName);
                }
            }
 int WebBrowserAPI.IInternetSecurityManager.GetZoneMappings(int dwZone, ref IEnumString ppenumstring, int dwFlags)
 {
     ppenumstring = null;
     return WebBrowserAPI.INET_E_DEFAULT_ACTION;
 }
Esempio n. 5
0
 public ComStringEnumerator(IntPtr ptrToIEnumString)
 {
     this.enumString = (IEnumString)Marshal.GetTypedObjectForIUnknown(ptrToIEnumString, typeof(IEnumString));
 }
 public virtual int GetZoneMappings(int dwZone, out IEnumString ppenumString, int dwFlags)
 {
     ppenumString = null;
     return INET_E.DEFAULT_ACTION;
 }
 void IEnumString.Clone(out IEnumString ppenum)
 {
     ppenum = new StringSource(this.strings);
 }
Esempio n. 8
0
 public void BrowseAccessPaths(string szItemID, out IEnumString pIEnumString)
 {
     var methodName = nameof(IOPCBrowseServerAddressSpace) + "." + nameof(IOPCBrowseServerAddressSpace.BrowseAccessPaths);
     try
     {
         var server = BeginComCall<IOPCBrowseServerAddressSpace>(methodName, true);
         server.BrowseAccessPaths(szItemID, out pIEnumString);
     }
     finally
     {
         EndComCall(methodName);
     }
 }
Esempio n. 9
0
 public void BrowseOPCItemIDs(OPCBROWSETYPE dwBrowseFilterType, string szFilterCriteria, short vtDataTypeFilter, int dwAccessRightsFilter, out IEnumString ppIEnumString)
 {
     var methodName = nameof(IOPCBrowseServerAddressSpace) + "." + nameof(IOPCBrowseServerAddressSpace.BrowseOPCItemIDs);
     try
     {
         var server = BeginComCall<IOPCBrowseServerAddressSpace>(methodName, true);
         server.BrowseOPCItemIDs(dwBrowseFilterType, szFilterCriteria, vtDataTypeFilter, dwAccessRightsFilter, out ppIEnumString);
     }
     finally
     {
         EndComCall(methodName);
     }
 }
Esempio n. 10
0
 public void EnumObjectParam(out IEnumString ppenum)
 {
     _object.EnumObjectParam(out ppenum);
 }
Esempio n. 11
0
 public void Clone(out IEnumString ppenum)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 12
0
 public int Clone(out IEnumString ppenum)
 {
     throw new NotImplementedException();
 }
Esempio n. 13
0
 public void Clone(out IEnumString ppenum)
 {
     ppenum = new EnumString(strings);
 }
		public void Clone(out IEnumString ppenum)
		{
			ppenum = null;
		}
Esempio n. 15
0
 void IEnumString.Clone(out IEnumString ppenum)
 {
     ppenum = new StringSource(strings);
 }
Esempio n. 16
0
 int COM.IInternetSecurityManager.GetZoneMappings(int dwZone, out IEnumString  ppenumString, int dwFlags)
 {
     ppenumString = null;
     return COM.INET_E_DEFAULT_ACTION;
 }
Esempio n. 17
0
 /// <summary>
 /// Initializes the object with an enumerator.
 /// </summary>
 public EnumString(object enumerator)
 {
     m_enumerator = (IEnumString)enumerator;
 }
Esempio n. 18
0
 public void GetEnumerator(out IEnumString ppIEnumString)
 {
     Log.Error("MetadataEnumerator.GetEnumerator called");
     throw new NotImplementedException();
 }
Esempio n. 19
0
 public int GetZoneMappings(int dwZone, out IEnumString ppenumString, int dwFlags)
 {
     return SecurityManager.GetZoneMappings(dwZone, out ppenumString, dwFlags);
 }
Esempio n. 20
0
 /// <summary>
 /// Releases the remote COM object.
 /// </summary>
 public void Dispose()
 {
     Utilities.Interop.ReleaseServer(m_enumerator);
     m_enumerator = null;
 }
Esempio n. 21
0
 int IInternetSecurityManager.GetZoneMappings(uint dwZone, out IEnumString ppenumString, uint dwFlags)
 {
     ppenumString = null;
     return (int)WinInetErrors.INET_E_DEFAULT_ACTION;
 }
Esempio n. 22
0
            private static int Skip(IntPtr thisPtr, int celt)
            {
                IEnumString inst = ComInterfaceDispatch.GetInstance <IEnumString>((ComInterfaceDispatch *)thisPtr);

                return(inst.Skip(celt));
            }
Esempio n. 23
0
 public int GetZoneMappings(int dwZone, ref IEnumString ppenumString, int dwFlags)
 {
     ppenumString = null;
     return WebBrowserAPI.INET_E_DEFAULT_ACTION;
 }
Esempio n. 24
0
 int WebBrowserAPI.IInternetSecurityManager.GetZoneMappings(int dwZone, ref IEnumString ppenumstring, int dwFlags)
 {
     ppenumstring = null;
     return(WebBrowserAPI.INET_E_DEFAULT_ACTION);
 }