示例#1
0
        public FeatureSerializable GetSelectedFeatureCommonShallowCopy(string FileType, string FileName, string T4Template)
        {
            FeatureSerializable result = null;

            if (SelectedFeature == null)
            {
                return(result);
            }
            result = SelectedFeature.FeatureContextSerializableGetShallowCopy();

            CommonStaffSerializable commonStaffItem =
                result.CommonStaffs.Where(c => c.FileType == FileType).FirstOrDefault();

            if (commonStaffItem == null)
            {
                result.CommonStaffs.Add(
                    commonStaffItem = new CommonStaffSerializable()
                {
                    FileType = FileType
                });
            }
            commonStaffItem.FileName    = FileName;
            commonStaffItem.FileProject = this.DestinationProjectName;
            commonStaffItem.FileDefaultProjectNameSpace = this.DefaultProjectNameSpace;
            commonStaffItem.FileFolder = this.DestinationFolder;
            commonStaffItem.T4Template = T4Template;
            return(result);
        }
示例#2
0
 private void OnSearchKeyChanged(string searchKey)
 {
     if (SelectedFeature != null)
     {
         SelectedFeature.AssignSearchProperties();
     }
 }
示例#3
0
 public string ToJSON()
 {
     if (SelectedFeature == null)
     {
         // Only send the ID
         if (Cursor == null)
         {
             return(string.Format(@"{{ ""id"": ""{0}"", ""name"": ""{1}"", ""selectionColor"": {{ ""r"": {2}, ""g"": {3}, ""b"": {4}, ""a"": {5} }}, }}",
                                  id, Name, selectionColor.r, selectionColor.g, selectionColor.b, selectionColor.a));
         }
         else
         {
             return(string.Format(@"{{ ""id"": ""{0}"", ""name"": ""{1}"", ""selectionColor"": {{ ""r"": {2}, ""g"": {3}, ""b"": {4}, ""a"": {5} }}, ""cursor"":{{""xpos"":{6},""ypos"":{7},""zpos"":{8},""xrot"":{9},""yrot"":{10},""zrot"":{11} }}, {12}}}",
                                  id, Name, selectionColor.r, selectionColor.g, selectionColor.b, selectionColor.a, Cursor.transform.position.x, Cursor.transform.position.y, Cursor.transform.position.z, Cursor.transform.rotation.x, Cursor.transform.rotation.y, Cursor.transform.rotation.z, CursorLocationToJSON()));
         }
     }
     else
     {
         Func <float, float> nearZero = x => Math.Abs(x) < 0.0001 ? 0F : x;
         if (Cursor == null)
         {
             return(string.Format(@"{{ ""id"": ""{0}"", ""name"": ""{6}"", ""selectedFeature"": {1}, ""selectionColor"": {{ ""r"": {2}, ""g"": {3}, ""b"": {4}, ""a"": {5} }} }}", id, SelectedFeature.ToLimitedJSON(), selectionColor.r, selectionColor.g, selectionColor.b, selectionColor.a, Name));
         }
         else
         {
             return(string.Format(@"{{ ""id"": ""{0}"", ""name"": ""{6}"", ""selectedFeature"": {1}, ""selectionColor"": {{ ""r"": {2}, ""g"": {3}, ""b"": {4}, ""a"": {5} }}, ""cursor"":{{""xpos"":{7},""ypos"":{8},""zpos"":{9},""xrot"":{10},""yrot"":{11},""zrot"":{12} }}, {13}}}",
                                  id, SelectedFeature.ToLimitedJSON(), selectionColor.r, selectionColor.g, selectionColor.b, selectionColor.a, Name,
                                  nearZero(Cursor.transform.position.x), nearZero(Cursor.transform.position.y), nearZero(Cursor.transform.position.z),
                                  nearZero(Cursor.transform.rotation.x), nearZero(Cursor.transform.rotation.y), nearZero(Cursor.transform.rotation.z),
                                  CursorLocationToJSON()));
         }
     }
 }
示例#4
0
 private void OnAnalyticIsDirtyChanged(bool isDirty)
 {
     if (isDirty)
     {
         SelectedFeature.SelectedStep.IsCompleted = false;
         SelectedFeature.DisableRemainingSteps();
     }
 }
        private void GetEntityFromService(DTO.ModuleFeatureStepActionType actionType)
        {
            SelectedFeature.RestoreSelectedSearchGroup();
            int searchGroupId = _selectedEntity.OwningSearchGroupId;
            int entityId      = _selectedEntity.Id;

            //TODO: update client services method to take actionType parameter.
            //var response = _analyticDisplayServices.LoadAnalytic(sourceAnalytic, entityId, searchGroupId, (int)actionType);
        }
示例#6
0
        private void OnDriverDirtyChanged(bool isDirty)
        {
            if (isDirty)
            {
                SelectedFeature.SelectedStep.IsCompleted = false;
                SelectedFeature.DisableRemainingSteps();
            }

            //Update dependent calculated properties.
            this.RaisePropertyChanged("IsAnyValueDriverDirty");
        }
示例#7
0
        private void OnFilterGroupChanged(IReactivePropertyChangedEventArgs <FilterGroup> args)
        {
            var source = args.Sender as FilterGroup;

            if (source != null && source.IsDirty)
            {
                SelectedFeature.SelectedStep.IsCompleted = false;
                SelectedFeature.DisableRemainingSteps();
            }

            //Update dependent calculated properties.
            this.RaisePropertyChanged("ValidationResults");
            this.RaisePropertyChanged("IsAnyFilterGroupDirty");
        }
示例#8
0
        //TODO: flesh out implementation. This is a starting point only.
        private void HandleSelectedAction(DisplayEntities.Action action)
        {
            switch (action.TypeId)
            {
            //Create a new current entity.
            case DTO.ModuleFeatureStepActionType.PlanningAnalyticsSearchAnalyticsNew:
                //Create a new (blank) entity. TODO: refactor.
                var newAnalytic = new DisplayEntities.Analytic();
                newAnalytic.Identity.Name        = "Analytic name (new)";
                newAnalytic.Identity.Description = "Description (new)";
                newAnalytic.IsDirty = true;

                SelectedAnalytic             = newAnalytic;
                SelectedFeature.SelectedStep = SelectedFeature.DefaultActionStep;
                SelectedFeature.DisableRemainingSteps();
                break;

            case DTO.ModuleFeatureStepActionType.PlanningEverydayPricingSearchEverydayNew:
            case DTO.ModuleFeatureStepActionType.PlanningPromotionPricingSearchPromotionsNew:
            case DTO.ModuleFeatureStepActionType.PlanningKitPricingSearchKitsNew:
                //Create a new (blank) entity. TODO: refactor.
                var newPriceRoutine = new DisplayEntities.Pricing();
                newPriceRoutine.Identity.Name        = "Analytic name (new)";
                newPriceRoutine.Identity.Description = "Description (new)";
                newPriceRoutine.IsDirty = true;

                SelectedPriceRoutine         = newPriceRoutine;
                SelectedFeature.SelectedStep = SelectedFeature.DefaultActionStep;
                SelectedFeature.DisableRemainingSteps();
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningAnalyticsSearchAnalyticsEdit:
                SelectedFeature.SelectedStep = SelectedFeature.DefaultActionStep;
                ExecuteAsyncCommand(LoadAnalyticCommand, x => SelectedFeatureViewModel = GetViewModel(SelectedStep), "Retrieving analytic...", "Analytic was successfully retrieved.");
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningEverydayPricingSearchEverydayEdit:
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningPromotionPricingSearchPromotionsEdit:
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningKitPricingSearchKitsEdit:
                //TODO: get the full entity from the server and load edit screen.
                //This is a simulation only.
                SelectedPriceRoutine         = SelectedEntity as DisplayEntities.Pricing;
                SelectedFeature.SelectedStep = SelectedFeature.DefaultActionStep;
                break;

            //Copy current entity.
            case DTO.ModuleFeatureStepActionType.PlanningAnalyticsSearchAnalyticsCopy:
                //Create a copy of the existing entity and load edit screen.
                SelectedAnalytic             = SelectedAnalytic.Copy();
                SelectedFeature.SelectedStep = SelectedFeature.DefaultActionStep;
                SelectedFeature.DisableRemainingSteps();
                break;

            case DTO.ModuleFeatureStepActionType.PlanningPromotionPricingSearchPromotionsCopy:
            case DTO.ModuleFeatureStepActionType.PlanningEverydayPricingSearchEverydayCopy:
            case DTO.ModuleFeatureStepActionType.PlanningKitPricingSearchKitsCopy:
                //Create a copy of the existing entity and load edit screen.
                SelectedPriceRoutine         = SelectedPriceRoutine.Copy();
                SelectedFeature.SelectedStep = SelectedFeature.DefaultActionStep;
                SelectedFeature.DisableRemainingSteps();
                break;

            //Save the current entity.
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningAnalyticsIdentitySave:
                //TODO: call analytic save method on service.
                ExecuteAsyncCommand(SaveAnalyticIdentityCommand, x => SelectedFeatureViewModel = GetViewModel(SelectedStep), "Identity saving...", "Identity saved.");
                SelectedAnalytic.IsDirty = false;
                SelectedFeature.EnableRemainingSteps();
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningEverydayPricingIdentitySave:
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningPromotionPricingIdentitySave:
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningKitPricingIdentitySave:
                //TODO: call price routine save method on service.
                SelectedPriceRoutine.IsDirty = false;
                SelectedFeature.EnableRemainingSteps();
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningAnalyticsFiltersSave:
                ExecuteAsyncCommand(SaveFiltersCommand, x => SelectedFeatureViewModel = GetViewModel(SelectedStep), "Filters saving...", "Filters saved.");
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningAnalyticsPriceListsSave:
                ExecuteAsyncCommand(SavePriceListsCommand, x => SelectedFeatureViewModel = GetViewModel(SelectedStep), "Price Lists saving...", "Price Lists saved.");
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningAnalyticsValueDriversSave:
                ExecuteAsyncCommand(SaveValueDriversCommand, x => SelectedFeatureViewModel = GetViewModel(SelectedStep), "Value Drivers saving...", "Value Drivers saved.");
                break;

            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningEverydayPricingPriceListsSave:
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningPromotionPricingPriceListsSave:
            case APLPX.Client.Entity.ModuleFeatureStepActionType.PlanningKitPricingPriceListsSave:
                break;
            }
        }