Beispiel #1
0
 /// <summary>
 ///     Selects all items in the <see cref="ShellView" />.
 /// </summary>
 public void SelectAll()
 {
     foreach (var item in ShellItem)
     {
         ComInterface.SelectItem(Shell32.ILFindLastID(item.Pidl), SVSI.SVSI_SELECT);
     }
 }
Beispiel #2
0
        private bool COM_Attribute_Check(SFGAO Check)
        {
            SFGAO sfgao;

            ComInterface.GetAttributes(Check, out sfgao);
            return((sfgao & Check) != 0);
        }
Beispiel #3
0
        /// <summary>
        ///     Compares two <see cref="IShellItem" />s. The comparison is carried
        ///     out by display order.
        /// </summary>
        /// <param name="item">
        ///     The item to compare.
        /// </param>
        /// <returns>
        ///     0 if the two items are equal. A negative number if
        ///     <see langword="this" /> is before <paramref name="item" /> in
        ///     display order. A positive number if
        ///     <see langword="this" /> comes after <paramref name="item" /> in
        ///     display order.
        /// </returns>
        public int Compare(ShellItem item)
        {
            var result = ComInterface.Compare(item.ComInterface,
                                              SICHINT.DISPLAY);

            return(result);
        }
Beispiel #4
0
        /// <summary>
        ///     Returns the name of the item in the specified style.
        /// </summary>
        /// <param name="sigdn">
        ///     The style of display name to return.
        /// </param>
        /// <returns>
        ///     A string containing the display name of the item.
        /// </returns>
        public string GetDisplayName(SIGDN sigdn)
        {
            var resultPtr = ComInterface.GetDisplayName(sigdn);
            var result    = Marshal.PtrToStringUni(resultPtr);

            Marshal.FreeCoTaskMem(resultPtr);
            return(result);
        }
Beispiel #5
0
        /// <summary>
        ///     Returns an <see cref="System.Runtime.InteropServices.ComTypes.IDataObject" /> representing the
        ///     item. This object is used in drag and drop operations.
        /// </summary>
        public IDataObject GetIDataObject()
        {
            var result = ComInterface.BindToHandler(IntPtr.Zero,
                                                    BHID.SFUIObject, typeof(IDataObject).GUID);

            return((IDataObject)Marshal.GetTypedObjectForIUnknown(result,
                                                                  typeof(IDataObject)));
        }
Beispiel #6
0
        /// <summary>
        ///     Returns an <see cref="IShellFolder" /> representing the
        ///     item.
        /// </summary>
        public IShellFolder GetIShellFolder()
        {
            var result = ComInterface.BindToHandler(IntPtr.Zero,
                                                    BHID.SFObject, typeof(IShellFolder).GUID);

            return((IShellFolder)Marshal.GetTypedObjectForIUnknown(result,
                                                                   typeof(IShellFolder)));
        }
Beispiel #7
0
        private void CreateShellView()
        {
            var previous       = ComInterface;
            var bounds         = ClientRectangle;
            var folderSettings = new FOLDERSETTINGS();

            // Create an IShellView object.
            ComInterface = CreateViewObject(ShellItem, Handle);

            // Set the FOLDERSETTINGS.
            folderSettings.ViewMode = (FOLDERVIEWMODE)_mView;

            if (!_mShowWebView)
            {
                folderSettings.fFlags |= FOLDERFLAGS.NOWEBVIEW;
            }

            if (!_mMultiSelect)
            {
                folderSettings.fFlags |= FOLDERFLAGS.SINGLESEL;
            }

            // Tell the IShellView object to create a view window and
            // activate it.
            try
            {
                ComInterface.CreateViewWindow(previous, ref folderSettings,
                                              GetShellBrowser(), ref bounds,
                                              out _mShellViewWindow);
            }
            catch (COMException ex)
            {
                // If the operation was cancelled by the user (for example
                // because an empty removable media drive was selected,
                // then "Cancel" pressed in the resulting dialog) convert
                // the exception into something more meaningfil.
                if (ex.ErrorCode == unchecked ((int)0x800704C7U))
                {
                    throw new UserAbortException(ex);
                }
            }

            ComInterface.UIActivate(1);

            // Disable the window if in design mode, so that user input is
            // passed onto the designer.
            if (DesignMode)
            {
                User32.EnableWindow(_mShellViewWindow, false);
            }

            // Destroy the previous view window.
            previous?.DestroyViewWindow();
        }
 public ClassModuleDeclaration(ComInterface @interface, Declaration parent, QualifiedModuleName module,
                               Attributes attributes)
     : this(
         module.QualifyMemberName(@interface.Name),
         parent,
         @interface.Name,
         false,
         new List <IAnnotation>(),
         attributes)
 {
 }
Beispiel #9
0
        /// <summary>
        /// Returns an <see cref="IShellFolder"/> representing the
        /// item.
        /// </summary>
        public IShellFolder GetIShellFolder()
        {
            IntPtr res;

            try {
                ComInterface.BindToHandler(IntPtr.Zero, BHID.SFObject, typeof(IShellFolder).GUID, out res); //HResult result =
                var iShellFolder = (IShellFolder)Marshal.GetTypedObjectForIUnknown(res, typeof(IShellFolder));
                return(iShellFolder);
            } catch {
                return(null);
            }
        }
Beispiel #10
0
 /// <summary>
 /// Returns the name of the item in the specified style.
 /// </summary>
 ///
 /// <param name="sigdn">
 /// The style of display name to return.
 /// </param>
 ///
 /// <returns>
 /// A string containing the display name of the item.
 /// </returns>
 public string GetDisplayName(SIGDN sigdn)
 {
     try {
         IntPtr resultPtr = ComInterface.GetDisplayName(sigdn);
         string result    = Marshal.PtrToStringUni(resultPtr);
         Marshal.FreeCoTaskMem(resultPtr);
         return(result);
     } catch {
         try {
             var    shellobj  = new ShellItem(this.CachedParsingName.ToShellParsingName());
             IntPtr resultPtr = shellobj.ComInterface.GetDisplayName(sigdn);
             string result    = Marshal.PtrToStringUni(resultPtr);
             Marshal.FreeCoTaskMem(resultPtr);
             return(result);
         } catch {
             return("Search.search-ms");
         }
     }
 }
Beispiel #11
0
        private IDataObject GetSelectionDataObject()
        {
            IntPtr result;

            if (ComInterface == null)
            {
                return(null);
            }

            ComInterface.GetItemObject(SVGIO.SVGIO_SELECTION,
                                       typeof(IDataObject).GUID, out result);

            if (result != IntPtr.Zero)
            {
                var wrapped =
                    (IDataObject)
                    Marshal.GetTypedObjectForIUnknown(result,
                                                      typeof(IDataObject));
                return(wrapped);
            }
            return(null);
        }
Beispiel #12
0
        /// <summary>
        ///     Determines whether two <see cref="ShellItem" />s refer to
        ///     the same shell folder.
        /// </summary>
        /// <param name="obj">
        ///     The item to compare.
        /// </param>
        /// <returns>
        ///     <see langword="true" /> if the two objects refer to the same
        ///     folder, <see langword="false" /> otherwise.
        /// </returns>
        public override bool Equals(object obj)
        {
            if (obj is ShellItem)
            {
                var otherItem = (ShellItem)obj;
                var result    = ComInterface.Compare(otherItem.ComInterface,
                                                     SICHINT.DISPLAY) == 0;

                // Sometimes, folders are reported as being unequal even when
                // they refer to the same folder, so double check by comparing
                // the file system paths. (This was showing up on Windows XP in
                // the SpecialFolders() test)
                if (!result)
                {
                    result = IsFileSystem && otherItem.IsFileSystem &&
                             (FileSystemPath == otherItem.FileSystemPath);
                }

                return(result);
            }
            return(false);
        }
        private void MainWindow_Load(object sender, EventArgs e)
        {
            //Fitting Screen
            this.Location = new Point(0, 0);
            this.Size     = Screen.PrimaryScreen.WorkingArea.Size;

            //Fitting Stream -> PictureBoxes
            this.Controls.Add(input_cam);
            this.input_cam.SizeMode = PictureBoxSizeMode.StretchImage;
            this.Controls.Add(output_cam);
            this.output_cam.SizeMode = PictureBoxSizeMode.StretchImage;
            this.logoPB.SizeMode     = PictureBoxSizeMode.StretchImage;


            /*RFID Reader Inits*/
            mReader          = new clsReader();
            mReaderInterface = ComInterface.enumTCPIP;
            mReader.Disconnect();

            try
            {
                if (mReaderInterface == ComInterface.enumTCPIP)
                {
                    mReader.InitOnNetwork("192.168.1.100", 23);
                }
                else
                {
                    mReader.InitOnCom();
                }

                string result = mReader.Connect();

                if (mReader.IsConnected)
                {
                    if (mReaderInterface == ComInterface.enumTCPIP)
                    {
                        this.Cursor = Cursors.Arrow;
                        if (!mReader.Login("alien", "password"))
                        {
                            mReader.Disconnect();
                            return;
                        }
                    }
                    mReader.AutoMode = "On";
                }
                //Stream Inits
                input_mjpeg             = new MjpegDecoder();
                input_mjpeg.FrameReady += input_mjpeg_frameReady;

                output_mjpeg             = new MjpegDecoder();
                output_mjpeg.FrameReady += output_mjpeg_frameReady;

                add_cam();

                //Timers
                antennaTimer1.Enabled = true;
                antennaTimer2.Enabled = true;
            }
            catch
            {
                inputInfoPanel.BackColor = Color.Red;
            }

            //Motion Detection Variables Inits
            fic = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            foreach (FilterInfo item in fic)
            {
                metroComboBox1.Items.Add(item.Name);
            }
            metroComboBox1.SelectedIndex = 0;
            detector    = new MotionDetector(new TwoFramesDifferenceDetector(), new MotionBorderHighlighting());
            detector_ks = 0; // Init value
        }
Beispiel #14
0
 internal Direct3DDevice9Ex(ComInterface.IDirect3DDevice9Ex obj)
 {
     this.comObject = obj;
     ComInterface.GetComMethod(this.comObject, 23, out this.createTexture);
 }
Beispiel #15
0
 private Direct3D9Ex(ComInterface.IDirect3D9Ex obj)
 {
     this.comObject = obj;
     ComInterface.GetComMethod(this.comObject, 20, out this.createDeviceEx);
 }
Beispiel #16
0
 internal Direct3DSurface9(ComInterface.IDirect3DSurface9 obj)
 {
     this.comObject = obj;
     this.native = Marshal.GetIUnknownForObject(this.comObject);
 }
Beispiel #17
0
 /// <summary>
 ///     Refreshes the contents of the <see cref="ShellView" />.
 /// </summary>
 public void RefreshContents()
 {
     ComInterface?.Refresh();
 }
Beispiel #18
0
 internal Direct3DTexture9(ComInterface.IDirect3DTexture9 obj)
 {
     this.comObject = obj;
     ComInterface.GetComMethod(this.comObject, 18, out this.getSurfaceLevel);
 }
Beispiel #19
0
 public static extern int Direct3DCreate9Ex(int SDKVersion, out ComInterface.IDirect3D9Ex directX);