Beispiel #1
0
        public void GlueConfiguredByCodeAndMakeCall_Sync()
        {
            //This is an example of how to use Glue without pre-configured app container
            var app = new TestApplication()
            {
                Active = true
            };
            var glue = new NFX.Glue.Implementation.GlueService(app);

            glue.Start();
            try
            {
                using (var binding = new SyncBinding(glue, "sync"))
                {
                    binding.Start();
                    var cl = new JokeContractClient(glue, TestServerSyncNode);
                    cl.Headers.Add(new AuthenticationHeader(TestCredentials));

                    var result = cl.Echo("Gello A!");

                    Assert.IsTrue(result.StartsWith("Server echoed Gello A!"));
                }
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Generates a list of objects to be used in the DefaultItems collection.
        /// </summary>
        /// <param name="defaultItems">The collection that should be updated.</param>
        protected override void GenerateDefaultItems(SlottedItemCollection defaultItems)
        {
            base.GenerateDefaultItems(defaultItems);
            DecimalPartGroup decimalGroup = new DecimalPartGroup();

            decimalGroup.SetBinding(DecimalPartGroup.IsReadOnlyProperty, new Binding("IsReadOnly")
            {
                Source = this
            });
            decimalGroup.SetBinding(DecimalTextBox.StringFormatProperty, new Binding("StringFormat")
            {
                Source = this
            });
            decimalGroup.SetBinding(DecimalPartGroup.MaximumProperty, new Binding("Maximum")
            {
                Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalGroup.SetBinding(DecimalPartGroup.MinimumProperty, new Binding("Minimum")
            {
                Source = this, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            SyncBinding.CreateBinding(this, DecimalTextBox.ValueProperty, decimalGroup, DecimalPartGroup.ValueProperty, UpdateSourceTrigger.PropertyChanged);

            defaultItems.Add(decimalGroup);
        }
Beispiel #3
0
        public void GlueConfiguredByCode()
        {
            //This is an example of how to use Glue without pre-configured app container
            var glue = new NFX.Glue.Implementation.GlueService();

            glue.Start();
            try
            {
                var binding = new SyncBinding(glue, "sync");
                var cl      = new JokeContractClient(glue, TestServerSyncNode);
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Generates a list of objects to be used in the DefaultItems collection.
        /// </summary>
        /// <param name="defaultItems">The collection that should be updated.</param>
        protected override void GenerateDefaultItems(SlottedItemCollection defaultItems)
        {
            base.GenerateDefaultItems(defaultItems);
            DecimalPartGroup decimalGroup = new DecimalPartGroup();

            decimalGroup.Style = this.TryFindResource("percentagePartGroup") as Style;
            decimalGroup.SetBinding(DecimalPartGroup.IsReadOnlyProperty, new Binding("IsReadOnly")
            {
                Source = this
            });
            decimalGroup.SetBinding(
                DecimalPartGroup.MaximumProperty,
                new Binding("Maximum")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalGroup.SetBinding(
                DecimalPartGroup.MinimumProperty,
                new Binding("Minimum")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalGroup.SetBinding(
                DecimalPartGroup.StepProperty,
                new Binding("Step")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalGroup.SetBinding(
                DecimalPartGroup.ValueProperty,
                new Binding("Value")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            SyncBinding.CreateBinding(
                this,
                PercentageTextBox.PartValueCommitTriggersProperty,
                decimalGroup,
                DecimalPartGroup.PartValueCommitTriggersProperty,
                UpdateSourceTrigger.Default);

            defaultItems.Add(decimalGroup);
            defaultItems.Add(new TextBlockPartGroup()
            {
                Text = "%"
            });
        }
        /// <summary>
        /// Generates a list of objects to be used in the DefaultItems collection.
        /// </summary>
        /// <param name="defaultItems">The collection that should be updated.</param>
        protected override void GenerateDefaultItems(SlottedItemCollection defaultItems)
        {
            // Allow the base class to provide most of the default items.
            base.GenerateDefaultItems(defaultItems);

            // This control will create a special group of parts for a decimal implementation of a percent value.
            DecimalPartGroup decimalPartGroup = new DecimalPartGroup();

            decimalPartGroup.SetBinding(DecimalPartGroup.StringFormatProperty, new Binding("Format")
            {
                Source = this
            });
            decimalPartGroup.SetBinding(DecimalPartGroup.IsReadOnlyProperty, new Binding("IsReadOnly")
            {
                Source = this
            });
            decimalPartGroup.SetBinding(
                DecimalPartGroup.MaximumProperty,
                new Binding("Maximum")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalPartGroup.SetBinding(
                DecimalPartGroup.MinimumProperty,
                new Binding("Minimum")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalPartGroup.SetBinding(
                DecimalPartGroup.StepProperty,
                new Binding("Step")
            {
                Source = this, Converter = new PercentageConverter(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            SyncBinding.CreateBinding(
                this,
                DecimalTextBox.ValueProperty,
                decimalPartGroup,
                DecimalPartGroup.ValueProperty,
                UpdateSourceTrigger.PropertyChanged, new PercentageConverter());
            defaultItems.Add(decimalPartGroup);
            defaultItems.Add(new TextBlockPartGroup()
            {
                Text = "%"
            });
        }
Beispiel #6
0
        protected internal override ServerTransport OpenServerEndpoint(ServerEndPoint epoint)
        {
            var cfg = ConfigNode.NavigateSection(CONFIG_SERVER_TRANSPORT_SECTION);

            if (!cfg.Exists)
            {
                cfg = ConfigNode;
            }

            var ipep      = SyncBinding.ToIPEndPoint(epoint.Node);
            var transport = new AppTermServerTransport(this, epoint, ipep.Address, ipep.Port);

            transport.Configure(cfg);
            transport.Start();

            return(transport);
        }
        /// <summary>
        /// Generate default parts.
        /// </summary>
        /// <param name="defaultItems"></param>
        protected override void GenerateDefaultItems(ActiproSoftware.Windows.Controls.Editors.Primitives.SlottedItemCollection defaultItems)
        {
            base.GenerateDefaultItems(defaultItems);

            EnumPartBase <E> part = new EnumPartBase <E>();

            part.SetBinding(EnumPartBase <E> .IsEditableProperty, new Binding("IsReadOnly")
            {
                Source = this, Converter = new NotConverter()
            });
            SyncBinding.CreateBinding(this, EnumPartBase <E> .ValueProperty, part, EnumPartBase <E> .ValueProperty);
            SyncBinding.CreateBinding(this, EnumPartBase <E> .InitialValueProperty, part, EnumPartBase <E> .InitialValueProperty);
            part.PartValueCommitTriggers       = PartValueCommitTriggers.All;
            part.IsFocusMovedOnTerminalMatches = true;
            part.IsTabStop = true;
            defaultItems.Add(part);
        }
        /// <summary>
        /// Generate default parts.
        /// </summary>
        /// <param name="defaultItems"></param>
        protected override void GenerateDefaultItems(ActiproSoftware.Windows.Controls.Editors.Primitives.SlottedItemCollection defaultItems)
        {
            // Allow the base class to set its defaults.
            base.GenerateDefaultItems(defaultItems);

            // This group will add a new set of defaults for the decimal part of the edit box.
            DecimalPart decimalPart = new DecimalPart();

            decimalPart.SetBinding(DecimalPart.StringFormatProperty, new Binding("StringFormat")
            {
                Source = this
            });
            decimalPart.SetBinding(DecimalPart.IsReadOnlyProperty, new Binding("IsReadOnly")
            {
                Source = this
            });
            decimalPart.SetBinding(DecimalPart.MaximumProperty, new Binding("Maximum")
            {
                Source = this
            });
            decimalPart.SetBinding(DecimalPart.MinimumProperty, new Binding("Minimum")
            {
                Source = this
            });
            decimalPart.SetBinding(DecimalPart.StepProperty, new Binding("Step")
            {
                Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            decimalPart.SetBinding(DecimalPart.ValueProperty, new Binding("Value")
            {
                Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            SyncBinding.CreateBinding(this, DecimalPartGroup.InitialValueProperty, decimalPart, DecimalPart.InitialValueProperty);
            SyncBinding.CreateBinding(
                this,
                DecimalPartGroup.PartValueCommitTriggersProperty,
                decimalPart,
                DecimalPart.PartValueCommitTriggersProperty,
                UpdateSourceTrigger.Default);
            decimalPart.IsFocusMovedOnTerminalMatches = true;
            decimalPart.IsTabStop = true;
            defaultItems.Add(decimalPart);
        }
Beispiel #9
0
        /// <summary>
        /// Generate default parts.
        /// </summary>
        /// <param name="defaultItems"></param>
        protected override void GenerateDefaultItems(ActiproSoftware.Windows.Controls.Editors.Primitives.SlottedItemCollection defaultItems)
        {
            base.GenerateDefaultItems(defaultItems);

            DecimalPart part = new DecimalPart();

            part.SetBinding(DecimalPart.IsEditableProperty, new Binding("IsReadOnly")
            {
                Source = this, Converter = new NotConverter()
            });
            part.SetBinding(DecimalPart.MaximumProperty, new Binding("Maximum")
            {
                Source = this
            });
            part.SetBinding(DecimalPart.MinimumProperty, new Binding("Minimum")
            {
                Source = this
            });
            part.SetBinding(DecimalPart.StepProperty, new Binding("Step")
            {
                Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            part.SetBinding(DecimalPart.ValueProperty, new Binding("Value")
            {
                Source = this, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
            });
            //SyncBinding.CreateBinding(this, DecimalPartGroup.ValueProperty, part, DecimalPart.ValueProperty);
            SyncBinding.CreateBinding(this, DecimalPartGroup.InitialValueProperty, part, DecimalPart.InitialValueProperty);
            SyncBinding.CreateBinding(
                this,
                DecimalPartGroup.PartValueCommitTriggersProperty,
                part,
                DecimalPart.PartValueCommitTriggersProperty,
                UpdateSourceTrigger.Default);
            part.IsFocusMovedOnTerminalMatches = true;
            part.IsTabStop = true;
            defaultItems.Add(part);
        }
Beispiel #10
0
 public AppTermServerTransport(SyncBinding binding,
                               ServerEndPoint serverEndpoint,
                               IPAddress localAddr, int port) : base(binding, serverEndpoint, localAddr, port)
 {
 }
 public AppTermClientTransport(SyncBinding binding, Node node) : base(binding, node)
 {
 }