private static void WriteXmlDataProperties(XmlWriter writer, object obj, Type type)
        {
            writer.WriteAttributeString(_XTYPE_, _DATABASE_);
            writer.WriteAttributeString(_TYPE_, SerializableTypeName(type));
            var properties = XConfig.Select_XmlSerializableProperties(type);

            foreach (var property in properties)
            {
                object value = property.GetValue(obj);
                if (value == null)
                {
                    continue;
                }
                if (property.GetCustomAttribute(typeof(DefaultValueAttribute)) is DefaultValueAttribute defValueAttr)
                {
                    if (defValueAttr.Value?.Equals(value) ?? false)
                    {
                        continue;
                    }
                }
                string key = property.Name;
                writer.WriteStartElement(_ENTRY_);
                writer.WriteAttributeString(_KEY_, key);
                WriteObjectToXmlWriterRecursive(writer, value);
                writer.WriteEndElement();
            }
        }
        public void SaveBranchFile(ref VersionBranch data)
        {
            string branch_path = Path.Combine(mVersionData_BranchIndex_FolderPath, data.BranchName + ".json");

            data.ReadySave();
            XConfig.SaveJson(data, branch_path, AssetLoadType.SystemIO);
        }
示例#3
0
        private async void Init()
        {
            _config = await Logic.ReadConfig();

            panelLeft.Visible  = false;
            panelRight.Visible = false;
        }
示例#4
0
        static void Main()
        {
            L.InitLog();
            if (!XConfig.LoadConfig("XConfig.conf"))
            {
                L.E("Config File Not Loaded!");
                return;
            }
            DatabaseCore.InitialiseDBConnection();
            DatabaseSocketsServer.InitialiseSockets();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            mainForm = new MainForm();
            try
            {
                Application.Run(mainForm);
            }
            catch (Exception ex)
            {
                L.E(ex.Message);
                L.E("MainForm disappeared caused by exception!");
                Thread.Sleep(1000);
                L.E("DBServer is to be restarted to keep stability!");
            }
            Application.Restart();
        }
示例#5
0
        /// <summary>
        /// 保存BuildInfo
        /// </summary>
        /// <returns></returns>
        private void MakeBuildInfo(string packages_root_path)
        {
            var binfo = new BuildInfo();

            binfo.BuildID = System.Guid.NewGuid().ToString();

            //save main package
            string main_path = VFSUtil.GetMainPackage_BuildInfo_Path(packages_root_path);

            XFile.DeleteIfExists(main_path);
            XDirectory.CreateIfNotExists(Path.GetDirectoryName(main_path));
            XConfig.SaveJson(binfo, main_path, AssetLoadType.SystemIO);

            //groups
            if (mEditorBuildInfo.list_total_extension != null && mEditorBuildInfo.list_total_extension.Count > 0)
            {
                foreach (var group in mEditorBuildInfo.list_total_extension)
                {
                    string target_path     = VFSUtil.GetExtensionGroup_BuildInfo_Path(packages_root_path, group);
                    string group_root_path = VFSUtil.GetExtensionGroupFolder(packages_root_path, group);
                    if (Directory.Exists(group_root_path))
                    {
                        XFile.DeleteIfExists(target_path);
                        XDirectory.CreateIfNotExists(Path.GetDirectoryName(target_path));
                        XConfig.SaveJson(binfo, target_path, AssetLoadType.SystemIO);
                    }
                }
            }
        }
示例#6
0
 /// <summary>
 ///   Initialize the flash before operations start
 ///   <exception cref="DeviceError">If Device is not initalized, there is a fatal USB error or for unsupported flashconfig types</exception>
 ///   <exception cref="ArgumentException">If flashconfig is invalid</exception>
 /// </summary>
 /// <param name="config"> Flashconfig information (Information about the consoles memory) </param>
 public void Init(out XConfig config)
 {
     CheckDeviceState();
     GetARMVersion();
     _xcfg             = new XConfig(GetARMStatus(Commands.DataInit));
     config            = _xcfg;
     _flashInitialized = true;
 }
        private static void refreshData()
        {
            mConfig = XConfig.GetConfig <TSConfig>(TSConst.ConfigPath_Resources, AssetLoadType.Resources, false);



            mDataRefreshed = true;
        }
示例#8
0
        public static XConfig XConfig()
        {
            var xconfig  = new XConfig();
            var filename = xconfig.Filename;

            xconfig.XDoc = File.Exists(filename) ? XDocument.Load(filename) : XDocument.Parse(Template);
            return(xconfig);
        }
示例#9
0
 public static void SaveProfileRecord()
 {
     if (VFSProfileEditor != null)
     {
         VFSProfileEditor.ReadySave();
         var profile_path = Path.Combine(XEditorConst.EditorProjectSettingRootFolder, VFSEditorConst.VFSProfileProjectSettingFileName);
         XConfig.SaveJson(VFSProfileEditor, profile_path, AssetLoadType.SystemIO);
     }
 }
示例#10
0
 void Start()
 {
     option = new GUILayoutOption[] { GUILayout.Width(140), GUILayout.Height(80) };
     GameEnine.SetMonoForTest(this);
     XTimerMgr.singleton.Init();
     XConfig.Initial(LogLevel.Log, LogLevel.Error);
     XGlobalConfig.Initial();
     XResources.Init();
 }
示例#11
0
        /// <summary>
        /// 保存EditorBuildInfo
        /// </summary>
        /// <param name="package_root_path"></param>
        private void MakeEditorBuildInfo(string package_root_path)
        {
            mEditorBuildInfo.build_profile_name = curProfile.ProfileName;
            mEditorBuildInfo.ReadySave();
            string path = VFSEditorUtil.Get_EditorBuildInfoPath(package_root_path);

            XFile.DeleteIfExists(path);
            XDirectory.CreateIfNotExists(Path.GetDirectoryName(path));
            XConfig.SaveJson(mEditorBuildInfo, path, AssetLoadType.SystemIO);
        }
示例#12
0
        private static void refreshData()
        {
            mConfig = XConfig.GetConfig <I18NConfig>(I18NConst.ConfigPath_Resources, AssetLoadType.Resources, false);
            if (mConfig != null)
            {
                mConfig_SerObj = new SerializedObject(mConfig);
            }

            mDataRefreshed = true;
        }
示例#13
0
        public static Config Config(XConfig xconfig)
        {
            var xdoc   = xconfig.XDoc.Element("FileZillaServer");
            var config = new Config();

            config.Settings = _Settings(xdoc.Element("Settings"));
            config.Groups   = _Groups(xdoc.Element("Groups"));
            config.Users    = _Users(xdoc.Element("Users"));
            return(config);
        }
示例#14
0
    static Welcome()
    {
        XConfig.Initial(LogLevel.Log, LogLevel.Error);
        XTableMgr.Initial();
        XResources.Init();

        int isShow = PlayerPrefs.GetInt("ShowWelcomeScreen", 1);

        if (isShow == 1)
        {
            EditorApplication.update += Update;
        }
    }
示例#15
0
        public async void btnSave_BtnClick(object sender, EventArgs e)
        {
            var config = new XConfig
            {
                SavePath         = txtSavepath.InputText,
                IsDownloadPoster = ucSwitchPoster.Checked,
                IsDownloadVoice  = ucSwitchAudio.Checked
            };
            await Logic.WriteConfig(config);

            OnConfigRefreshed?.Invoke(config, e);
            Close();
        }
示例#16
0
    public static T GetTable <T>() where T : CSVReader, new()
    {
        uint uid = XCommon.singleton.XHash(typeof(T).Name);

        if (readers == null || !readers.ContainsKey(uid))
        {
            //此情况下主要是编辑器模式会用到 一开始并没有读取所有的表格
            XConfig.InitPath();
            Add <T>();
            readers[uid].Create();
        }
        return(readers[uid] as T);
    }
示例#17
0
        private void SaveExtensionGroupInfo(string group_path, string group_name, XRuntimePlatform platform, long mainPackageVersionLimit, string ab_ext_name)
        {
            string file_path = VFSUtil.GetExtensionGroup_GroupInfo_Path_InGroupPath(group_path);
            var    obj       = new ExtensionGroupInfo
            {
                Platform  = platform,
                GroupName = group_name,
                MainPackageVersionLimit = mainPackageVersionLimit,
                AssetBundleExtension    = ab_ext_name
            };

            XConfig.SaveJson(obj, file_path, AssetLoadType.SystemIO);
        }
示例#18
0
文件: Form1.cs 项目: 15831944/gpython
        private void Form1_Load(object sender, System.EventArgs e)
        {
            statusBarPanel2.Text = "登陆时间:" + DateTime.Now.ToString();

            if (XConfig.IsConfig())
            {
                Close();
            }

            int i = 0;

            LogMessage(i.ToString(), "系统开始成功运行");
//			SplashForm splash=new SplashForm();
//			splash.Show();
        }
示例#19
0
        public static void Main(string[] args)
        {
            LW.SetLogLevel(LogLevel.Dbg);
            LW.InitLog();

            var v = XConfig.LoadAll();

            if (!(v.Item1 && v.Item2))
            {
                return;
            }

            new Thread(new ThreadStart(GetStateString)).Start();
            BuildWebHost(args).Run();
        }
示例#20
0
        public static void SaveXProfiles()
        {
            if (mProfileModel == null || mProfileRuntimeConfig == null)
            {
                RefreshXProfile();
            }

            mProfileModel.ReadySave();
            XConfig.SaveJson(mProfileModel, XEditorConst.EditorXProfilePath, AssetLoadType.SystemIO);

            mProfileRuntimeConfig.ActiveProfileName = mProfileModel.CurrentProfileName;
            mProfileRuntimeConfig.DevelopMode       = mProfileModel.IsDevelopMode(mProfileModel.CurrentProfileName);
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();
        }
        public static void Main()
        {
            LW.SetLogLevel(LogLevel.Dbg);
            LW.InitLog();
            LW.D("========= = Start WoodenBench for Schoolbus Windows Client = =========");
            if (!XConfig.LoadConfig("XConfig.conf"))
            {
                LW.E("Config Loading Failed! Check file...");
                return;
            }

            DataBaseOperation.InitialiseClient();
            Application.EnableVisualStyles();
            Application.Run(LoginWindow.Default);
        }
示例#22
0
        public static void Main(string[] args)
        {
            L.InitLog();
            var v = XConfig.LoadAll();

            if (!(v.Item1 && v.Item2))
            {
                return;
            }

            new Thread(new ThreadStart(GetState))
            {
                Name = "Platform State Obtainer"
            }.Start();
            BuildWebHost(args).Run();
        }
示例#23
0
    public static void Init(MonoBehaviour en)
    {
        _entrance = en;
        Application.targetFrameRate = 60;
#if Native
        NativeInterface.Init();
#endif
        XTimerMgr.singleton.Init();
        XConfig.Initial(LogLevel.Log, LogLevel.Error);
        XGlobalConfig.Initial();
        XTableMgr.Initial();
        ShaderMgr.Init();
        XResources.Init();
        UIManager.singleton.Initial();
        Documents.singleton.Initial();
        RegistCallbackLog();
    }
示例#24
0
 public void ReadOnlyProperty_NotifyPropertyChanged()
 {
     if (this.appliedTo == this.Instance.GetType())
     {
         DEBUGWRITE($"NestedNotifyPropertyChangedAttribute.OnInstanceConstructedAdvice: {GetInfo(Instance)}, Count = {HandlerDict.Count}");
         var properties = XConfig.Select_NotifyProperties(Instance.GetType(), false);
         foreach (var property in properties)
         {
             var value = property.GetValue(Instance);
             if (value is INotifyPropertyChanged notifyPropertyChanged)
             {
                 var handler = MakeNestedPropertyChangedHandler(property.Name);
                 notifyPropertyChanged.PropertyChanged += handler;
             }
         }
     }
 }
示例#25
0
        public static string GetEmployeeReportURL(XConfig config, Guid EmployeeID)
        {
            // Если не настроен путь в НСИ, то берем карточку сотрудника из IT
            object oConf = new object();

            if (config != null)
            {
                oConf = config.SelectNode("it:app-data/it:services-location/it:service-location[@service-type='NSI-Rep']").InnerText;
            }
            if (oConf != null & oConf.ToString() != String.Empty)
            {
                return("nsi-redirect.aspx?OT=SystemUser&amp;ID=" + EmployeeID + "&amp;FROM=0AEFC1FD-4D42-4AAC-8369-76E5A812EFF3&amp;COMMAND=CARD");
            }
            else
            {
                return("x-get-report.aspx?NAME=r-Employee.xml&DontCacheXslfo=true&ID=" + EmployeeID);
            }
        }
示例#26
0
        public static int Main(string[] args)
        {
            LW.SetLogLevel(LogLevel.D);
            LW.InitLog();
            LW.I("========= = Start WoodenBench for Schoolbus Windows Client = =========");
            if (!XConfig.LoadConfig("XConfig.conf"))
            {
                LW.E("Config Loading Failed! Check file...");
                return(0);
            }

            DataBaseOperation.InitialiseClient();
            Application.EnableVisualStyles();
            Application.Run(LoginWindow.Default);

            DatabaseSocketsClient.KillConnection();
            return(0);
        }
示例#27
0
        public static void Main(string[] args)
        {
            StartUpTime = DateTime.Now;
            L.InitLog();
            L.I("WoodenBench WebServer Starting....");
            L.I($"Startup Time {StartUpTime.ToString()}.");

            Version = new FileInfo(new string(Assembly.GetExecutingAssembly().CodeBase.Skip(8).ToArray())).LastWriteTime.ToString();
            L.I($"Version: {Version}");

            var v = XConfig.LoadAll();

            if (!(v.Item1 && v.Item2))
            {
                L.E("XConfig Load error... Quiting");
                return;
            }

            L.I("Starting Job Watcher");
            TimedJob.StartJobWatcher();
            TimedJob.AddToJobList("Get Config", XConfig.ServerConfig.GetConfig, 10, 0);
            TimedJob.AddToJobList("Session Checker", BaseController.CheckSessions, 10, 0);
            TimedJob.AddToJobList("Status Monitor", StatusMonitor.SendStatus, 10);

            DataBaseOperation.InitialiseClient();

            XConfig.ServerConfig.GetConfig();

            WeChatHelper.PrepareCodes();
            WeChatHelper.InitialiseEncryptor();

            L.I("Initialising Core Messaging Systems.....");
            WeChatMessageSystem.StartProcessThreads();
            WeChatMessageBackupService.StartBackupThread();
            MessagingSystem.StartProcessThread();

            var webHost = BuildWebHost(args, XConfig.Current.ApplicationInsightInstrumentationKey);

            L.I("Starting WebHost....");
            WebServerTask = webHost.RunAsync(ServerStopToken.Token);
            WebServerTask.Wait();
            L.E("WebServer Stoped! Cancellation Token = " + ServerStopToken.IsCancellationRequested);
            DatabaseSocketsClient.KillConnection();
        }
        public static void ResetInstaceAllPropertiesByDefaultValue(this object Instance, ValueDefaultType overrideType = ValueDefaultType.All)
        {
            var properties = XConfig.Select_ResetAllDefaultProperties(Instance.GetType());

            foreach (var property in properties)
            {
                if (property.CanWrite)
                {
                    var value = Instance.GetPropertyDefaultValueEx(property, out var type);
                    if (overrideType.HasFlag(type))
                    {
                        property.SetValue(Instance, value);
                    }
                }
                else if (property.CanRead && property.GetValue(Instance) is IDefaultProperty propertyInstance)
                {
                    propertyInstance.ResetAllPropertiesDefaultValue(overrideType);
                }
            }
        }
示例#29
0
        public static void RefreshXProfile()
        {
            if (mProfileModel == null)
            {
                //load or new
                bool create = false;
                if (File.Exists(XEditorConst.EditorXProfilePath))
                {
                    try
                    {
                        mProfileModel = XConfig.GetJson <XProfileModel>(XEditorConst.EditorXProfilePath, AssetLoadType.SystemIO, false);
                        mProfileModel.CheckDefaultProfile();
                    }
                    catch
                    {
                        create = true;
                    }
                }
                else
                {
                    create = true;
                }

                if (create)
                {
                    mProfileModel = XProfileModel.GetDefault();
                    //写出
                    XConfig.SaveJson(mProfileModel, XEditorConst.EditorXProfilePath, AssetLoadType.SystemIO);
                }
            }

            if (mProfileRuntimeConfig == null)
            {
                mProfileRuntimeConfig = XConfig.CreateConfigIfNotExists <TinaX.Internal.XProfileConfig>(TinaX.Const.FrameworkConst.XProfile_Config_Path, AssetLoadType.Resources);
                if (mProfileRuntimeConfig.ActiveProfileName.IsNullOrEmpty())
                {
                    mProfileRuntimeConfig.ActiveProfileName = mProfileModel.CurrentProfileName;
                }
                mProfileRuntimeConfig.DevelopMode = mProfileModel.IsDevelopMode(mProfileRuntimeConfig.ActiveProfileName);
            }
        }
示例#30
0
        /*
         * 启动顺序:
         * - 注册CLR重定向
         * - 注册委托适配器
         * - 注册跨域适配器
         * - 注册CLR绑定
         * - 加载Assembly和它的小伙伴们
         *
         */
        public async Task <XException> StartAsync()
        {
            if (m_Inited)
            {
                return(null);
            }
            m_Config = XConfig.GetConfig <XILRTConfig>(XILConst.ConfigPath_Resources);
            if (m_Config == null)
            {
                return(new XILRTException("Config file not found :" + XILConst.ConfigPath_Resources));
            }

            if (!m_Config.Enable)
            {
                return(null);
            }

            //注册CLR重定向
            registerCLRMethodRedirections();

            //注册委托适配器
            registerDelegates();

            //注册跨域适配器
            registerCrossBindingAdaptors();

            //注册CLR绑定
            registerGeneratorCLRBindingCode();

            //加载Assemblies
            var e_load = await this.loadAssemblies(m_Config.LoadAssemblies);

            if (e_load != null)
            {
                return(e_load);
            }


            m_Inited = true;
            return(null);
        }
示例#31
0
 /// <summary>
 ///   Initialize the flash before operations start
 ///   <exception cref="X360NANDManagerException">If Device is not initalized, there is a fatal USB error or for unsupported flashconfig types</exception>
 ///   <exception cref="ArgumentException">If flashconfig is invalid</exception>
 /// </summary>
 /// <param name="config"> Flashconfig information (Information about the consoles memory) </param>
 public void Init(out XConfig config)
 {
     CheckDeviceState();
     GetARMVersion();
     _xcfg = new XConfig(GetARMStatus(Commands.DataInit));
     config = _xcfg;
     _flashInitialized = true;
 }