Ejemplo n.º 1
0
		private void Init(Schema schema, string tableName)
		{
			if (schema == null)
				throw new ArgumentNullException(nameof(schema));

			DdeSettings = new DdeSettings();

			Schema = schema;
			TableName = tableName;

			EntitySerializer = new BinarySerializer<int>().GetSerializer(schema.EntityType);
			CollectionSerializer = new BinarySerializer<int>().GetSerializer(typeof(IEnumerable<>).Make(schema.EntityType));

			if (Schema.Identity != null)
				Cache = new SynchronizedDictionary<object, object>();
		}
Ejemplo n.º 2
0
        private void Init(Schema schema, string tableName)
        {
            if (schema == null)
            {
                throw new ArgumentNullException(nameof(schema));
            }

            DdeSettings = new DdeSettings();

            Schema    = schema;
            TableName = tableName;

            EntitySerializer     = new BinarySerializer <int>().GetSerializer(schema.EntityType);
            CollectionSerializer = new BinarySerializer <int>().GetSerializer(typeof(IEnumerable <>).Make(schema.EntityType));

            if (Schema.Identity != null)
            {
                Cache = new SynchronizedDictionary <object, object>();
            }
        }
Ejemplo n.º 3
0
		private void StartDde(DdeSettings ddeSettings)
		{
			if (ddeSettings == null)
				throw new ArgumentNullException(nameof(ddeSettings));

			lock (_winApiLock)
			{
				CloseAllDdeWindows();

				var window = GetTableWindow(ddeSettings.TableName);
				var ddeWindow = OpenDdeWindow(window);

				ddeWindow.Book = ddeSettings.TableName;
				ddeWindow.Sheet = string.Empty;

				StartDde(ddeWindow, ddeSettings);
			}

			var table = GetWellKnownTable(ddeSettings.TableName);

			if (table != null)
				_activeDdeExport.Add(DdeExportTypes.ByDdeTable, table);
			else
				_activeDdeExport.Add(DdeExportTypes.ByCaption, ddeSettings.TableName);
		}
Ejemplo n.º 4
0
		private void StartDde(DdeWindow ddeWindow, DdeSettings ddeSettings)
		{
			if (ddeWindow == null)
				throw new ArgumentNullException(nameof(ddeWindow));

			if (ddeSettings == null)
				throw new ArgumentNullException(nameof(ddeSettings));

			ddeWindow.DdeServer = Adapter.DdeServer;

			ddeWindow.Row = 1;
			ddeWindow.Column = 1;
			ddeWindow.StartFromRow = 1;

			ddeWindow.OutAfterCreate = false;
			ddeWindow.OutAfterCtrlShiftL = false;
			ddeWindow.RowsCaption = ddeSettings.RowsCaption;
			ddeWindow.ColumnsCaption = ddeSettings.ColumnsCaption;
			ddeWindow.FormalValues = ddeSettings.FormalValues;
			ddeWindow.EmptyCells = ddeSettings.EmptyCells;

			StopDdeOutput(ddeWindow);

			WaitFor(() =>
			{
				ddeWindow.Window.Command(ddeWindow.BeginOutBtn);
				return ddeWindow.BeginOutBtn.Enabled;
			}, "Запуск DDE вывода");

			CloseDde(ddeWindow);
		}