コード例 #1
0
ファイル: MainVM.cs プロジェクト: jhlbocan/iom-examples
        /// <summary>
        /// Constructor
        /// </summary>
        public MainVM()
        {
            connections    = new ObservableCollection <ConnectionVM>();
            ideaStatiCaDir = Properties.Settings.Default.IdeaStatiCaDir;
            if (Directory.Exists(ideaStatiCaDir))
            {
                string ideaConnectionFileName = Path.Combine(ideaStatiCaDir, "IdeaConnection.exe");
                if (File.Exists(ideaConnectionFileName))
                {
                    IsIdea        = true;
                    StatusMessage = string.Format("IdeaStatiCa installation was found in '{0}'", ideaStatiCaDir);
                    CalcFactory   = new ConnHiddenClientFactory(ideaStatiCaDir);
                }
            }

            if (!IsIdea)
            {
                StatusMessage = string.Format("ERROR IdeaStatiCa doesn't exist in '{0}'", ideaStatiCaDir);
            }

            OpenProjectCmd          = new OpenProjectCommand(this);
            ImportIOMCmd            = new ImportIOMCommand(this);
            CloseProjectCmd         = new CloseProjectCommand(this);
            CalculateConnectionCmd  = new CalculateConnectionCommand(this);
            ConnectionGeometryCmd   = new ConnectionGeometryCommand(this);
            SaveAsProjectCmd        = new SaveAsProjectCommand(this);
            ConnectionToTemplateCmd = new ConnectionToTemplateCommand(this);
            ApplyTemplateCmd        = new ApplyTemplateCommand(this);
        }
コード例 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainVM()
        {
            NewBoltAssemblyName = "M12 4.6";
            SupportingMember    = 1;
            AttachedMember      = 2;
            connections         = new ObservableCollection <ConnectionVM>();
            ideaStatiCaDir      = Properties.Settings.Default.IdeaStatiCaDir;
            if (Directory.Exists(ideaStatiCaDir))
            {
                ideaConnExeFileName = Path.Combine(ideaStatiCaDir, "IdeaConnection.exe");
                if (File.Exists(ideaConnExeFileName))
                {
                    IsIdea        = true;
                    StatusMessage = string.Format("IdeaStatiCa installation was found in '{0}'", ideaStatiCaDir);
                    CalcFactory   = new ConnHiddenClientFactory(ideaStatiCaDir);
                }
            }

            if (!IsIdea)
            {
                StatusMessage = string.Format("ERROR IdeaStatiCa doesn't exist in '{0}'", ideaStatiCaDir);
            }

            OpenProjectCmd          = new OpenProjectCommand(this);
            ImportIOMCmd            = new ImportIOMCommand(this);
            CloseProjectCmd         = new CloseProjectCommand(this);
            CalculateConnectionCmd  = new CalculateConnectionCommand(this);
            ApplySimpleTemplateCmd  = new ApplySimpleTemplateCommand(this);
            ConnectionGeometryCmd   = new ConnectionGeometryCommand(this);
            SaveAsProjectCmd        = new SaveAsProjectCommand(this);
            ConnectionToTemplateCmd = new ConnectionToTemplateCommand(this);
            ApplyTemplateCmd        = new ApplyTemplateCommand(this);

            GetMaterialsCmd             = new GetMaterialsCommand(this);
            GetCrossSectionsCmd         = new GetCrossSectionsCommand(this);
            GetBoltAssembliesCmd        = new GetBoltAssembliesCommand(this);
            CreateBoltAssemblyCmd       = new CreateBoltAssemblyCommand(this);
            GetParametersCmd            = new GetParametersCommand(this);
            GetLoadingCmd               = new GetLoadingCommand(this);
            GetConnCheckResultsCmd      = new GetConnCheckResults(this);
            GetAllConnectionDataCmd     = new GetAllConnDataCommand(this);
            ShowConHiddenCalcLogFileCmd = new ShowConHiddenCalcLogFileCommand();
            OpenTempProjectCmd          = new CustomCommand(CanRunIdeaConnection, RunIdeaConnection);

            ShowConHiddenCalcLogFileCmd = new ShowConHiddenCalcLogFileCommand();

            TemplateSetting = new IdeaRS.OpenModel.Connection.ApplyConnTemplateSetting()
            {
                DefaultBoltAssemblyID = 1, DefaultCleatCrossSectionID = 1, DefaultConcreteMaterialID = 1, DefaultStiffMemberCrossSectionID = 1
            };

            jsonSerializerSettings = new JsonSerializerSettings {
                ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver(), Culture = CultureInfo.InvariantCulture
            };

            var jsonFormating = Formatting.Indented;

            this.templateSettingString = JsonConvert.SerializeObject(TemplateSetting, jsonFormating, jsonSerializerSettings);
        }
コード例 #3
0
        /// <summary>
        /// アカウント設定ビュー用モデルクラス 初期化
        /// </summary>
        /// <param name="tenant">テナント接続情報</param>
        public MainViewModel(TenantConnectionInfo tenant, Action action)
        {
            // 引数を保管
            Tenant  = tenant;
            _action = action;

            // イベント
            SearchCommand        = new SearchCommand(this);
            GetTemplateCommand   = new GetTemplateCommand(this);
            ApplyTemplateCommand = new ApplyTemplateCommand(this);
            SaveLogCommand       = new SaveLogCommand(this);
            ClearLogCommand      = new ClearLogCommand(this);
        }