예제 #1
0
		/// <summary>
		/// Creates new adaptor
		/// </summary>
		/// <param name="aIsBoundary">
		/// Defines if this adaptor is boundary or not <see cref="System.Boolean"/>
		/// </param>
		/// <param name="aControlAdaptor">
		/// Control adaptor which created this adaptor <see cref="ControlAdaptor"/>
		/// </param>
		/// <param name="aControl">
		/// Control owning this adaptor <see cref="System.Object"/>
		/// </param>
		/// <param name="aSingleMappingOnly">
		/// Set true if this adaptor allows single (master) mapping only <see cref="System.Boolean"/>
		/// </param>
		public Adaptor(bool aIsBoundary, ControlAdaptor aControlAdaptor, object aControl, bool aSingleMappingOnly)
		{
			id = DataSourceController.AssignId();
			if (CheckControlType(aControl) == false)
				throw new ExceptionAdaptorConnectedWithWrongWidgetType (this, aControl); 
			values = new ValueList (this);
			isBoundary = aIsBoundary;
			singleMappingOnly = aSingleMappingOnly;
			controlAdaptor = aControlAdaptor;
			if (controlAdaptor != null) {
				if (aIsBoundary == false)
					ConnectionProvider.ConnectControlAndAdaptor (Control, this);
				DataSourceController.AddAdaptor (this);
				if (aIsBoundary == false)
					if (aControl != null)
						if (controlAdaptor.ControlIsContainer(aControl) == false)
							InheritedTarget = true;
			}
		}
예제 #2
0
		public Adaptor()
		{
			id = DataSourceController.AssignId();
			CursorMode = true;
			values = new ValueList (this);
			isBoundary = false;
			singleMappingOnly = false;
			controlAdaptor = null;
			isDataAdaptor = true;
			DataSourceController.AddAdaptor (this);
			//TODO: Solve this problem, it doesn't initialize correctly???
			// Not really nice workaraound for first initialization, assign anything and null??? And then it works???
			// Not serious, It can wait. KNOWN REGRESSION
			DateTime dt = DateTime.Now;
			Target = dt;
			Target = null;
		}
예제 #3
0
		/// <summary>
		/// Creates new adaptor with target
		/// </summary>
		public Adaptor(object target)
		{
			id = DataSourceController.AssignId();
			CursorMode = true;
			values = new ValueList (this);
			isBoundary = false;
			singleMappingOnly = false;
			controlAdaptor = null;
			isDataAdaptor = true;
			DataSourceController.AddAdaptor (this);
			Target = target;
		}
예제 #4
0
		/// <summary>
		/// Disconnects Adaptor. Called automatically on destroy to speed up cleaning
		/// </summary>
		public virtual void Disconnect()
		{
			destroyed = true;
			InheritedTarget = false;
			if ((isBoundary == false) && (isDataAdaptor == false))
				ConnectionProvider.DisconnectControlAndAdaptor (Control, this);
			DataSourceController.RemoveAdaptor (this);
			dataChanged = null;
			targetChanged = null;
			postRequested = null;
			Target = null;
			controlAdaptor = null;
			if (values != null) {
				values.Disconnect();
				values = null;
			}
		}