示例#1
0
 /// <summary>
 /// Constructor taking a valid data source manager instance
 /// </summary>
 /// <param name="dataSourceManager"></param>
 internal DataSource(DataSourceManager dataSourceManager)
 {
     this.dataSourceManager = dataSourceManager;
     this.Identity = new Identity ();
     this.Identity.Id = IntPtr.Zero;
     GetDefault ();
 }
示例#2
0
文件: Xfer.cs 项目: HeinerMuc/archive
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="dataSourceManager">Datasourcemanager for the xfers</param>
 /// <param name="dataSource">Datasource for the xfers</param>
 internal Xfer(
     DataSourceManager dataSourceManager,
     DataSource dataSource)
 {
     this.dataSourceManager = dataSourceManager;
     this.dataSource = dataSource;
     this.pendingXfersInteropStruct = new PendingXfersInterop ();
 }
示例#3
0
        /// <summary>
        /// Constructor taking arguments necessary to initialize the capability
        /// </summary>
        /// <param name="dataSourceManager">data source manager controlling the current session</param>
        /// <param name="dataSource">data source from which to aquire</param>
        /// <param name="cap">The capability which shall be represented by the object</param>
        public Capability(DataSourceManager dataSourceManager, DataSource dataSource, Capabilities cap)
        {
            this.CapabilityType = (short) cap;
            this.ItemType = -1;

            this.dataSourceManager = dataSourceManager;
            this.dataSource = dataSource;
        }
示例#4
0
        /// <summary>
        /// Constructor taking the datasourcemanager and the datasource which shall process a windows message
        /// </summary>
        /// <param name="dataSourceManager"></param>
        /// <param name="dataSource"></param>
        internal Event(DataSourceManager dataSourceManager, DataSource dataSource)
        {
            interopStruct = new EventInterop ();
            interopStruct.WindowsMessagePointer = Marshal.AllocHGlobal (Marshal.SizeOf (windowsMessage));

            windowsMessage = new WindowsMsg ();

            this.dataSourceManager = dataSourceManager;
            this.dataSource = dataSource;
        }
        private void Initialize()
        {
            this.dataSourceManager = new DataSourceManager ();

            IntPtr parentHandle = this.parentForm.Handle;

            if (this.dataSourceManager.Open (ref parentHandle) == ReturnCodes.Success)
            {
                this.dataSource = new DataSource (this.dataSourceManager);
                this.dataSource.GetDefault ();

                this.eventMessage = new Event (
                    this.dataSourceManager,
                    this.dataSource);
            }
            else
            {
                this.dataSourceManager.Close ();
            }
        }
示例#6
0
        /// <summary>
        /// Constructor taking arguments necessary to initialize the capability
        /// </summary>
        /// <param name="dataSourceManager">data source manager controlling the current session</param>
        /// <param name="dataSource">data source from which to aquire</param>
        /// <param name="cap">The capability which shall be represented by the object</param>
        /// <param name="sval">Value of the capability</param>
        public Capability(DataSourceManager dataSourceManager, DataSource dataSource, Capabilities cap, short sval)
        {
            CapabilityType = (short) cap;
            ItemType = (short) ContainerTypes.One;
            Handle = Kernel32.GlobalAlloc (0x42, 6);
            IntPtr pv = Kernel32.GlobalLock (Handle);
            Marshal.WriteInt16 (pv, 0, (short) ItemTypes.Int16);
            Marshal.WriteInt32 (pv, 2, (int) sval);
            Kernel32.GlobalUnlock (Handle);

            this.dataSourceManager = dataSourceManager;
            this.dataSource = dataSource;
        }