private void OnSaveSettings(object obj)
        {
            // Command = MobileDeliveryGeneral.Definitions.MsgTypes.eCommand.LoadSettings,
            //jsonify the settings into UMDConfig and persist the obj.
            var umdcfg = new UMDAppConfig()
            {
                LogLevel = (MobileDeliveryLogger.LogLevel)Enum.Parse(typeof(MobileDeliveryLogger.LogLevel), settings.LogLevel),
                AppName  = settings.AppName,
                LogPath  = settings.LogPath,
                SQLConn  = settings.SQLConn,
                srvSet   = new SocketSettings()
                {
                    url        = settings.Url,
                    port       = (ushort)settings.Port,
                    srvport    = (ushort)settings.UMDPort,
                    srvurl     = settings.UMDUrl,
                    clienturl  = settings.WinsysUrl,
                    clientport = (ushort)settings.WinsysPort
                },
                // Version=
                // winsysFiles
            };

            settings.Url = URL;

            base.Refresh(settings);
        }
        public static UMDAppConfig LoadConfig()
        {
            string zt = Settings.Url;// set;

            var cf = new UMDAppConfig();

            cf.InitSrvSet();
            cf.AppName           = Settings.AppName;
            cf.LogLevel          = (MobileDeliveryLogger.LogLevel)Enum.Parse(typeof(MobileDeliveryLogger.LogLevel), Settings.LogLevel);
            cf.LogPath           = Settings.LogPath;
            cf.SQLConn           = Settings.SQLConn;
            cf.srvSet.port       = (ushort)Settings.Port;
            cf.srvSet.url        = Settings.Url;
            cf.srvSet.clientport = (ushort)Settings.WinsysPort;
            cf.srvSet.clienturl  = Settings.WinsysUrl;
            cf.srvSet.srvurl     = Settings.UMDUrl;
            cf.srvSet.srvport    = (ushort)Settings.UMDPort;

            cf.Version = string.Format("Version: {0}.{1}.{2}.{3}",
                                       Package.Current.Id.Version.Major,
                                       Package.Current.Id.Version.Minor,
                                       Package.Current.Id.Version.Build,
                                       Package.Current.Id.Version.Revision);

            return(cf);
        }
 public frmManifestGenerator(UMDAppConfig config, Logger log)
 {
     logger = log;
     Init(config);
     InitializeComponent();
     // ViewModel Instance
     mvm = new ManifestVM(config);
 }
Пример #4
0
        public WalletServer(UMDAppConfig config)
        {
            Logger.Info($"WalletServer::Websocket connection: {config.srvSet.srvurl}");

            conn = new ClientToServerConnection(
                config.srvSet, ref sm, rm);
            conn.Connect();
        }
 public SettingsVM(UMDAppConfig config) : base(config.srvSet, config.AppName)
 {
     //settings = new Settings()
     //{
     //    Command = MobileDeliveryGeneral.Definitions.MsgTypes.eCommand.LoadSettings,
     //    LogLevel = config.LogLevel.ToString(),
     //    Url = config.srvSet.url,
     //    Port  = config.srvSet.port,
     //    UMDUrl = config.srvSet.srvurl,
     //    UMDPort = config.srvSet.srvport,
     //    WinsysUrl = config.srvSet.clienturl,
     //    WinsysPort = config.srvSet.clientport
     //};
 }
Пример #6
0
        public MainPage()
        {
            InitializeComponent();

            masterPage.listView.ItemSelected += OnItemSelected;

            if (Device.RuntimePlatform == Device.UWP)
            {
                MasterBehavior = MasterBehavior.Popover;
                //Load UWP Settings
                string       url = SettingsAPI.UMDUrl;
                UMDAppConfig cfg = SettingsAPI.LoadConfig();
            }
        }
        private static void UpdateConfig(UMDAppConfig config)
        {
            if (config.srvSet == null)
            {
                config.srvSet = new SocketSettings()
                {
                    name       = "defaultName",
                    port       = 81,
                    url        = "localhost",
                    srvport    = 81,
                    srvurl     = "localhost",
                    clientport = 8181,
                    clienturl  = "localhost"
                };
            }
            if (config.winsysFiles == null)
            {
                config.winsysFiles = new WinsysFiles()
                {
                    WinsysDstFile = MobileDeliveryGeneral.Utilities.HomeDirectoryPaths.GetUserHome(config.AppName),
                    WinsysSrcFile = @"\\Fs01\vol1\Winsys32\DATA"
                };
            }

            _config = new UMDAppConfig()
            {
                AppName  = config.AppName,
                LogLevel = config.LogLevel,
                LogPath  = config.LogPath,

                srvSet = new SocketSettings()
                {
                    name       = config.srvSet.name,
                    port       = config.srvSet.port,
                    url        = config.srvSet.url,
                    srvurl     = config.srvSet.srvurl,
                    srvport    = config.srvSet.srvport,
                    clientport = config.srvSet.clientport,
                    clienturl  = config.srvSet.clienturl
                },

                Version = config.Version,

                winsysFiles = new WinsysFiles()
                {
                    WinsysDstFile = config.winsysFiles.WinsysDstFile, WinsysSrcFile = config.winsysFiles.WinsysSrcFile
                }
            };
        }
        public void Init(UMDAppConfig config)
        {
            rm      = new ReceiveMsgDelegate(ReceiveMessage);
            pmRx    = new ProcessMsgDelegateRXRaw(HandleClientCmd);
            AppName = config.AppName;
            Logger.Debug($"{config.AppName} Connection init");

            if (config.srvSet == null)
            {
                Logger.Error($"{config.AppName} Missing Configuration Server Settings");
                throw new Exception($"{config.AppName} Missing Configuration Server Settings.");
            }

            // wsrv = new WalletServer(config);
        }
        public void Init(UMDAppConfig config)
        {
            rm      = new ReceiveMsgDelegate(ReceiveMessage);
            pmRx    = new ProcessMsgDelegateRXRaw(HandleClientCmd);
            AppName = config.AppName;
            Logger.Debug($"{config.AppName} Connection init");

            if (config.srvSet == null)
            {
                Logger.Error($"{config.AppName} Missing Configuration Server Settings");
                throw new Exception($"{config.AppName} Missing Configuration Server Settings.");
            }

            conn = new ClientToServerConnection(config.srvSet, ref sm, rm);
            conn.Connect();

            UMDServer = new UMDManifest(config.SQLConn);

            drillDown = new ManifestDetails(sm, rm, pmRx);
        }
Пример #10
0
        public void Init(UMDAppConfig config)
        {
            rm            = new ReceiveMsgDelegate(ReceiveMessage);
            WinsysTxFiles = new WinSysDBFile(config.winsysFiles.WinsysSrcFile, config.winsysFiles.WinsysDstFile);
            ft            = new FileTransfer(WinsysTxFiles);
            ft.LoadFiles();
            pmRx    = new ProcessMsgDelegateRXRaw(HandleClientCmd);
            AppName = config.AppName;
            Logger.Debug($"{config.AppName} Connection init");

            if (config.srvSet == null)
            {
                Logger.Error($"{config.AppName} Missing Configuration Server Settings");
                throw new Exception($"{config.AppName} Missing Configuration Server Settings.");
            }
            conn = new UMDServerConnection(config.srvSet, ref sm, rm);
            conn.Connect();

            UMDServer = new UMDManifest();

            drillDown = new ManifestDetails(sm, rm, pmRx);
        }
 public void Init(UMDAppConfig config)
 {
     this.config = config;
 }
Пример #12
0
 public AccountsReceivableVM(UMDAppConfig config) : base(config.srvSet, config.AppName)
 {
     Init();
 }
Пример #13
0
 public ManifestVM(UMDAppConfig config) : base(config.srvSet, config.AppName)
 {
     Init();
 }