public void Create(MeetingDto meetingModel, AppType appType, Guid syncId)
 {
     var userName = securityService.GetCurrentUserName();
     switch ((MeetingType)meetingModel.MeetingType)
     {
         case MeetingType.Working:
             {
                 var command = RMSMapper.Map<MeetingDto, CreateWorkingMeetingCmd>(meetingModel);
                 command.AppType = appType;
                 command.ActionOwnerUserName = userName;
                 command.SyncId = syncId;
                 meetingService.CreateWorkingMeeting(command);
             }
             break;
         case MeetingType.NonWorking:
             {
                 var command = RMSMapper.Map<MeetingDto, CreateNonWorkingMeetingCmd>(meetingModel);
                 command.AppType = appType;
                 command.ActionOwnerUserName = userName;
                 command.SyncId = syncId;
                 meetingService.CreateNonWorkingMeeting(command);
             }
             break;
         default:
             throw new Exception("MeetingType is not set correctlly");
     }
 }
 public GXOptionsForm(AppType type, GXAmi ami)
 {
     InitializeComponent();
     //We do not need device editor tab at this moment.
     tabControl1.TabPages.Remove(DeviceEditorTab);
     AmiForm = ami;
     GetDevicesAutomaticallyCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.GetDevicesAutomatically;
     GetDataCollectorsAutomaticallyCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.GetDataCollectorsAutomatically;
     ShowDevicesCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.DeviceTreeShowDevices;
     ShowCategoriesCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.DeviceTreeShowCategories;
     ShowTablesCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.DeviceTreeShowTables;
     ShowPropertiesCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.DeviceTreeShowProperties;
     ShowPropertyValueCB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.DeviceTreeShowPropertyValue;
     AddressTB.Text = Gurux.DeviceSuite.Properties.Settings.Default.AmiHostName.Replace("http://", "");            
     this.MaximimErrorCountTB.Text = Gurux.DeviceSuite.Properties.Settings.Default.ErrorMaximumCount.ToString();
     this.MaximimTraceCountTB.Text = Gurux.DeviceSuite.Properties.Settings.Default.TraceMaximumCount.ToString();
     EnableAMICB.Checked = Gurux.DeviceSuite.Properties.Settings.Default.AmiEnabled;
     switch (type)
     {
         case AppType.Ami:
             tabControl1.SelectedTab = AmiTab;
         break;
         case AppType.Director:
         tabControl1.SelectedTab = DirectorTab;
         break;
         case AppType.Editor:
         tabControl1.SelectedTab = DeviceEditorTab;
         break;
     }            
 }        
 public List<MeetingHistoryDto> GetMeetingHistories(AppType meetingId, Guid syncId)
 {
     var userName = securityService.GetCurrentUserName();
     var meeting = meetingRepository.GetBy(syncId);
     var res = meeting.MeetingHistories;
     return res.Select(RMSMapper.Map<MeetingHistory, MeetingHistoryDto>).ToList();
 }
Esempio n. 4
0
 public DeleteMeetingCmd(long id, string actionOwnerUserName, AppType appType, Guid syncId)
 {
     Id = id;
     ActionOwnerUserName = actionOwnerUserName;
     AppType = appType;
     SyncId = syncId;
 }
Esempio n. 5
0
        public void Start(AppType appType, string installationFolder)
        {
            _logger.Info("Starting NzbDrone");
            if (appType == AppType.Service)
            {
                try
                {
                    StartService();

                }
                catch (InvalidOperationException e)
                {
                    _logger.Warn("Couldn't start NzbDrone Service (Most likely due to permission issues). falling back to console.", e);
                    StartConsole(installationFolder);
                }
            }
            else if (appType == AppType.Console)
            {
                StartConsole(installationFolder);
            }
            else
            {
                StartWinform(installationFolder);
            }
        }
Esempio n. 6
0
 public CancelMeetingCmd(long meetingId, Guid syncId, string actionOwnerUserName, AppType appType)
 {
     SyncId = syncId;
     MeetingId = meetingId;
     ActionOwnerUserName = actionOwnerUserName;
     AppType = appType;
 }
Esempio n. 7
0
		public static bool Is(this AppType a, AppType b)
		{
			if ((a & b) != 0)
			{
				return true;
			}
			return false;
		}
 public Server(int port, string virtualPath, string physicalPath, IPAddress listenAddress, AppType type)
 {
     _port = port;
     _virtualPath = virtualPath;
     _physicalPath = physicalPath.EndsWith("\\", StringComparison.Ordinal) ? physicalPath : physicalPath + "\\";
     _listenAddress = listenAddress;
     _appType = type;
 }
 public AzureCommandFactory(AppType appType)
 {
     var catalog = new AggregateCatalog();
     catalog.Catalogs.Add(new DirectoryCatalog(AppDomain.CurrentDomain.BaseDirectory, "KonfDB*.dll"));
     var container = new CompositionContainer(catalog);
     _commands = container.GetExportedValues<ICommand>().Where(x => (x.Type & appType) == appType);
     Commands = _commands.ToList();
 }
Esempio n. 10
0
 public TrackUsage(IAppSettings appSettings, IInternalSettings internalSettings, InstanceType instanceType, AppType appType)
 {
     this.instanceType = instanceType;
     this.appType = appType;
     trackingEnabled = appSettings.UsageTracking;
     SetTrackingQueryString(internalSettings);
     SetupBrowser();
     TrackAppUsage(TrackingType.AppLoad);
 }
Esempio n. 11
0
 public CommandFactory(AppType appType = AppType.Server)
 {
     var catalog = new AggregateCatalog();
     catalog.Catalogs.Add(new DirectoryCatalog(@".", "*.dll"));
     catalog.Catalogs.Add(new DirectoryCatalog(@".", "*.exe"));
     var container = new CompositionContainer(catalog);
     _commands = container.GetExportedValues<ICommand>().Where(x => (x.Type & appType) == appType);
     Commands = _commands.ToList();
 }
Esempio n. 12
0
        public WorkingMeeting(string subject,
                                    DateTime startDate,
                                    int duration,
                                    string description,
                                    Location location, string attendeesName, string agenda, Guid syncId, AppType appType, User creator)
            : base(subject, startDate, duration, description, location, attendeesName, agenda, syncId, appType, creator)
        {

        }
Esempio n. 13
0
 public static string ToLabel(this AppSubType subType, AppType type)
 {
     switch (subType)
     {
         case AppSubType.Single:
             return type == AppType.Visa ? "单人" : "单认证";
         case AppSubType.NonSingle:
         default:
             return type == AppType.Visa ? "团体" : "双认证";
     }
 }
Esempio n. 14
0
        public App(string name, AppType type)
        {
            #region Preconditions

            if (name == null)
                throw new ArgumentNullException(nameof(name));

            #endregion

            Name = name;
            Type = type;
        }
 public void PostByApp(AppType appType, Guid syncId, MeetingOperationEnum meetingOperation)
 {
     if (meetingOperation == MeetingOperationEnum.Approve)
         meetingService.Approve(0, syncId,appType);
     else if (meetingOperation == MeetingOperationEnum.Hold)
         meetingService.Hold(0, syncId, appType);
     else if (meetingOperation == MeetingOperationEnum.Cancel)
         meetingService.Cancel(0, syncId, appType);
     else if (meetingOperation == MeetingOperationEnum.Revert)
         meetingService.Revert(0, syncId, appType);
     else
         throw new InvalidOperationException(meetingOperation + "is invalid");
 }
Esempio n. 16
0
        public static App NewInstance(string appname, AppType apptype, string apppath, User user, LogType logtype, List<string> connections)
        {
            App app = new App();

            app.AppName = appname;
            app.AppType = apptype;
            app.AppPath = apppath;
            app.LogType = logtype;
            app.CurrentUser = user;
            app.Connections = connections;

            return app;
        }
Esempio n. 17
0
 public UserAppInfo CreateUserApp(long userId, AppType appType)
 {
     try {
         int appId = (int)appType;
         UserAppRow userAppRow = new UserAppRow() { AppId = appId, UserId = userId };
         db.Insert(userAppRow);
         return db.Single<UserAppInfo>(GetUserAppInfoJoin(userId, appType));
     }
     //TODO: Add logging of error
     catch(Exception e) {
         Console.Out.WriteLine(e.Message);
     }
     return null;
 }
        public void Configure(Server server, int port, string virtualPath, string physicalPath)
        {
            _server = server;

            _port = port;
            _installPath = null;
            _virtualPath = virtualPath;
            _appType = server.AppType;

            _lowerCasedVirtualPath = CultureInfo.InvariantCulture.TextInfo.ToLower(_virtualPath);
            _lowerCasedVirtualPathWithTrailingSlash = virtualPath.EndsWith("/", StringComparison.Ordinal) ? virtualPath : virtualPath + "/";
            _lowerCasedVirtualPathWithTrailingSlash = CultureInfo.InvariantCulture.TextInfo.ToLower(_lowerCasedVirtualPathWithTrailingSlash);
            _physicalPath = physicalPath;
            _physicalClientScriptPath = HttpRuntime.AspClientScriptPhysicalPath + "\\";
            _lowerCasedClientScriptPathWithTrailingSlash = CultureInfo.InvariantCulture.TextInfo.ToLower(HttpRuntime.AspClientScriptVirtualPath + "/");
        }
 public SubscriptionStateInternal(SubscriptionState subState)
 {
     this.IsInstalled = subState.IsInstalled;
     this.IsShellVisible = subState.IsShellVisible;
     this.CurrentBind = subState.CurrentBind;
     this.PreviousBind = subState.PreviousBind;
     this.PendingBind = subState.PreviousBind;
     this.PendingDeployment = subState.PendingDeployment;
     this.ExcludedDeployment = subState.ExcludedDeployment;
     this.DeploymentProviderUri = subState.DeploymentProviderUri;
     this.MinimumRequiredVersion = subState.MinimumRequiredVersion;
     this.LastCheckTime = subState.LastCheckTime;
     this.UpdateSkippedDeployment = subState.UpdateSkippedDeployment;
     this.UpdateSkipTime = subState.UpdateSkipTime;
     this.appType = subState.appType;
 }
Esempio n. 20
0
 protected Meeting(string subject,
     DateTime startDate,
     int duration,
     string description,
     Location location, string attendeesName, string agenda, Guid syncId, AppType appType, User creator)
     : base(syncId, appType)
 {
     CreatorUser = creator;
     State = MeetingState.Scheduled;
     SetMeetingDateTime(startDate, duration);
     setProperties(subject, description,
         location, attendeesName, agenda);
     AddMeetingHistory(StateCode,MeetingOperationEnum.Create);
     SetInitializedState(appType);
     
 }
Esempio n. 21
0
        public MainForm()
        {
            InitializeComponent();
            appName = System.AppDomain.CurrentDomain.FriendlyName;

            if (appName.ToLower().Contains("client"))
            {
                appType = AppType.CLIENT;
                radServer.Hide();
                radClient.Checked = true;
            }
            else if (appName.ToLower().Contains("server"))
            {
                appType = AppType.SERVER;
                radClient.Hide();
                radServer.Checked = true;
            }
        }
Esempio n. 22
0
        public ObjectValueResult CreateUserApp(Token token, AppType appType)
        {
            bool isValid = isValidToken((int)token.UserId, token.TokenString);
            if(!isValid) {
                return new ObjectValueResult(new String[] { Result.INVALID_TOKEN_ERROR });
            }

            UserAppProvider appProvider = new UserAppProvider();
            UserAppInfo userAppInfo = appProvider.GetUserApp(token.UserId, appType);
            if(userAppInfo != null) {
                return new ObjectValueResult(new String[] { Result.USER_APP_EXISTS_ERROR });
            }

            userAppInfo = appProvider.CreateUserApp(token.UserId, appType);
            if(userAppInfo == null) {
                return new ObjectValueResult(new String[] { APP_CREATION_FAILURE });
            }
            return new ObjectValueResult(userAppInfo);
        }
Esempio n. 23
0
 private void OnLoginStateLoadingCompleteCallback(LoginManager sender,AppType appType)
 {
     sender.StateLoadingCompleted -= OnLoginStateLoadingCompleteCallback;
     if (AppType.Mobile == appType)
     {
         Token token = SessionManager.Default.GetToken(_Request.ClientInfo.Session);
         _Request.UpdateContent(new PacketContent( Mobile.Manager.Login(token)));
         SendCenter.Default.Send(_Request);
     }
     else if (appType == AppType.CppTrader)
     {
         LoginResult result = new LoginResult { SessionId = _Request.ClientInfo.Session.ToString(), ServerDateTime=DateTime.Now.ToStandrandDateTimeStr() };
         _Request.UpdateContent(JsonResponse.NewResult(_Request.ClientInfo.ClientInvokeId,result));
         SendCenter.Default.Send(_Request);
     }
     if (System.Configuration.ConfigurationManager.AppSettings["MobileDebug"] == "true")
     {
     }
 }
 public void Reset()
 {
     this.IsInstalled = this.IsShellVisible = false;
     this.CurrentBind = this.PreviousBind = (DefinitionAppId) (this.PendingBind = null);
     this.ExcludedDeployment = (DefinitionIdentity) (this.PendingDeployment = null);
     this.DeploymentProviderUri = null;
     this.MinimumRequiredVersion = null;
     this.LastCheckTime = DateTime.MinValue;
     this.UpdateSkippedDeployment = null;
     this.UpdateSkipTime = DateTime.MinValue;
     this.CurrentDeployment = null;
     this.RollbackDeployment = null;
     this.CurrentDeploymentManifest = null;
     this.CurrentDeploymentSourceUri = null;
     this.CurrentApplication = null;
     this.CurrentApplicationManifest = null;
     this.CurrentApplicationSourceUri = null;
     this.PreviousApplication = null;
     this.PreviousApplicationManifest = null;
     this.appType = AppType.None;
 }
 public CommitApplicationParams(CommitApplicationParams src)
 {
     this.TimeStamp = DateTime.MinValue;
     this.AppId = src.AppId;
     this.CommitApp = src.CommitApp;
     this.AppManifest = src.AppManifest;
     this.AppSourceUri = src.AppSourceUri;
     this.AppManifestPath = src.AppManifestPath;
     this.AppPayloadPath = src.AppPayloadPath;
     this.AppGroup = src.AppGroup;
     this.CommitDeploy = src.CommitDeploy;
     this.DeployManifest = src.DeployManifest;
     this.DeploySourceUri = src.DeploySourceUri;
     this.DeployManifestPath = src.DeployManifestPath;
     this.TimeStamp = src.TimeStamp;
     this.IsConfirmed = src.IsConfirmed;
     this.IsUpdate = src.IsUpdate;
     this.IsRequiredUpdate = src.IsRequiredUpdate;
     this.IsUpdateInPKTGroup = src.IsUpdateInPKTGroup;
     this.IsFullTrustRequested = src.IsFullTrustRequested;
     this.appType = src.appType;
     this.Trust = src.Trust;
 }
Esempio n. 26
0
        public MainWindow(InstanceType instance, AppType appType)
        {
            InitializeComponent();

            ExceptionlessClient.Default.Configuration.ApiKey = "e7ac6366507547639ce69fea261d6545";
            ExceptionlessClient.Default.Configuration.DefaultTags.Add("Unknown_Version_Pre_Startup");
            ExceptionlessClient.Default.Configuration.Enabled = true;
            ExceptionlessClient.Default.SubmittingEvent += ExceptionlessSubmittingEvent;
            ExceptionlessClient.Default.Register();

            var gallifrey = new Backend(instance, appType);

            ExceptionlessClient.Default.Configuration.DefaultTags.Clear();
            ExceptionlessClient.Default.Configuration.DefaultTags.Add(gallifrey.VersionControl.VersionName.Replace("\n", " - "));

            var viewModel = new MainViewModel(gallifrey, this);
            viewModel.RefreshModel();
            viewModel.SelectRunningTimer();
            DataContext = viewModel;

            gallifrey.NoActivityEvent += GallifreyOnNoActivityEvent;
            gallifrey.ExportPromptEvent += GallifreyOnExportPromptEvent;
            SystemEvents.SessionSwitch += SessionSwitchHandler;

            Height = gallifrey.Settings.UiSettings.Height;
            Width = gallifrey.Settings.UiSettings.Width;
            Title = gallifrey.VersionControl.AppName;
            ThemeHelper.ChangeTheme(gallifrey.Settings.UiSettings.Theme);

            if (gallifrey.VersionControl.IsAutomatedDeploy)
            {
                PerformUpdate(false, true);
                var updateHeartbeat = new Timer(60000);
                updateHeartbeat.Elapsed += delegate { PerformUpdate(false, false); };
                updateHeartbeat.Enabled = true;
            }
        }
        public static void Load(this ActorMessageDispatherComponent self)
        {
            AppType appType = StartConfigComponent.Instance.StartConfig.AppType;

            self.ActorMessageHandlers.Clear();
            self.ActorTypeHandlers.Clear();

            List <Type> types = Game.EventSystem.GetTypes(typeof(ActorInterceptTypeHandlerAttribute));

            foreach (Type type in types)
            {
                object[] attrs = type.GetCustomAttributes(typeof(ActorInterceptTypeHandlerAttribute), false);
                if (attrs.Length == 0)
                {
                    continue;
                }

                ActorInterceptTypeHandlerAttribute actorInterceptTypeHandlerAttribute = (ActorInterceptTypeHandlerAttribute)attrs[0];
                if (!actorInterceptTypeHandlerAttribute.Type.Is(appType))
                {
                    continue;
                }

                object obj = Activator.CreateInstance(type);

                IActorInterceptTypeHandler iActorInterceptTypeHandler = obj as IActorInterceptTypeHandler;
                if (iActorInterceptTypeHandler == null)
                {
                    throw new Exception($"actor handler not inherit IEntityActorHandler: {obj.GetType().FullName}");
                }

                self.ActorTypeHandlers.Add(actorInterceptTypeHandlerAttribute.ActorType, iActorInterceptTypeHandler);
            }

            types = Game.EventSystem.GetTypes(typeof(ActorMessageHandlerAttribute));
            foreach (Type type in types)
            {
                object[] attrs = type.GetCustomAttributes(typeof(ActorMessageHandlerAttribute), false);
                if (attrs.Length == 0)
                {
                    continue;
                }

                ActorMessageHandlerAttribute messageHandlerAttribute = (ActorMessageHandlerAttribute)attrs[0];
                if (!messageHandlerAttribute.Type.Is(appType))
                {
                    continue;
                }

                object obj = Activator.CreateInstance(type);

                IMActorHandler imHandler = obj as IMActorHandler;
                if (imHandler == null)
                {
                    throw new Exception($"message handler not inherit IMActorHandler abstract class: {obj.GetType().FullName}");
                }

                Type messageType = imHandler.GetMessageType();
                self.ActorMessageHandlers.Add(messageType, imHandler);
            }
        }
Esempio n. 28
0
        /// <summary>
        ///     Merges in data from another entry. Useful for merging scrape results, but could also merge data from a different
        ///     database.
        ///     Uses newer data when there is a conflict.
        ///     Does NOT perform deep copies of list fields.
        /// </summary>
        /// <param name="other">GameDBEntry containing info to be merged into this entry.</param>
        public void MergeIn(DatabaseEntry other)
        {
            bool useAppInfoFields    = (other.LastAppInfoUpdate > LastAppInfoUpdate) || ((LastAppInfoUpdate == 0) && (other.LastStoreScrape >= LastStoreScrape));
            bool useScrapeOnlyFields = other.LastStoreScrape >= LastStoreScrape;

            if ((other.AppType != AppType.Unknown) && ((AppType == AppType.Unknown) || useAppInfoFields))
            {
                AppType = other.AppType;
            }

            if ((other.LastStoreScrape >= LastStoreScrape) || ((LastStoreScrape == 0) && (other.LastAppInfoUpdate > LastAppInfoUpdate)) || (Platforms == AppPlatforms.None))
            {
                Platforms = other.Platforms;
            }

            if (useAppInfoFields)
            {
                if (!string.IsNullOrEmpty(other.Name))
                {
                    Name = other.Name;
                }

                if (other.ParentId > 0)
                {
                    ParentId = other.ParentId;
                }
            }

            if (useScrapeOnlyFields)
            {
                if ((other.Genres != null) && (other.Genres.Count > 0))
                {
                    Genres = other.Genres;
                }

                if ((other.Flags != null) && (other.Flags.Count > 0))
                {
                    Flags = other.Flags;
                }

                if ((other.Tags != null) && (other.Tags.Count > 0))
                {
                    Tags = other.Tags;
                }

                if ((other.Developers != null) && (other.Developers.Count > 0))
                {
                    Developers = other.Developers;
                }

                if ((other.Publishers != null) && (other.Publishers.Count > 0))
                {
                    Publishers = other.Publishers;
                }

                if (!string.IsNullOrEmpty(other.SteamReleaseDate))
                {
                    SteamReleaseDate = other.SteamReleaseDate;
                }

                if (other.TotalAchievements != 0)
                {
                    TotalAchievements = other.TotalAchievements;
                }

                //VR Support
                if ((other.VrSupport.Headsets != null) && (other.VrSupport.Headsets.Count > 0))
                {
                    VrSupport.Headsets = other.VrSupport.Headsets;
                }

                if ((other.VrSupport.Input != null) && (other.VrSupport.Input.Count > 0))
                {
                    VrSupport.Input = other.VrSupport.Input;
                }

                if ((other.VrSupport.PlayArea != null) && (other.VrSupport.PlayArea.Count > 0))
                {
                    VrSupport.PlayArea = other.VrSupport.PlayArea;
                }

                //Language Support
                if ((other.LanguageSupport.FullAudio != null) && (other.LanguageSupport.FullAudio.Count > 0))
                {
                    LanguageSupport.FullAudio = other.LanguageSupport.FullAudio;
                }

                if ((other.LanguageSupport.Interface != null) && (other.LanguageSupport.Interface.Count > 0))
                {
                    LanguageSupport.Interface = other.LanguageSupport.Interface;
                }

                if ((other.LanguageSupport.Subtitles != null) && (other.LanguageSupport.Subtitles.Count > 0))
                {
                    LanguageSupport.Subtitles = other.LanguageSupport.Subtitles;
                }

                if (other.ReviewTotal != 0)
                {
                    ReviewTotal = other.ReviewTotal;
                    ReviewPositivePercentage = other.ReviewPositivePercentage;
                }

                if (!string.IsNullOrEmpty(other.MetacriticUrl))
                {
                    MetacriticUrl = other.MetacriticUrl;
                }
            }

            if (other.LastStoreScrape > LastStoreScrape)
            {
                LastStoreScrape = other.LastStoreScrape;
            }

            if (other.LastAppInfoUpdate > LastAppInfoUpdate)
            {
                LastAppInfoUpdate = other.LastAppInfoUpdate;
            }
        }
Esempio n. 29
0
 public void Update(AppType appType, XElement updateNode)
 {
     ServerFacade.Default.Server.Update(appType, updateNode);
 }
Esempio n. 30
0
        public static void AppStart()
        {
            lock (locker)
            {
                if (_isCalled == false)
                {
                    try
                    {
                        WriterLog("--------------------------------");
                        WriterLog("应用开始启动!");

                        string ClientType = System.Configuration.ConfigurationManager.AppSettings["ClientType"];
                        if (ClientType == "Web")
                        {
                            appType = AppType.Web;
                        }
                        else if (ClientType == "Winform")
                        {
                            appType     = AppType.Winform;
                            AppRootPath = System.Windows.Forms.Application.StartupPath + "\\";
                        }
                        else if (ClientType == "WCF")
                        {
                            appType     = AppType.WCF;
                            AppRootPath = System.Windows.Forms.Application.StartupPath + "\\";
                        }
                        else if (ClientType == "WCFClient")
                        {
                            appType     = AppType.WCFClient;
                            AppRootPath = System.Windows.Forms.Application.StartupPath + "\\";
                        }


                        IsSaas = System.Configuration.ConfigurationManager.AppSettings["IsSaas"] == "true" ? true : false;

                        container  = ZhyContainer.CreateUnity();
                        cache      = ZhyContainer.CreateCache();
                        database   = FactoryDatabase.GetDatabase();
                        taskList   = new List <TimingTask>();
                        codeList   = new List <FunClass>();
                        missingDll = new List <string>();


                        //加载插件
                        AppPluginManage.LoadAllPlugin();
                        //AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);

                        //下面三个需要配置unity.config
                        //初始化Web定制任务
                        MultiTask.Init(container, taskList);//任务
                        //是否开启Web控制器请求权限认证
                        //扩展Global,网站程序启动、停止可自定义代码
                        GlobalExtend.StartInit();
                        //初始化委托代码
                        BaseDelegateCode.Init(container, codeList);//执行函数

                        _isCalled = true;

                        IsRun = true;

                        if (missingDll.Count > 0)
                        {
                            string msg = "缺失的程序集:";
                            WriterLog(msg);
                            for (int i = 0; i < missingDll.Count; i++)
                            {
                                msg = missingDll[i];
                                WriterLog(msg);
                            }
                            //MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }

                        WriterLog("应用启动成功!");
                        WriterLog("--------------------------------");
                        //AppMain();
                    }
                    catch (Exception err)
                    {
                        AppGlobal.WriterLog("应用启动失败!");
                        AppGlobal.WriterLog(err.Message);
                        AppGlobal.WriterLog("--------------------------------");
                        throw err;
                    }
                }
            }
        }
        public async Task <IHttpActionResult> Get(AppType appType)
        {
            var result = await _personQueryService.GetAppInfo(UserId, DeviceId, appType);

            return(Ok(result));
        }
Esempio n. 32
0
 protected override bool ShouldVerifyBPointAndMaxDQLot(Order order, bool isPlaceByRiskMonitor, AppType appType)
 {
     return(false);
 }
 public MemorySyncAttribute(AppType appType) : base()
 {
     this.appType = appType;
 }
Esempio n. 34
0
        public void ScrapeStore()
        {
            Logger.Verbose("Scraping {0}: Initializing store scraping for Id: {0}", Id);

            string page;
            int    redirectTarget = -1;

            HttpWebResponse resp           = null;
            Stream          responseStream = null;

            try
            {
                string storeLanguage = Steam.GetStoreLanguage(Database.Language);

                HttpWebRequest req = GetSteamRequest(string.Format(Constants.SteamStoreApp + "?l=" + storeLanguage, Id));
                resp = (HttpWebResponse)req.GetResponse();

                int count = 0;
                while ((resp.StatusCode == HttpStatusCode.Found) && (count < 5))
                {
                    resp.Close();

                    // Check if we were redirected to the Steam Store front page
                    if ((resp.Headers[HttpResponseHeader.Location] == @"https://store.steampowered.com/") || (resp.Headers[HttpResponseHeader.Location] == @"http://store.steampowered.com/"))
                    {
                        Logger.Warn("Scraping {0}: Redirected to main store page, aborting scraping", Id);
                        LastStoreScrape = 0;

                        return;
                    }

                    // Check if we were redirected to the same page
                    if (resp.ResponseUri.ToString() == resp.Headers[HttpResponseHeader.Location])
                    {
                        Logger.Warn("Scraping {0}: Store page redirected to itself, aborting scraping", Id);

                        return;
                    }

                    req  = GetSteamRequest(resp.Headers[HttpResponseHeader.Location]);
                    resp = (HttpWebResponse)req.GetResponse();
                    count++;
                }

                // Check if we were redirected too many times
                if ((count == 5) && (resp.StatusCode == HttpStatusCode.Found))
                {
                    Logger.Warn("Scraping {0}: Too many redirects, aborting scraping", Id);

                    return;
                }

                // Check if we were redirected to the Steam Store front page
                if (resp.ResponseUri.Segments.Length < 2)
                {
                    Logger.Warn("Scraping {0}: Redirected to main store page, aborting scraping", Id);
                    LastStoreScrape = 0;

                    return;
                }

                // Check if we encountered an age gate, cookies should bypass this, but sometimes they don't seem to
                if (resp.ResponseUri.Segments[1] == "agecheck/")
                {
                    // Encountered an age check with no redirect
                    if ((resp.ResponseUri.Segments.Length < 4) || (resp.ResponseUri.Segments[3].TrimEnd('/') == Id.ToString(CultureInfo.InvariantCulture)))
                    {
                        Logger.Warn("Scraping {0}: Encounterd an age check without redirect, aborting scraping", Id);

                        return;
                    }

                    // Age check + redirect
                    Logger.Warn("Scraping {0}: Hit age check for Id: {1}", Id, resp.ResponseUri.Segments[3].TrimEnd('/'));

                    // Check if we encountered an age gate without a numeric id
                    if (!int.TryParse(resp.ResponseUri.Segments[3].TrimEnd('/'), out redirectTarget))
                    {
                        return;
                    }
                }

                // Check if we were redirected outside of the app route
                if (resp.ResponseUri.Segments[1] != "app/")
                {
                    Logger.Warn("Scraping {0}: Redirected outside the app (app/) route, aborting scraping", Id);

                    return;
                }

                // The URI ends with "/app/" ?
                if (resp.ResponseUri.Segments.Length < 3)
                {
                    Logger.Warn("Scraping {0}: Response URI ends with 'app' thus missing ID found, aborting scraping", Id);

                    return;
                }

                // Check if we were redirected to a different Id
                if (resp.ResponseUri.Segments[2].TrimEnd('/') != Id.ToString())
                {
                    if (!int.TryParse(resp.ResponseUri.Segments[2].TrimEnd('/'), out redirectTarget))
                    {
                        Logger.Warn("Scraping {0}: Redirected to an unknown Id \"{1}\", aborting scraping", Id, resp.ResponseUri.Segments[2].TrimEnd('/'));

                        return;
                    }

                    Logger.Warn("Scraping {0}: Redirected to another app Id \"{1}\"", Id, resp.ResponseUri.Segments[2].TrimEnd('/'));
                }

                responseStream = resp.GetResponseStream();
                if (responseStream == null)
                {
                    Logger.Warn("Scraping {0}: The response stream was null, aborting scraping", Id);

                    return;
                }

                using (StreamReader streamReader = new StreamReader(responseStream))
                {
                    page = streamReader.ReadToEnd();
                    Logger.Verbose("Scraping {0}: Page read", Id);
                }
            }
            catch (Exception e)
            {
                Logger.Warn("Scraping {0}: Page read failed. {1}", Id, e.Message);
                LastStoreScrape = 0;

                return;
            }
            finally
            {
                resp?.Dispose();
                responseStream?.Dispose();
            }

            if (page.Contains("<title>Site Error</title>"))
            {
                Logger.Warn("Scraping {0}: Received Site Error, aborting scraping", Id);
                LastStoreScrape = 1;

                return;
            }

            if (!RegexIsGame.IsMatch(page) && !RegexIsSoftware.IsMatch(page))
            {
                Logger.Warn("Scraping {0}: Could not parse info from page, aborting scraping", Id);

                return;
            }

            LastStoreScrape = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
            GetAllDataFromPage(page);

            if (RegexIsDLC.IsMatch(page))
            {
                AppType = AppType.DLC;
            }

            if (RegexIsGame.IsMatch(page))
            {
                AppType = AppType.Game;
            }

            if (RegexIsSoftware.IsMatch(page))
            {
                AppType = AppType.Application;
            }

            if (redirectTarget != -1)
            {
                ParentId = redirectTarget;
            }

            Logger.Info("Scraping {0}: Parsed. Genre: {1}", Id, string.Join(",", Genres));
        }
Esempio n. 35
0
 private bool ShouldVerifyPrice(Transaction tran, AppType appType)
 {
     return(tran.SubType != TransactionSubType.Match && !(appType == AppType.RiskMonitor || tran.IsFreeOfPriceCheck(false)));
 }
Esempio n. 36
0
 internal AppInfo(AppType _appType)
 {
     AppType = _appType;
 }
 public List<MeetingHistoryDto> GetByApp(AppType appType, Guid syncId)
 {
     return meetingService.GetMeetingHistories(appType, syncId);
 }
Esempio n. 38
0
 public ConfigAttribute(int type)
 {
     this.Type = (AppType)type;
 }
Esempio n. 39
0
        /// <summary>
        /// Loads and initializes PCKS#11 library
        /// </summary>
        /// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
        /// <param name="libraryPath">Library name or path</param>
        /// <param name="appType">Type of application that will be using PKCS#11 library</param>
        /// <param name="initType">Source of PKCS#11 function pointers</param>
        public MockPkcs11Library(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
            : base(factories, libraryPath)
        {
            _logger.Debug("MockPkcs11Library({0})::ctor2", _libraryPath);

            try
            {
                _logger.Info("Loading PKCS#11 library {0}", _libraryPath);
                _pkcs11Library = new LowLevelAPI81.MockPkcs11Library(libraryPath, (initType == InitType.WithFunctionList));
                Initialize(appType);
            }
            catch
            {
                if (_pkcs11Library != null)
                {
                    _logger.Info("Unloading PKCS#11 library {0}", _libraryPath);
                    _pkcs11Library.Dispose();
                    _pkcs11Library = null;
                }
                throw;
            }
        }
Esempio n. 40
0
        protected override void InnerVerifyPrice(Order order, Price buy, Price sell, Price comparePrice, DateTime priceTimestamp, AppType appType)
        {
            comparePrice = buy;
            var dealingPolicyDetail = order.Owner.DealingPolicyPayload();

            if (order.SetPrice != null && Math.Abs(order.SetPrice - comparePrice) > dealingPolicyDetail.AcceptDQVariation)
            {
                order.JudgePrice          = comparePrice;
                order.JudgePriceTimestamp = priceTimestamp;

                string errorDetail = string.Format("comparePrice={0}, setPrice={1}, acceptDQVariation={2}, comparePriceTime={3}",
                                                   comparePrice, order.SetPrice, dealingPolicyDetail.AcceptDQVariation, priceTimestamp);
                throw new TransactionServerException(TransactionError.OutOfAcceptDQVariation, errorDetail);
            }
        }
 public SyncOnlyOnAttribute(AppType appType)
 {
     this.appType = appType;
 }
Esempio n. 42
0
 void ISystemController.Update(AppType appType, string update)
 {
     throw new NotImplementedException();
 }
 private void Awake(AppType appType)
 {
     this.AppType = appType;
     this.Load();
 }
Esempio n. 44
0
 public void Awake(AppType appType)
 {
     this.AppType = appType;
     this.Load();
 }
 private void OnBindCompleted(object sender, BindCompletedEventArgs e)
 {
     lock (this._lock)
     {
         GetManifestCompletedEventArgs args = null;
         try
         {
             this.AssertState(State.GettingManifest, State.Done);
             if (this._state != State.Done)
             {
                 if (e.Cancelled || (e.Error != null))
                 {
                     this.ChangeState(State.Done);
                 }
                 else
                 {
                     this.ChangeState(State.GetManifestSucceeded, e);
                 }
             }
             if (this.GetManifestCompleted == null)
             {
                 goto Label_0311;
             }
             if ((e.Error != null) || e.Cancelled)
             {
                 if (e.Cancelled)
                 {
                     Logger.AddInternalState(this._log, "GetManifestAsync call cancelled.");
                 }
                 args = new GetManifestCompletedEventArgs(e, this._deploymentManager.LogFilePath);
             }
             else
             {
                 this._isCached = e.IsCached;
                 bool install       = this._deploymentManager.ActivationDescription.DeployManifest.Deployment.Install;
                 bool hostInBrowser = this._deploymentManager.ActivationDescription.AppManifest.EntryPoints[0].HostInBrowser;
                 this._appType = this._deploymentManager.ActivationDescription.appType;
                 bool useManifestForTrust = this._deploymentManager.ActivationDescription.AppManifest.UseManifestForTrust;
                 Uri  providerCodebaseUri = this._deploymentManager.ActivationDescription.DeployManifest.Deployment.ProviderCodebaseUri;
                 if ((this._isLaunchInHostProcess && (this._appType != AppType.CustomHostSpecified)) && !hostInBrowser)
                 {
                     args = new GetManifestCompletedEventArgs(e, new InvalidOperationException(Resources.GetString("Ex_HostInBrowserFlagMustBeTrue")), this._deploymentManager.LogFilePath);
                 }
                 else if (install && (this._isLaunchInHostProcess || (this._appType == AppType.CustomHostSpecified)))
                 {
                     args = new GetManifestCompletedEventArgs(e, new InvalidOperationException(Resources.GetString("Ex_InstallFlagMustBeFalse")), this._deploymentManager.LogFilePath);
                 }
                 else if (useManifestForTrust && (this._appType == AppType.CustomHostSpecified))
                 {
                     args = new GetManifestCompletedEventArgs(e, new InvalidOperationException(Resources.GetString("Ex_CannotHaveUseManifestForTrustFlag")), this._deploymentManager.LogFilePath);
                 }
                 else if ((providerCodebaseUri != null) && (this._appType == AppType.CustomHostSpecified))
                 {
                     args = new GetManifestCompletedEventArgs(e, new InvalidOperationException(Resources.GetString("Ex_CannotHaveDeploymentProvider")), this._deploymentManager.LogFilePath);
                 }
                 else if (hostInBrowser && (this._appType == AppType.CustomUX))
                 {
                     args = new GetManifestCompletedEventArgs(e, new InvalidOperationException(Resources.GetString("Ex_CannotHaveCustomUXFlag")), this._deploymentManager.LogFilePath);
                 }
                 else
                 {
                     args = new GetManifestCompletedEventArgs(e, this._deploymentManager.ActivationDescription, this._deploymentManager.LogFilePath, this._log);
                 }
                 if (args.Error != null)
                 {
                     Logger.AddInternalState(this._log, "Exception thrown after binding: " + args.Error.GetType().ToString() + " : " + args.Error.Message + "\r\n" + args.Error.StackTrace);
                 }
             }
         }
         catch (Exception exception)
         {
             Logger.AddInternalState(this._log, "Exception thrown:" + exception.GetType().ToString() + " : " + exception.Message);
             this.ChangeState(State.Done);
             throw;
         }
         this.GetManifestCompleted(this, args);
         Label_0311 :;
     }
 }
Esempio n. 46
0
 public void Awake(AppType appType)
 {
     this.GetValue().Awake(appType);
 }
Esempio n. 47
0
 protected override void InnerVerify(Order order, bool isPlaceByRiskMonitor, AppType appType, PlaceContext context)
 {
     base.InnerVerify(order, isPlaceByRiskMonitor, appType, context);
     this.VerifyPlaceSettings(order, context);
 }
Esempio n. 48
0
 public ActorMessageHandlerAttribute(AppType appType)
 {
     this.appType = appType;
 }
Esempio n. 49
0
 /// <summary>
 /// Loads and initializes PCKS#11 library
 /// </summary>
 /// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
 /// <param name="libraryPath">Library name or path</param>
 /// <param name="appType">Type of application that will be using PKCS#11 library</param>
 /// <param name="initType">Source of PKCS#11 function pointers</param>
 /// <returns>High level PKCS#11 wrapper</returns>
 public IPkcs11 CreatePkcs11(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
 {
     return(new Pkcs11(factories, libraryPath, appType, initType));
 }
Esempio n. 50
0
 protected override bool ShouldVerifyBPointAndMaxDQLot(Order order, bool isPlaceByRiskMonitor, AppType appType)
 {
     return(base.ShouldVerifyBPointAndMaxDQLot(order, isPlaceByRiskMonitor, appType) && PhysicalVerifier.ShouldVerifyBPointAndMaxDQLot(order));
 }
Esempio n. 51
0
 protected override bool ShouldVerifyBPointAndMaxDQLot(Order order, bool isPlaceByRiskMonitor, AppType appType)
 {
     return(base.ShouldVerifyBPointAndMaxDQLot(order, isPlaceByRiskMonitor, appType) && order.IsOpen && InstrumentPriceStatusManager.Default.IsOnBPoint(order.Owner.SettingInstrument().OriginCode));
 }
Esempio n. 52
0
        private void OnGUI()
        {
            {
                GUILayout.BeginHorizontal();
                string[] filesArray = this.files.ToArray();
                this.selectedIndex = EditorGUILayout.Popup(this.selectedIndex, filesArray);

                string lastFile = this.fileName;
                this.fileName = this.files[this.selectedIndex];

                if (this.fileName != lastFile)
                {
                    this.LoadConfig();
                }

                this.newFileName = EditorGUILayout.TextField("文件名", this.newFileName);

                if (GUILayout.Button("添加"))
                {
                    this.fileName    = this.newFileName;
                    this.newFileName = "";
                    File.WriteAllText(this.GetFilePath(), "");
                    this.files         = this.GetConfigFiles();
                    this.selectedIndex = this.files.IndexOf(this.fileName);
                    this.LoadConfig();
                }

                if (GUILayout.Button("复制"))
                {
                    this.fileName = $"{this.fileName}-copy";
                    this.Save();
                    this.files         = this.GetConfigFiles();
                    this.selectedIndex = this.files.IndexOf(this.fileName);
                    this.newFileName   = "";
                }

                if (GUILayout.Button("重命名"))
                {
                    if (this.newFileName == "")
                    {
                        Log.Debug("请输入新名字!");
                    }
                    else
                    {
                        File.Delete(this.GetFilePath());
                        this.fileName = this.newFileName;
                        this.Save();
                        this.files         = this.GetConfigFiles();
                        this.selectedIndex = this.files.IndexOf(this.fileName);
                        this.newFileName   = "";
                    }
                }

                if (GUILayout.Button("删除"))
                {
                    File.Delete(this.GetFilePath());
                    this.files         = this.GetConfigFiles();
                    this.selectedIndex = 0;
                    this.newFileName   = "";
                }

                GUILayout.EndHorizontal();
            }

            scrollPos = GUILayout.BeginScrollView(this.scrollPos, true, true);
            for (int i = 0; i < this.startConfigs.Count; ++i)
            {
                StartConfig startConfig = this.startConfigs[i];


                GUILayout.BeginHorizontal();
                {
                    GUILayout.BeginHorizontal(GUILayout.Width(1700));
                    {
                        GUILayout.BeginHorizontal(GUILayout.Width(350));
                        GUILayout.Label($"AppId:");
                        startConfig.AppId = EditorGUILayout.IntField(startConfig.AppId, GUILayout.Width(30));
                        GUILayout.Label($"服务器IP:");
                        startConfig.ServerIP = EditorGUILayout.TextField(startConfig.ServerIP, GUILayout.Width(100));
                        GUILayout.Label($"AppType:");
                        startConfig.AppType = (AppType)EditorGUILayout.EnumPopup(startConfig.AppType);
                        GUILayout.EndHorizontal();
                    }
                    {
                        GUILayout.BeginHorizontal(GUILayout.Width(150));
                        InnerConfig innerConfig = startConfig.GetComponent <InnerConfig>();
                        if (innerConfig != null)
                        {
                            GUILayout.Label($"内网地址:");
                            innerConfig.Address = EditorGUILayout.TextField(innerConfig.Address, GUILayout.Width(120));
                        }

                        GUILayout.EndHorizontal();
                    }
                    {
                        GUILayout.BeginHorizontal(GUILayout.Width(350));
                        OuterConfig outerConfig = startConfig.GetComponent <OuterConfig>();
                        if (outerConfig != null)
                        {
                            GUILayout.Label($"外网地址:");
                            outerConfig.Address = EditorGUILayout.TextField(outerConfig.Address, GUILayout.Width(120));
                            GUILayout.Label($"外网地址2:");
                            outerConfig.Address2 = EditorGUILayout.TextField(outerConfig.Address2, GUILayout.Width(120));
                        }

                        GUILayout.EndHorizontal();
                    }
                    {
                        GUILayout.BeginHorizontal(GUILayout.Width(350));
                        ClientConfig clientConfig = startConfig.GetComponent <ClientConfig>();
                        if (clientConfig != null)
                        {
                            GUILayout.Label($"连接地址:");
                            clientConfig.Address = EditorGUILayout.TextField(clientConfig.Address, GUILayout.Width(120));
                        }

                        HttpConfig httpConfig = startConfig.GetComponent <HttpConfig>();
                        if (httpConfig != null)
                        {
                            GUILayout.Label($"AppId:");
                            httpConfig.AppId = EditorGUILayout.IntField(httpConfig.AppId, GUILayout.Width(20));
                            GUILayout.Label($"AppKey:");
                            httpConfig.AppKey = EditorGUILayout.TextField(httpConfig.AppKey);
                            GUILayout.Label($"Url:");
                            httpConfig.Url = EditorGUILayout.TextField(httpConfig.Url);
                            GUILayout.Label($"ManagerSystemUrl:");
                            httpConfig.ManagerSystemUrl = EditorGUILayout.TextField(httpConfig.ManagerSystemUrl);
                        }

                        DBConfig dbConfig = startConfig.GetComponent <DBConfig>();
                        if (dbConfig != null)
                        {
                            GUILayout.Label($"Connection:");
                            dbConfig.ConnectionString = EditorGUILayout.TextField(dbConfig.ConnectionString);

                            GUILayout.Label($"DBName:");
                            dbConfig.DBName = EditorGUILayout.TextField(dbConfig.DBName);
                        }

                        GUILayout.EndHorizontal();
                    }
                    GUILayout.EndHorizontal();
                }

                {
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button("删除"))
                    {
                        this.startConfigs.Remove(startConfig);
                        break;
                    }

                    if (GUILayout.Button("复制"))
                    {
                        for (int j = 1; j < this.copyNum + 1; ++j)
                        {
                            StartConfig newStartConfig = MongoHelper.FromBson <StartConfig>(startConfig.ToBson());
                            newStartConfig.AppId += j;
                            this.startConfigs.Add(newStartConfig);
                        }

                        break;
                    }

                    if (i >= 0)
                    {
                        if (GUILayout.Button("上移"))
                        {
                            if (i == 0)
                            {
                                break;
                            }
                            StartConfig s = this.startConfigs[i];
                            this.startConfigs.RemoveAt(i);
                            this.startConfigs.Insert(i - 1, s);
                            for (int j = 0; j < startConfigs.Count; ++j)
                            {
                                this.startConfigs[j].AppId = j + 1;
                            }

                            break;
                        }
                    }

                    if (i <= this.startConfigs.Count - 1)
                    {
                        if (GUILayout.Button("下移"))
                        {
                            if (i == this.startConfigs.Count - 1)
                            {
                                break;
                            }
                            StartConfig s = this.startConfigs[i];
                            this.startConfigs.RemoveAt(i);
                            this.startConfigs.Insert(i + 1, s);
                            for (int j = 0; j < startConfigs.Count; ++j)
                            {
                                this.startConfigs[j].AppId = j + 1;
                            }

                            break;
                        }
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndScrollView();



            GUILayout.Label("");

            GUILayout.BeginHorizontal();
            this.copyNum = EditorGUILayout.IntField("复制数量: ", this.copyNum);

            GUILayout.Label($"添加的AppType:");
            this.AppType = (AppType)EditorGUILayout.EnumPopup(this.AppType);

            if (GUILayout.Button("添加一行配置"))
            {
                StartConfig newStartConfig = new StartConfig();

                newStartConfig.AppType = this.AppType;

                if (this.AppType.Is(AppType.Gate | AppType.Realm | AppType.Manager))
                {
                    newStartConfig.AddComponent <OuterConfig>();
                }

                if (this.AppType.Is(AppType.Gate | AppType.Realm | AppType.Manager | AppType.Http | AppType.DB | AppType.Map | AppType.Location))
                {
                    newStartConfig.AddComponent <InnerConfig>();
                }

                if (this.AppType.Is(AppType.Http))
                {
                    newStartConfig.AddComponent <HttpConfig>();
                }

                if (this.AppType.Is(AppType.DB))
                {
                    newStartConfig.AddComponent <DBConfig>();
                }

                if (this.AppType.Is(AppType.Benchmark))
                {
                    newStartConfig.AddComponent <ClientConfig>();
                }

                if (this.AppType.Is(AppType.BenchmarkWebsocketServer))
                {
                    newStartConfig.AddComponent <OuterConfig>();
                }

                if (this.AppType.Is(AppType.BenchmarkWebsocketClient))
                {
                    newStartConfig.AddComponent <ClientConfig>();
                }

                this.startConfigs.Add(newStartConfig);
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("保存"))
            {
                this.Save();
            }

            if (GUILayout.Button("启动"))
            {
                StartConfig startConfig = null;
                foreach (StartConfig config in this.startConfigs)
                {
                    if (config.AppType.Is(AppType.Manager))
                    {
                        startConfig = config;
                    }
                }

                if (startConfig == null)
                {
                    Log.Error("没有配置Manager!");
                    return;
                }

                string arguments = $"App.dll --appId={startConfig.AppId} --appType={startConfig.AppType} --config=../Config/StartConfig/{this.fileName}";

                ProcessStartInfo info = new ProcessStartInfo("dotnet", arguments)
                {
                    UseShellExecute = true, WorkingDirectory = @"../Bin/"
                };
                Process.Start(info);
            }
            GUILayout.EndHorizontal();
        }
Esempio n. 53
0
        public BaseContract Run(PackageGenTypeMethod packageGenType,
                                string batId, string customerId, string unitId, string userId)
        {
            int       pageSize  = 500; // 每页数量
            AppType   appType   = AppType.BS;
            string    bizId     = Utils.NewGuid();
            string    methodKey = "Task.PackageUnits";
            string    ifCode    = TaskCode.T004.ToString();
            var       data      = new BaseContract();
            Hashtable htLogExt  = new Hashtable();

            htLogExt["customer_code"] = null;
            htLogExt["customer_id"]   = customerId;
            htLogExt["unit_code"]     = null;
            htLogExt["unit_id"]       = unitId;
            htLogExt["user_code"]     = null;
            htLogExt["user_id"]       = userId;
            htLogExt["if_code"]       = ifCode;
            htLogExt["app_code"]      = appType.ToString();
            try
            {
                Hashtable htParams = new Hashtable();
                htParams.Add("package_gen_type", packageGenType);
                htParams.Add("bat_id", batId);
                htParams.Add("customer_id", customerId);
                htParams.Add("unit_id", unitId);
                htParams.Add("user_id", userId);
                LogService.WriteTrace(bizId, methodKey, TraceLogType.Params.ToString(), htParams, userId, htLogExt);

                bool statusFlag = true;

                // 检查参数
                Hashtable htResult       = new Hashtable();
                bool      paramCheckFlag = false;
                #region Check Length
                htResult = ErrorService.CheckLength("客户ID", customerId, 1, 50, true, false, ref paramCheckFlag);
                if (!paramCheckFlag)
                {
                    throw new Exception(string.Format("批次{0}:客户ID不能为空", batId));
                }
                htResult = ErrorService.CheckLength("门店ID", unitId, 0, 50, true, true, ref paramCheckFlag);
                if (!paramCheckFlag)
                {
                    throw new Exception(string.Format("批次{0}:门店ID不能为空", batId));
                }
                #endregion

                htLogExt["customer_id"] = customerId;

                var dataService = new ExchangeBsService.UnitBsService();

                // 获取总数量
                int count = dataService.GetUnitNotPackagedCount(customerId, userId, unitId);
                if (count <= 0)
                {
                    data.status = Utils.GetStatus(true);
                    return(data);
                }

                // 创建数据包
                string         pkgTypeCode    = PackageTypeMethod.UNITS.ToString();
                string         pkgGenTypeCode = packageGenType.ToString();
                PackageService pkgService     = new PackageService();
                Hashtable      htPkg          = pkgService.CreatePackage(appType, batId, pkgTypeCode,
                                                                         customerId, unitId, userId, pkgGenTypeCode, null);
                if (!Convert.ToBoolean(htPkg["status"]))
                {
                    data.status          = Utils.GetStatus(false);
                    data.error_code      = htPkg["error_code"].ToString();
                    data.error_full_desc = htPkg["error_desc"].ToString();
                    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                    Console.WriteLine(data.error_full_desc);
                    return(data);
                }
                string pkgId = htPkg["package_id"].ToString();

                // 循环生成数据包文件
                int num = 0;
                while (num <= count)
                {
                    IList <cPos.Model.UnitInfo> items = dataService.GetUnitListPackaged(
                        customerId, userId, unitId, num, pageSize);
                    if (items.Count <= 0)
                    {
                        break;
                    }
                    num += pageSize;

                    foreach (var item in items)
                    {
                        item.UnitPropertyInfoList = dataService.GetUnitPropInfoListPackaged(
                            customerId, userId, unitId, item.Id);
                        item.WarehouseInfoList = dataService.GetWarehouseByUnitIDPackaged(
                            customerId, userId, unitId, item.Id);
                    }

                    Hashtable htPkgf = pkgService.CreateUnitsPackageFile(
                        appType, batId, pkgId, userId, null, items);
                    if (!Convert.ToBoolean(htPkgf["status"]))
                    {
                        data.status          = Utils.GetStatus(false);
                        data.error_code      = htPkgf["error_code"].ToString();
                        data.error_full_desc = htPkgf["error_desc"].ToString();
                        LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                        Console.WriteLine(data.error_full_desc);
                        return(data);
                    }
                    // 记录数据打包批次号
                    dataService.SetUnitBatInfo(customerId, userId, unitId, batId, items);
                }

                // 发布数据包
                Hashtable htPkgPublish = pkgService.PublishPackage(appType, batId, pkgId, userId);
                if (!Convert.ToBoolean(htPkgPublish["status"]))
                {
                    data.status          = Utils.GetStatus(false);
                    data.error_code      = htPkgPublish["error_code"].ToString();
                    data.error_full_desc = htPkgPublish["error_desc"].ToString();
                    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                    Console.WriteLine(data.error_full_desc);
                    return(data);
                }

                // 更新数据打包标识
                dataService.SetUnitIfFlagInfo(customerId, userId, unitId, batId);

                data.status = Utils.GetStatus(statusFlag);
                LogService.WriteTrace(bizId, methodKey, TraceLogType.Return.ToString(), data.ToString(), userId, htLogExt);
            }
            catch (Exception ex)
            {
                data.status          = Utils.GetStatus(false);
                data.error_code      = ErrorCode.A000.ToString();
                data.error_full_desc = ex.ToString();
                LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                Console.WriteLine(data.error_full_desc);
            }
            return(data);
        }
Esempio n. 54
0
 public LobbyModel(AppType appType)
 {
     LobbyType = appType;
 }
Esempio n. 55
0
 public static void Run(InstanceType instance, AppType appType)
 {
     var mainWindow = new MainWindow(instance, appType);
     mainWindow.Show();
 }
Esempio n. 56
0
 public void Send(AppType appType, IMessage msg)
 {
     Send(GetIPEndPoint(appType), msg);
 }
Esempio n. 57
0
        void ScrapeGamesOfType( AppType type )
        {
            Cursor = Cursors.WaitCursor;

            Queue<int> gamesToScrape = new Queue<int>();

            foreach( GameDBEntry g in Program.GameDB.Games.Values ) {
                if( g.Type == type ) {
                    gamesToScrape.Enqueue( g.Id );
                }
            }

            ScrapeGames( gamesToScrape );

            Cursor = Cursors.Default;
        }
 /// <summary>
 /// Loads and initializes PCKS#11 library
 /// </summary>
 /// <param name="factories">Factories to be used by Developer and Pkcs11Interop library</param>
 /// <param name="libraryPath">Library name or path</param>
 /// <param name="appType">Type of application that will be using PKCS#11 library</param>
 /// <param name="initType">Source of PKCS#11 function pointers</param>
 /// <returns>High level PKCS#11 wrapper</returns>
 public IPkcs11Library LoadPkcs11Library(Pkcs11InteropFactories factories, string libraryPath, AppType appType, InitType initType)
 {
     return(new MockPkcs11Library(factories, libraryPath, appType, initType));
 }
Esempio n. 59
0
 public TaskCategory(string title,Guid syncId,AppType appType):base(syncId,appType)
 {
     Title = title;
     Tasks=new List<Task>();
 }
Esempio n. 60
0
        protected virtual void InnerVerifyPrice(Order order, Price buy, Price sell, Price comparePrice, DateTime priceTimestamp, AppType appType)
        {
            var tran = order.Owner;

            if (tran.OrderType == OrderType.SpotTrade)
            {
                order.VerifySportOrderPrice(buy, sell, comparePrice, priceTimestamp);
            }
            else if (tran.OrderType == OrderType.Limit || tran.OrderType == OrderType.OneCancelOther)
            {
                order.VerifyLimitAndOCOOrderPrice(buy, sell, comparePrice, priceTimestamp, appType, this.OrderNetVerifier);
            }
        }