internal override ResultBase ExcuteImplementation(ParameterBase parameter)
        {
            MaskParameter p         = (MaskParameter)parameter;
            MasksApi      maskApi   = new IO.Swagger.Api.MasksApi(ApiConfiguration);
            BufferApi     bufferApi = new IO.Swagger.Api.BufferApi(ApiConfiguration);

            var bufferResponse = bufferApi.BufferInsertAdvanced(1, "Test File", new MemoryStream(Encoding.UTF8.GetBytes("FILE DI TEST RANDOM " + Guid.NewGuid())));

            var maskSchema = maskApi.MasksGetProfileSchemaByMaskId(p.MaskId);
            // Completo i campi

            var fieldDocname = (SubjectFieldDTO)maskSchema.Fields.First(x => x is SubjectFieldDTO);

            fieldDocname.Value = "Test performance WEB API";

            var combo39_9 = (AdditionalFieldComboDTO)maskSchema.Fields.First(x => string.Equals(x.Name, "COMBO39_9"));
            var combo40_9 = (AdditionalFieldComboDTO)maskSchema.Fields.First(x => string.Equals(x.Name, "COMBO40_9"));
            var testo22_5 = (AdditionalFieldStringDTO)maskSchema.Fields.First(x => string.Equals(x.Name, "TESTO22_5"));
            var testo21_5 = (AdditionalFieldStringDTO)maskSchema.Fields.First(x => string.Equals(x.Name, "TESTO21_5"));

            combo39_9.Value = "PRATICHE";
            combo40_9.Value = "E";
            testo22_5.Value = Guid.NewGuid().ToString("N");
            testo21_5.Value = testo22_5.Value.Substring(2, 5);

            var profileDto = new ProfileDTO {
                Fields = maskSchema.Fields, Document = new FileDTO(new List <string>(), bufferResponse)
            };

            ProfileResultDTO result = maskApi.MasksPost(p.MaskId, profileDto);

            return(new DocnumberResult {
                Docnumber = result.DocNumber.Value
            });
        }
        private void GenerateProperty(TypeBuilder typeBuilder, ParameterBase parameter, ModuleBuilder moduleBuilder)
        {
            Type dataType = parameter.DataType;

            if ((parameter.AllowedValues != null) && (parameter.AllowedValues.Length > 0))
            {
                dataType = GenerateEnumeration(parameter.Name + "Enum", parameter.AllowedValues, moduleBuilder);
            }
            FieldBuilder    fieldBuilder       = typeBuilder.DefineField(parameter.Name + "Field", dataType, FieldAttributes.Private);
            PropertyBuilder propertyBuilder    = typeBuilder.DefineProperty(parameter.Name, PropertyAttributes.HasDefault, dataType, null);
            MethodBuilder   propertyGetBuilder = typeBuilder.DefineMethod("get_" + parameter.Name,
                                                                          MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig,
                                                                          dataType,
                                                                          null);
            ILGenerator getGenerator = propertyGetBuilder.GetILGenerator();

            getGenerator.Emit(OpCodes.Ldarg_0);
            getGenerator.Emit(OpCodes.Ldfld, fieldBuilder);
            getGenerator.Emit(OpCodes.Ret);
            MethodBuilder propertySetBuilder = typeBuilder.DefineMethod("get_" + parameter.Name,
                                                                        MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig,
                                                                        null,
                                                                        new Type[] { dataType });
            ILGenerator setGenerator = propertySetBuilder.GetILGenerator();

            setGenerator.Emit(OpCodes.Ldarg_0);
            setGenerator.Emit(OpCodes.Ldarg_1);
            setGenerator.Emit(OpCodes.Stfld, fieldBuilder);
            setGenerator.Emit(OpCodes.Ret);
            AssociateAttribute(propertyBuilder, typeof(DescriptionAttribute), parameter.Description);
            AssociateAttribute(propertyBuilder, typeof(DisplayNameAttribute), parameter.DisplayName);
            propertyBuilder.SetGetMethod(propertyGetBuilder);
            propertyBuilder.SetSetMethod(propertySetBuilder);
        }
Beispiel #3
0
        /// <summary>
        /// Update the row containment associated to a <see cref="ParameterBase"/>
        /// </summary>
        /// <param name="parameterBase">The <see cref="ParameterBase"/></param>
        public void UpdateParameterBasePosition(ParameterBase parameterBase)
        {
            var oldContainer  = this.parameterOrOverrideContainerMap[parameterBase];
            var newContainer  = parameterBase.Group;
            var associatedRow = this.parameterOrOverrideBaseCache[parameterBase];

            if (newContainer != null && oldContainer == null)
            {
                this.ContainedRows.Remove(associatedRow);
                this.parameterGroupCache[newContainer].ContainedRows.SortedInsert(associatedRow, ParameterGroupRowViewModel.ChildRowComparer);
                this.parameterOrOverrideContainerMap[parameterBase] = newContainer;
            }
            else if (newContainer == null && oldContainer != null)
            {
                this.parameterGroupCache[oldContainer].ContainedRows.Remove(associatedRow);
                this.ContainedRows.SortedInsert(associatedRow, ChildRowComparer);
                this.parameterOrOverrideContainerMap[parameterBase] = null;
            }
            else if (newContainer != null && oldContainer != null && newContainer != oldContainer)
            {
                this.parameterGroupCache[oldContainer].ContainedRows.Remove(associatedRow);
                this.parameterGroupCache[newContainer].ContainedRows.SortedInsert(associatedRow, ParameterGroupRowViewModel.ChildRowComparer);
                this.parameterOrOverrideContainerMap[parameterBase] = newContainer;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterStateRowViewModel"/> class
 /// </summary>
 /// <param name="parameterBase">The associated <see cref="ParameterBase"/></param>
 /// <param name="option">The associated <see cref="Option"/></param>
 /// <param name="actualState">The associated <see cref="ActualFiniteState"/></param>
 /// <param name="session">The associated <see cref="ISession"/></param>
 /// <param name="containerViewModel">The container row</param>
 /// <param name="isDialogReadOnly">Value indicating whether this row should be read-only because the dialog is read-only</param>
 public ParameterStateRowViewModel(ParameterBase parameterBase, Option option, ActualFiniteState actualState, ISession session, IRowViewModelBase <Thing> containerViewModel, bool isDialogReadOnly = false)
     : base(parameterBase, session, option, actualState, containerViewModel, 0, isDialogReadOnly)
 {
     this.Name   = this.ActualState.Name;
     this.State  = this.ActualState.Name;
     this.Option = this.ActualOption;
 }
Beispiel #5
0
        private ParameterProxy CreateParameterProxy(ParameterBase param, EntityData _entity)
        {
            ParameterProxy proxy = null;

            if (param is Parameter_Boolean)
            {
                proxy = new ParameterProxy_Boolean(_entity, (Parameter_Boolean)param);
            }
            else if (param is Parameter_Integer)
            {
                proxy = new ParameterProxy_Integer(_entity, (Parameter_Integer)param);
            }
            else if (param is Parameter_Double)
            {
                proxy = new ParameterProxy_Double(_entity, (Parameter_Double)param);
            }
            else if (param is Parameter_DoubleRange)
            {
                proxy = new ParameterProxy_DoubleRange(_entity, (Parameter_DoubleRange)param);
            }
            else if (param is Parameter_String)
            {
                proxy = new ParameterProxy_String(_entity, (Parameter_String)param);
            }
            else if (param is Parameter_List)
            {
                proxy = new ParameterProxy_List(_entity, (Parameter_List)param);
            }
            else if (param is Parameter_Vector3)
            {
                proxy = new ParameterProxy_Vector3(_entity, (Parameter_Vector3)param);
            }

            return(proxy);
        }
Beispiel #6
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            base.OnNavigatedTo(e, viewModelState);
            var parameter = ParameterBase.ToObject <NovelDetailParameter>((string)e.Parameter);

            Initialize(parameter);
        }
Beispiel #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterOptionRowViewModel"/> class
        /// </summary>
        /// <param name="parameterBase">The associated <see cref="ParameterBase"/></param>
        /// <param name="option">The associated <see cref="Option"/></param>
        /// <param name="session">The associated <see cref="ISession"/></param>
        /// <param name="containerViewModel">The container row</param>
        /// <param name="isReadOnly">A value indicating whether the row is read-only</param>
        public ParameterOptionRowViewModel(ParameterBase parameterBase, Option option, ISession session, IViewModelBase <Thing> containerViewModel, bool isReadOnly)
            : base(parameterBase, session, option, null, containerViewModel, 0, isReadOnly)
        {
            this.Name   = this.ActualOption.Name;
            this.Option = this.ActualOption;

            Func <ObjectChangedEvent, bool> discriminator = objectChange => objectChange.EventKind == EventKind.Updated;
            Action <ObjectChangedEvent>     action        = x => { this.Name = this.ActualOption.Name; };

            if (this.AllowMessageBusSubscriptions)
            {
                var optionListener = CDPMessageBus.Current.Listen <ObjectChangedEvent>(this.Option)
                                     .Where(discriminator)
                                     .ObserveOn(RxApp.MainThreadScheduler)
                                     .Subscribe(action);

                this.Disposables.Add(optionListener);
            }
            else
            {
                var optionObserver = CDPMessageBus.Current.Listen <ObjectChangedEvent>(typeof(Option));
                this.Disposables.Add(
                    this.MessageBusHandler.GetHandler <ObjectChangedEvent>().RegisterEventHandler(optionObserver, new ObjectChangedMessageBusEventHandlerSubscription(this.Option, discriminator, action)));
            }
        }
Beispiel #8
0
 public static List <Declaration> GetChunkDeclarations()
 {
     if (OnDemandProcessingManager.m_ChunkDeclarations == null)
     {
         List <Declaration> list = new List <Declaration>(21);
         list.Add(ScopeInstance.GetDeclaration());
         list.Add(ReportInstance.GetDeclaration());
         list.Add(DataSetInstance.GetDeclaration());
         list.Add(DataRegionInstance.GetDeclaration());
         list.Add(DataRegionMemberInstance.GetDeclaration());
         list.Add(DataCellInstance.GetDeclaration());
         list.Add(DataAggregateObjResult.GetDeclaration());
         list.Add(SubReportInstance.GetDeclaration());
         list.Add(GroupTreePartition.GetDeclaration());
         list.Add(ReportSnapshot.GetDeclaration());
         list.Add(ParametersImplWrapper.GetDeclaration());
         list.Add(ParameterImplWrapper.GetDeclaration());
         list.Add(SubReportInfo.GetDeclaration());
         list.Add(ParameterInfo.GetNewDeclaration());
         list.Add(ParameterInfoCollection.GetDeclaration());
         list.Add(ParameterBase.GetNewDeclaration());
         list.Add(ValidValue.GetNewDeclaration());
         list.Add(FieldInfo.GetDeclaration());
         list.Add(TreePartitionManager.GetDeclaration());
         list.Add(LookupObjResult.GetDeclaration());
         list.Add(DataCellInstanceList.GetDeclaration());
         return(list);
     }
     return(OnDemandProcessingManager.m_ChunkDeclarations);
 }
Beispiel #9
0
 public void ResetAndReload()
 {
     target.Reset();
     target.DeleteInstance();
     target = null;
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }
Beispiel #10
0
 public override void AddParameter(ParameterBase param)
 {
     if (!_parameters.Contains(param))
     {
         _parameters.Add(param);
     }
 }
Beispiel #11
0
        /// <summary>
        /// Update the row containment associated to a <see cref="ParameterBase"/>
        /// </summary>
        /// <param name="parameterBase">The <see cref="ParameterBase"/></param>
        public void UpdateParameterBasePosition(ParameterBase parameterBase)
        {
            try
            {
                var oldContainer  = this.parameterBaseContainerMap[parameterBase];
                var newContainer  = parameterBase.Group;
                var associatedRow = this.parameterBaseCache[parameterBase];

                if (newContainer != null && oldContainer == null)
                {
                    this.ContainedRows.Remove(associatedRow);
                    this.parameterGroupCache[newContainer].ContainedRows.SortedInsert(associatedRow, ParameterGroupRowViewModel.ChildRowComparer);
                    this.parameterBaseContainerMap[parameterBase] = newContainer;
                }
                else if (newContainer == null && oldContainer != null)
                {
                    this.parameterGroupCache[oldContainer].ContainedRows.Remove(associatedRow);
                    this.ContainedRows.SortedInsert(associatedRow, ChildRowComparer);
                    this.parameterBaseContainerMap[parameterBase] = null;
                }
                else if (newContainer != null && oldContainer != null && newContainer != oldContainer)
                {
                    this.parameterGroupCache[oldContainer].ContainedRows.Remove(associatedRow);
                    this.parameterGroupCache[newContainer].ContainedRows.SortedInsert(associatedRow, ParameterGroupRowViewModel.ChildRowComparer);
                    this.parameterBaseContainerMap[parameterBase] = newContainer;
                }
            }
            catch (Exception exception)
            {
                logger.Error(exception, "A problem occured when executing the UpdateParameterBasePosition method.");
            }
        }
 protected void CloneParameters(ParameterBase iiToCopyFrom)
 {
     foreach (Parameter p in iiToCopyFrom.Parameters)
     {
         Parameters.Add((Parameter)p.Clone());
     }
 }
 public void ParameterBase_FOO()
 {
     string testName = "FOO";
     ParameterBase testParameter = new ParameterBase();
     testParameter.Name = testName;
     Assert.AreEqual(testName, testParameter.Name);
 }
        internal override ResultBase ExcuteImplementation(ParameterBase parameter)
        {
            var p = (MaskParameter)parameter;

            Dm_Profile_Insert_MV forInsert = Wcf.ARX_DATI.Dm_Profile_Insert_MV_GetNewInstance_From_DmMaskId(p.MaskId);
            var insertMask = forInsert.DmProfileDefault.Dm_Profile_Insert_Base.To_Dm_Profile_Insert_For_Mask();

            insertMask.DmMaskId = p.MaskId;
            insertMask.DocName  = "Test performance WCF";
            insertMask.File     = new Arx_File(Encoding.UTF8.GetBytes("FILE DI TEST RANDOM " + Guid.NewGuid()), "Test.txt", DateTime.Now);
            insertMask.DataDoc  = DateTime.Now.Date;

            var combo39_9 = (Aggiuntivo_String)insertMask.Aggiuntivi.First(x => string.Equals(x.Nome, "COMBO39_9"));
            var combo40_9 = (Aggiuntivo_String)insertMask.Aggiuntivi.First(x => string.Equals(x.Nome, "COMBO40_9"));
            var testo22_5 = (Aggiuntivo_String)insertMask.Aggiuntivi.First(x => string.Equals(x.Nome, "TESTO22_5"));
            var testo21_5 = (Aggiuntivo_String)insertMask.Aggiuntivi.First(x => string.Equals(x.Nome, "TESTO21_5"));

            combo39_9.Valore = "PRATICHE";
            combo40_9.Valore = "E";
            testo22_5.Valore = Guid.NewGuid().ToString("N");
            testo21_5.Valore = testo22_5.Valore.Substring(2, 5);

            var result = Wcf.ARX_DATI.Dm_Profile_Insert_For_Mask(insertMask);

            if (result.EXCEPTION != Security_Exception.Nothing)
            {
                throw new Exception(result.EXCEPTION.ToString());
            }

            return(new DocnumberResult {
                Docnumber = result.PROFILE.DOCNUMBER
            });
        }
Beispiel #15
0
        public override void CreateModule(ParameterBase Parameter)
        {
            parCylineDoor = Parameter as ParCylinderDoor;
            if (parCylineDoor == null)
            {
                return;
            }
            init();
            PartDocument            part    = InventorTool.CreatePart();
            PartComponentDefinition partDef = part.ComponentDefinition;
            PlanarSketch            osketch = partDef.Sketches.Add(partDef.WorkPlanes[3]);
            SketchEllipticalArc     Arc1    = osketch.SketchEllipticalArcs.Add(InventorTool.Origin, InventorTool.Left, parCylineDoor.DoorRadius, parCylineDoor.InRadius, 0, Math.PI / 2);
            SketchEllipticalArc     Arc2    = osketch.SketchEllipticalArcs.Add(InventorTool.Origin, InventorTool.Left, parCylineDoor.DoorRadius + parCylineDoor.Thickness, parCylineDoor.InRadius + parCylineDoor.Thickness, 0, Math.PI / 2);

            osketch.GeometricConstraints.AddConcentric((SketchEntity)Arc1, (SketchEntity)Arc2);
            SketchLine Line1 = osketch.SketchLines.AddByTwoPoints(Arc1.StartSketchPoint, Arc2.StartSketchPoint);
            SketchLine Line2 = osketch.SketchLines.AddByTwoPoints(Arc1.EndSketchPoint, Arc2.EndSketchPoint);

            osketch.GeometricConstraints.AddHorizontalAlign(Arc1.StartSketchPoint, Arc1.CenterSketchPoint);
            osketch.GeometricConstraints.AddVerticalAlign(Arc1.EndSketchPoint, Arc1.CenterSketchPoint);
            osketch.GeometricConstraints.AddHorizontal((SketchEntity)Line1);
            osketch.GeometricConstraints.AddVertical((SketchEntity)Line2);
            osketch.DimensionConstraints.AddEllipseRadius((SketchEntity)Arc1, true, InventorTool.TranGeo.CreatePoint2d(-parCylineDoor.DoorRadius / 2, 0));
            osketch.DimensionConstraints.AddEllipseRadius((SketchEntity)Arc1, false, InventorTool.TranGeo.CreatePoint2d(0, -parCylineDoor.InRadius / 2));

            Point2d p = InventorTool.TranGeo.CreatePoint2d((Line1.StartSketchPoint.Geometry.X + Line1.EndSketchPoint.Geometry.X) / 2 + 1, (Line1.StartSketchPoint.Geometry.Y + Line1.EndSketchPoint.Geometry.Y) / 2 + 1);

            osketch.DimensionConstraints.AddTwoPointDistance(Line1.StartSketchPoint, Line1.EndSketchPoint, DimensionOrientationEnum.kAlignedDim, p);
            Profile        profile = osketch.Profiles.AddForSolid();
            RevolveFeature revolve = partDef.Features.RevolveFeatures.AddFull(profile, Line1, PartFeatureOperationEnum.kNewBodyOperation);
        }
        public static ParameterBase[] GetParameters(ParsingData parser, ParameterDefineNode[] defineNodes)
        {
            ParameterBase[] parameters = new ParameterBase[defineNodes.Length];
            for (int i = 0; i < parameters.Length; i++)
            {
                EnumData    enumData = null;
                DefinedType type     = null;
                if (defineNodes[i].Type != null)
                {
                    enumData = EnumData.GetEnum(defineNodes[i].Type);
                    type     = parser.GetDefinedType(defineNodes[i].Type, null);

                    if (enumData == null && type == null)
                    {
                        throw SyntaxErrorException.NonexistentType(defineNodes[i].Type, defineNodes[i].Location);
                    }
                }

                if (enumData != null)
                {
                    parameters[i] = new EnumParameter(defineNodes[i].VariableName, enumData.Type);
                }

                else if (type != null)
                {
                    parameters[i] = new TypeParameter(defineNodes[i].VariableName, type);
                }

                else
                {
                    parameters[i] = new Parameter(defineNodes[i].VariableName, Elements.ValueType.Any, null);
                }
            }
            return(parameters);
        }
Beispiel #17
0
        /// <summary>
        /// Update the row containment associated to a <see cref="ParameterBase"/>
        /// </summary>
        /// <param name="parameterBase">The <see cref="ParameterBase"/></param>
        public void UpdateParameterBasePosition(ParameterBase parameterBase)
        {
            var parameter = parameterBase as Parameter;

            if (parameter == null)
            {
                throw new InvalidOperationException("An element definition row may not contain parameter override rows.");
            }

            var oldContainer  = this.parameterContainerMap[parameter];
            var newContainer  = parameterBase.Group;
            var associatedRow = this.parameterCache[parameter];

            if (newContainer != null && oldContainer == null)
            {
                this.ContainedRows.Remove(associatedRow);
                this.parameterGroupCache[newContainer].ContainedRows.SortedInsert(associatedRow, ParameterGroupRowViewModel.ChildRowComparer);
                this.parameterContainerMap[parameter] = newContainer;
            }
            else if (newContainer == null && oldContainer != null)
            {
                this.parameterGroupCache[oldContainer].ContainedRows.Remove(associatedRow);
                this.ContainedRows.SortedInsert(associatedRow, ChildRowComparer);
                this.parameterContainerMap[parameter] = null;
            }
            else if (newContainer != null && oldContainer != null && newContainer != oldContainer)
            {
                this.parameterGroupCache[oldContainer].ContainedRows.Remove(associatedRow);
                this.parameterGroupCache[newContainer].ContainedRows.SortedInsert(associatedRow, ParameterGroupRowViewModel.ChildRowComparer);
                this.parameterContainerMap[parameter] = newContainer;
            }
        }
 internal static List <Declaration> GetChunkDeclarations()
 {
     if (m_ChunkDeclarations == null)
     {
         return(new List <Declaration>(21)
         {
             ScopeInstance.GetDeclaration(),
             ReportInstance.GetDeclaration(),
             DataSetInstance.GetDeclaration(),
             DataRegionInstance.GetDeclaration(),
             DataRegionMemberInstance.GetDeclaration(),
             DataCellInstance.GetDeclaration(),
             DataAggregateObjResult.GetDeclaration(),
             SubReportInstance.GetDeclaration(),
             GroupTreePartition.GetDeclaration(),
             ReportSnapshot.GetDeclaration(),
             ParametersImplWrapper.GetDeclaration(),
             ParameterImplWrapper.GetDeclaration(),
             SubReportInfo.GetDeclaration(),
             ParameterInfo.GetNewDeclaration(),
             ParameterInfoCollection.GetDeclaration(),
             ParameterBase.GetNewDeclaration(),
             ValidValue.GetNewDeclaration(),
             FieldInfo.GetDeclaration(),
             TreePartitionManager.GetDeclaration(),
             LookupObjResult.GetDeclaration(),
             DataCellInstanceList.GetDeclaration()
         });
     }
     return(m_ChunkDeclarations);
 }
        protected void OnEmberTreeChanged(object sender, Dispatcher.GlowRootReadyArgs e)
        {
            // Triggered on EmBER+ tree change
            Console.WriteLine("OnEmberTreeChanged");
            try
            {
                GlowQualifiedParameter glowParameter    = e.Root.FirstOrDefault() as GlowQualifiedParameter;
                ParameterBase          changedParameter = GetElement <ParameterBase>(glowParameter?.Path);

                if (glowParameter != null)
                {
                    Console.WriteLine($"EmberTree node {glowParameter.Value.ToString()} //IdentifierPath changed. {changedParameter?.IdentifierPath}");
                    Debug.WriteLine($"INFO {glowParameter.GetType().ToString()}");
                    Task.Run(async() =>
                    {
                        Console.WriteLine($"EmberTree node {glowParameter.Value.ToString()} //IdentifierPath changed. {changedParameter?.IdentifierPath}");
                        await OnHandleValuesChanged(changedParameter);

                        // TODO: Add event for saving tree
                    });
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR parsing tree");
                Console.Write(ex);
            }
        }
        private async Task OnHandleValuesChanged(ParameterBase parameter)
        {
            // Path
            var identifierPath = parameter.IdentifierPath;

            // Check if it is string parameter
            var stringParameter = parameter as StringParameter;

            if (stringParameter != null)
            {
                ChangedTreeEvent?.Invoke(identifierPath, stringParameter.Value, stringParameter.Path);
            }

            var boolParameter = parameter as BooleanParameter;

            if (boolParameter != null)
            {
                ChangedTreeEvent?.Invoke(identifierPath, boolParameter.Value, boolParameter.Path);
            }

            var intParameter = parameter as IntegerParameter;

            if (intParameter != null)
            {
                ChangedTreeEvent?.Invoke(identifierPath, (int)intParameter.Value, intParameter.Path);
            }
        }
Beispiel #21
0
        internal override ResultBase ExcuteImplementation(ParameterBase parameter)
        {
            var p = (DocnumberParameter)parameter;

            Wcf.ARX_DATI.Dm_Profile_MV_GetData_By_Docnumber(p.Docnumber, string.Empty, true);

            return(new VoidResult());
        }
 /// <summary>
 /// Move the parameter to the given parameter group.
 /// </summary>
 /// <param name="parameter">The <see cref="Parameter" /> whose group will change</param>
 /// <param name="group">The <see cref="ParameterGroup" /></param>
 /// <param name="transaction">the <see cref="ThingTransaction" /> holding the changes to persist</param>
 private void MoveParameterToGroup(ParameterBase parameter, ParameterGroup group, ThingTransaction transaction)
 {
     if (parameter != null && group != null && parameter.Group != group)
     {
         parameter.Group = group;
         transaction.CreateOrUpdate(parameter);
         Console.WriteLine($"Moved parameter {parameter.ParameterType.ShortName} to group {group.Name}");
     }
 }
Beispiel #23
0
        public override void OnNavigatedTo(NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            base.OnNavigatedTo(e, viewModelState);

            var parameter = ParameterBase.ToObject <IllustDetailParameter>((string)e.Parameter);

            _categoryService.UpdateCategory();
            Thumbnailable = new PixivImage(parameter.Illust, _imageStoreService, true);
        }
Beispiel #24
0
        public bool Initialize(ParameterBase Parameters)
        {
            CameraClient.Init();
            this.cameraParameter = Parameters as IPCameraParameter;
            this.cameraClient    = new CameraClient();
            int error = this.cameraClient.Login(this.cameraParameter.Address, this.cameraParameter.Port, this.cameraParameter.UserName, this.cameraParameter.Password, this.cameraParameter.DeviceSpecification, this.cameraParameter.DeviceSN);

            return(error <= 0);
        }
Beispiel #25
0
        public override bool Compare(ParameterBase other)
        {
            CustomConfigParameter customConfigParameter = other as CustomConfigParameter;

            if (ConfigFileName != customConfigParameter?.ConfigFileName)
            {
                return(false);
            }
            return(true);
        }
Beispiel #26
0
        internal override ResultBase ExcuteImplementation(ParameterBase parameter)
        {
            var p = (DocnumberParameter)parameter;

            var profileApi = new IO.Swagger.Api.ProfilesApi(ApiConfiguration);

            profileApi.ProfilesGet(p.Docnumber);

            return(new VoidResult());
        }
Beispiel #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterStateRowViewModel"/> class
        /// </summary>
        /// <param name="parameterBase">The associated <see cref="ParameterBase"/></param>
        /// <param name="option">The associated <see cref="Option"/></param>
        /// <param name="actualState">The associated <see cref="ActualFiniteState"/></param>
        /// <param name="session">The associated <see cref="ISession"/></param>
        /// <param name="containerViewModel">The container row</param>
        /// <param name="isReadOnly">A value indicating whether the row is read-only</param>
        public ParameterStateRowViewModel(ParameterBase parameterBase, Option option, ActualFiniteState actualState, ISession session, IRowViewModelBase <Thing> containerViewModel, bool isReadOnly)
            : base(parameterBase, session, option, actualState, containerViewModel, 0, isReadOnly)
        {
            this.Name      = this.ActualState.Name;
            this.State     = this.ActualState.Name;
            this.IsDefault = this.ActualState.IsDefault;
            this.Option    = this.ActualOption;

            this.InitializeOptionSubscriptions();
        }
        internal override ResultBase ExcuteImplementation(ParameterBase parameter)
        {
            var p = (MaskParameter)parameter;

            var apiMask = new IO.Swagger.Api.MasksApi(ApiConfiguration);

            MaskDTO maskDto = apiMask.MasksGetById(p.MaskId);

            return(new VoidResult());
        }
Beispiel #29
0
        public override void CreateModule(ParameterBase Parameter)
        {
            parCylinder = Parameter as ParCylinder;
            if (parCylinder == null)
            {
                return;
            }
            init();


            PartDocument            part = InventorTool.CreatePart();
            PartComponentDefinition partDef = part.ComponentDefinition;
            PlanarSketch            osketch = partDef.Sketches.Add(partDef.WorkPlanes[3]);
            SketchEllipticalArc     Arc1, Arc2;
            SketchLine Line1, Line2;

            CreateLines(osketch, out Arc1, out Line1, parCylinder.CapRadius, parCylinder.InRadius, parCylinder.Length);

            //SketchLine line5= offsetLine<SketchLine>(osketch, Line1, 2, true);
            //SketchOffsetSpline arc5 = (SketchOffsetSpline)offsetLine(osketch, Arc1, 2, true);
            //SketchLine Line3 = osketch.SketchLines.AddByTwoPoints(Arc1.StartSketchPoint, arc5.StartSketchPoint);
            //SketchLine Line4 = osketch.SketchLines.AddByTwoPoints(Line1.EndSketchPoint, line5.EndSketchPoint);
            //osketch.GeometricConstraints.AddHorizontal((SketchEntity)Line3);
            //osketch.GeometricConstraints.AddVertical((SketchEntity)Line4);
            //osketch.GeometricConstraints.AddEqualLength(Line3, Line4);
            //osketch.DimensionConstraints.AddEllipseRadius((SketchEntity)Arc1, true, InventorTool.TranGeo.CreatePoint2d(-parCylinder.CapRadius / 2, 0));
            //osketch.DimensionConstraints.AddEllipseRadius((SketchEntity)Arc1, false, InventorTool.TranGeo.CreatePoint2d(0, -parCylinder.InRadius / 2));
            //Point2d p = InventorTool.TranGeo.CreatePoint2d((Line1.StartSketchPoint.Geometry.X + Line1.EndSketchPoint.Geometry.X) / 2, (Line1.StartSketchPoint.Geometry.Y + Line1.EndSketchPoint.Geometry.Y) / 2 + 1);
            //osketch.DimensionConstraints.AddTwoPointDistance(Line1.StartSketchPoint, Line1.EndSketchPoint, DimensionOrientationEnum.kAlignedDim, p);
            //p = InventorTool.TranGeo.CreatePoint2d((Line4.StartSketchPoint.Geometry.X + Line4.EndSketchPoint.Geometry.X) / 2 + 1, (Line4.StartSketchPoint.Geometry.Y + Line4.EndSketchPoint.Geometry.Y) / 2);
            //osketch.DimensionConstraints.AddTwoPointDistance(Line4.StartSketchPoint, Line4.EndSketchPoint, DimensionOrientationEnum.kAlignedDim, p);

            CreateLines(osketch, out Arc2, out Line2, parCylinder.CapRadius + parCylinder.Thickness, parCylinder.InRadius + parCylinder.Thickness, parCylinder.Length);
            SketchLine Line3 = osketch.SketchLines.AddByTwoPoints(Arc1.StartSketchPoint, Arc2.StartSketchPoint);
            SketchLine Line4 = osketch.SketchLines.AddByTwoPoints(Line1.EndSketchPoint, Line2.EndSketchPoint);

            osketch.GeometricConstraints.AddHorizontalAlign(Arc1.StartSketchPoint, Arc1.CenterSketchPoint);
            osketch.GeometricConstraints.AddVerticalAlign(Arc1.EndSketchPoint, Arc1.CenterSketchPoint);
            osketch.GeometricConstraints.AddHorizontal((SketchEntity)Line3);
            osketch.GeometricConstraints.AddVertical((SketchEntity)Line4);
            osketch.GeometricConstraints.AddEqualLength(Line3, Line4);
            osketch.GeometricConstraints.AddConcentric((SketchEntity)Arc1, (SketchEntity)Arc2);
            // osketch.GeometricConstraints.AddCoincident((SketchEntity)InventorTool.Origin, (SketchEntity)Arc1.CenterSketchPoint);
            osketch.DimensionConstraints.AddEllipseRadius((SketchEntity)Arc1, true, InventorTool.TranGeo.CreatePoint2d(-parCylinder.CapRadius / 2, 0));
            osketch.DimensionConstraints.AddEllipseRadius((SketchEntity)Arc1, false, InventorTool.TranGeo.CreatePoint2d(0, -parCylinder.InRadius / 2));
            Point2d p = InventorTool.TranGeo.CreatePoint2d((Line1.StartSketchPoint.Geometry.X + Line1.EndSketchPoint.Geometry.X) / 2, (Line1.StartSketchPoint.Geometry.Y + Line1.EndSketchPoint.Geometry.Y) / 2 + 1);

            osketch.DimensionConstraints.AddTwoPointDistance(Line1.StartSketchPoint, Line1.EndSketchPoint, DimensionOrientationEnum.kAlignedDim, p);
            p = InventorTool.TranGeo.CreatePoint2d((Line4.StartSketchPoint.Geometry.X + Line4.EndSketchPoint.Geometry.X) / 2 + 1, (Line4.StartSketchPoint.Geometry.Y + Line4.EndSketchPoint.Geometry.Y) / 2);
            osketch.DimensionConstraints.AddTwoPointDistance(Line4.StartSketchPoint, Line4.EndSketchPoint, DimensionOrientationEnum.kAlignedDim, p);

            CreateRibs(osketch, Line2);
            Profile        profile = osketch.Profiles.AddForSolid();
            RevolveFeature revolve = partDef.Features.RevolveFeatures.AddFull(profile, Line3, PartFeatureOperationEnum.kNewBodyOperation);
        }
Beispiel #30
0
 private void UpdateUnitValue(ParameterDto parameter, ParameterBase param)
 {
     if (parameter is AnalogParameterDto analog &&
         param is AnalogParameter analogParameterEntity)
     {
         var unit = _mapper.Map <Unit>(analog.Unit);
         _db.Entry(unit)
         .State = EntityState.Unchanged;
         analogParameterEntity.Unit = unit;
     }
 }
        public override bool Compare(ParameterBase other)
        {
            var developerModeParameter = other as DeveloperModeParameter;

            if (DeveloperModeOn != developerModeParameter?.DeveloperModeOn)
            {
                return(false);
            }

            return(true);
        }
Beispiel #32
0
 private void GetTarget()
 {
     foreach (Type type in Assembly.GetExecutingAssembly().GetTypes())
     {
         if (type.Name == parameterClassName)
         {
             PropertyInfo instanceMember = type.GetProperty("Instance");
             target = instanceMember.GetValue(null, null) as ParameterBase;
         }
     }
 }
Beispiel #33
0
        internal static IDictionary <string, object> ApplyParameter(
            [NotNull] this IDictionary <string, object> dict,
            [CanBeNull] ParameterBase paramOrNull)
        {
            if (dict == null)
            {
                throw new ArgumentNullException(nameof(dict));
            }

            paramOrNull?.SetDictionary(dict);
            return(dict);
        }
            public void HandleReport(ParameterBase reportToHandle)
            {
                if ((reportToHandle != null) && (reportToHandle.Type == typeof(string)))
                {
                    Reports.Add(reportToHandle);

                    if (reportToHandle.Name == "Combinatorial")
                    {
                        CombinatorialParameter<string> newParameter = (CombinatorialParameter<string>)reportToHandle;
                        Combinatorials.Add(newParameter.Combinatorial);
                    }
                    else if (reportToHandle.Name == "CombinatorialTier")
                    {
                        CombinatorialTierParameter<string> newParameter = (CombinatorialTierParameter<string>)reportToHandle;
                        Tier = newParameter.Tier;
                    }
                }
            }
Beispiel #35
0
 public abstract bool RemoveParameter(ParameterBase param);
Beispiel #36
0
 public override bool RemoveParameter(ParameterBase param)
 {
     return _parameters.Remove(param);
 }
Beispiel #37
0
 public TweeterQuery(ParameterBase param)
     : this()
 {
     AddParameter(param);
 }
Beispiel #38
0
 public static TweeterQuery Create(ParameterBase param)
 {
     return new TweeterQuery(param);
 }
        protected bool ParametersAreTheSame(ParameterBase comparisonFunction, ComparisonDepth depth)
        {
            if (Parameters.Count != comparisonFunction.Parameters.Count) return false;

            for (int i = 0; i < Parameters.Count; i++)
            {
                if (depth != ComparisonDepth.Signature && Parameters[i].Name != comparisonFunction.Parameters[i].Name)
                    return false;

                if (Parameters[i].DataType != comparisonFunction.Parameters[i].DataType)
                {
                    return false;
                }
            }
            return true;
        }
 public void ParameterBase_Errors()
 {
     ParameterBase testParameter = new ParameterBase();
     Assert.IsNotNull(testParameter.Errors);
 }
 public void ParameterBase_Empty()
 {
     string testName_01 = "FOO";
     string testName_02 = string.Empty;
     ParameterBase testParameter = new ParameterBase();
     testParameter.Name = testName_01;
     Assert.AreEqual(testName_01, testParameter.Name);
     testParameter.Name = testName_02;
     Assert.AreEqual(testName_02, testParameter.Name);
 }
 public void ParameterBase_Text()
 {
     ParameterBase testParameter = new ParameterBase();
     Assert.AreEqual(string.Empty, testParameter.Text);
 }
Beispiel #43
0
 public abstract void AddParameter(ParameterBase param);
 public void ParameterBase_Null()
 {
     string testName_01 = "FOO";
     string testName_02 = null;
     ParameterBase testParameter = new ParameterBase();
     testParameter.Name = testName_01;
     Assert.AreEqual(testName_01, testParameter.Name);
     testParameter.Name = testName_02;
     Assert.AreEqual(testName_01, testParameter.Name);
     Assert.IsTrue(testParameter.HasErrors);
 }
 public void ParameterBase_Type()
 {
     ParameterBase testParameter = new ParameterBase();
     Assert.AreEqual(typeof(ParameterBase).ToString(), testParameter.Type.ToString());
 }
 public CmdletParameterSwitchValuePair(string parameterSwitch, ParameterBase value)
 {
     this.ParameterSwitch = parameterSwitch;
     this.Value = value;
 }
 public void ParameterBase_HasErrors()
 {
     ParameterBase testParameter = new ParameterBase();
     Assert.IsFalse(testParameter.HasErrors);
 }