예제 #1
0
        private void FlowToVisioControl_Load(object sender, EventArgs e)
        {
            try
            {
                if (SettingsManager.Instance.TryLoad(GetType(), out FlowConnection flowConnection))
                {
                    LogWarning("Old settings file found, converting");
                    aPIConnections = new APIConns();
                    if (!string.IsNullOrEmpty(flowConnection.TenantId))
                    {
                        aPIConnections.FlowConns
                        .Add(
                            new FlowConn
                        {
                            AppId       = flowConnection.AppId,
                            TenantId    = flowConnection.TenantId,
                            Environment = flowConnection.Environment,
                            ReturnURL   = flowConnection.ReturnURL,
                            UseDev      = flowConnection.UseDev,
                            Name        = "Flow Connection"
                        });
                    }
                    if (!string.IsNullOrEmpty(flowConnection.SubscriptionId))
                    {
                        aPIConnections.LogicAppConns
                        .Add(
                            new LogicAppConn
                        {
                            AppId          = flowConnection.LAAppId,
                            TenantId       = flowConnection.LATenantId,
                            ReturnURL      = flowConnection.LAReturnURL,
                            SubscriptionId = flowConnection.SubscriptionId,
                            UseDev         = flowConnection.UseDev,
                            Name           = "LA Connection"
                        });
                    }

                    return;
                }
            }
            catch (Exception)
            {
            }
            if (!SettingsManager.Instance.TryLoad(GetType(), out aPIConnections))
            {
                aPIConnections = new APIConns();

                LogWarning("Settings not found => a new settings file has been created!");
            }

            chkShowConCurrency.Checked       = aPIConnections.Display.ShowConCurrency;
            chkShowSecure.Checked            = aPIConnections.Display.ShowSecure;
            chkShowCustomTracking.Checked    = aPIConnections.Display.ShowTrackingID;
            chkShowTrackedProps.Checked      = aPIConnections.Display.ShowTrackedProps;
            chkShowTriggerConditions.Checked = aPIConnections.Display.ShowTriggers;
            chkShowComments.Checked          = aPIConnections.Display.ShowComments;
        }
예제 #2
0
        public ApiConnection(APIConns apiConnections, bool logicApp)
        {
            InitializeComponent();
            apiConns = apiConnections;

            LogicApp = logicApp;

            if (!LogicApp)
            {
                if (apiConns.FlowConns.Any())
                {
                    cboFlowConns.Items.AddRange(apiConns.FlowConns.ToArray());
                    cboFlowConns.SelectedIndex = 0;
                }
                else
                {
                    EnableControls();
                    cboFlowConns.Enabled = false;

                    chkUseDevApp.CheckedChanged += ChkUseDevApp_CheckedChanged;
                }
            }
            else if (apiConns.LogicAppConns.Any())
            {
                cboLAConns.Items.AddRange(apiConns.LogicAppConns.ToArray());
                cboLAConns.SelectedIndex = 0;
            }
            else
            {
                EnableControls();
                cboLAConns.Enabled       = false;
                chkLADev.CheckedChanged += ChkLADev_CheckedChanged;
            }

            panelFlow.Visible     = !LogicApp;
            panelLogicApp.Visible = LogicApp;
        }