public PanelButton(XCore.ChoiceBase choice, ImageCollection images):base() { m_images = images; this.Dock = System.Windows.Forms.DockStyle.Right; this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Location = new System.Drawing.Point(576, 2); this.Name = "panelEx1"; this.Anchor = System.Windows.Forms.AnchorStyles.None; this.Size = new System.Drawing.Size(120, 20); #if USE_DOTNETBAR this.Style.Alignment = System.Drawing.StringAlignment.Center; this.Style.GradientAngle = 90; #endif this.MouseEnter += new EventHandler(panelButton_MouseEnter); this.MouseLeave += new EventHandler(panelButton_MouseLeave); this.MouseDown += new MouseEventHandler(panelButton_MouseDown); this.Click += new EventHandler(PanelButton_Click); this.TabIndex = 0; this.Tag = choice; SetLabel(); }
public static void Start() { Debug.Log("vv~~~"); //open ui var core = XCore.GetMainInstance(); var uikit = core.Services.Get <IUIKit>(); uikit.OpenUIAsync("mainScreen", new MainScreen(), (entity, err) => { if (err != null) { Debug.LogError("Open mainScreen failed:" + err.Message); } }); //load scene //var vfs = core.GetService<IVFS>(); //vfs.LoadSceneAsync("Assets/App/Scenes/App.Main.unity", (scene, err) => //{ // scene.OpenScene(); //}); var scene_req = Assets.LoadSceneAsync("Assets/App/Scenes/App.Main.unity", false); scene_req.ToObservable() .ObserveOnMainThread() .SubscribeOnMainThread() .Subscribe(_ => { Debug.Log("Load Scene Success"); }); }
public override void Start() { DropdownServerList.OnValueChangedAsObservable() .Where(index => index == DropdownServerList.options.Count - 1) .Subscribe(_ => this.onAddGameServer?.Invoke()); ButtonTest.onClick.AddListener(delegate { Toast.Show("Hello @" + Random.Range(0, 10000)); }); btnTestAlert.OnClickAsObservable().Subscribe(_ => { Alert.Show(); }); btnLogin.OnClickAsObservable().Subscribe(_ => { this.onPressLogin?.Invoke(); }); btnScreenTest.OnClickAsObservable().Subscribe(_ => { var core = XCore.GetMainInstance(); var uikit = core.Services.Get <IUIKit>(); uikit.OpenUIAsync("Assets/UI/Test/TestScreen.prefab"); }); }
protected override TreeViewItem BuildRoot() { var root = new TreeViewItem { id = 0, depth = -1, displayName = "Root" }; Dict_Assets_id.Clear(); var allItems = new List <TreeViewItem>(); var root_item = new TreeViewItem { id = 1, depth = 0, displayName = "Editor Simulation Assets" }; allItems.Add(root_item); int counter = 1; var vfs = XCore.GetMainInstance().GetService <IVFSInternal>(); if (!vfs.LoadFromAssetbundle()) { foreach (var asset in vfs.GetAllEditorAsset()) { counter++; allItems.Add(new TreeViewItem { id = counter, depth = 1, displayName = asset.AssetPathLower }); Dict_Assets_id.Add(counter, asset); } } // Utility method that initializes the TreeViewItem.children and .parent for all items. SetupParentsAndChildrenFromDepths(root, allItems); // Return root of the tree return(root); }
public override void Init(XCore.Mediator mediator, System.Xml.XmlNode viewConfiguration) { base.Init(mediator, viewConfiguration); XmlNode clerkConfiguration = ToolConfiguration.GetClerkNodeFromToolParamsNode(viewConfiguration); var subitemNames = XmlUtils.GetManditoryAttributeValue(clerkConfiguration, "field").Split('.'); SubitemFlid = Cache.MetaDataCacheAccessor.GetFieldId(subitemNames[0].Trim(), subitemNames[1].Trim(), true); }
public MakeInflAffixEntryChooserCommand(FdoCache cache, bool fCloseBeforeExecuting, string sLabel, bool fPrefix, IMoInflAffixSlot slot, XCore.Mediator mediator) : base(cache, fCloseBeforeExecuting, sLabel, mediator) { m_fPrefix = fPrefix; m_slot = slot; }
public void Initialize(ICmObject rootObj, int rootFlid, FdoCache cache, string displayNameProperty, XCore.Mediator mediator, string displayWs) { CheckDisposed(); m_displayWs = displayWs; base.Initialize(rootObj, rootFlid, cache, displayNameProperty, mediator); }
public void Initialize(string sFormat, XCore.IHelpTopicProvider helpTopicProvider, bool fGenDate) { m_tbFormat.Text = sFormat; m_helpTopicProvider = helpTopicProvider; m_fGenDate = fGenDate; ApplyFormat(); }
/// <summary> /// /// </summary> /// <param name="group"></param> public void AddGroup(XCore.ChoiceGroup group) { ClearMainPanelControls(); ArrayList l = new ArrayList(group.Count); foreach(ChoiceRelatedClass item in group) { l.Add(item); } l.Reverse(); foreach(ChoiceRelatedClass item in l) { XCore.ChoiceRelatedClass choice = (XCore.ChoiceRelatedClass)this.Tag; UIItemDisplayProperties display = item.GetDisplayProperties(); if (!display.Visible) continue; if(item is ChoiceBase) { AddHotlink((ChoiceBase)item); } else if(item is ChoiceGroup) { AddMenu((ChoiceGroup)item); } } }
private void Start() { var core = XCore.New() .UseVFS() .UseUIKit() #if !NO_ILRUNTIME .UseXILRuntime() #endif .OnServicesStartException((service, exception) => { Debug.LogError(exception); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif }); core.RunAsync(err => { if (err != null) { Debug.LogError(err); } else { Debug.Log("App Started."); } }); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="T:ChooserCommand"/> class. /// </summary> /// <param name="cache">The cache.</param> /// <param name="fCloseBeforeExecuting">if set to <c>true</c> [f close before executing].</param> /// <param name="sLabel">The s label.</param> /// <param name="mediator">The mediator.</param> /// ------------------------------------------------------------------------------------ public ChooserCommand(FdoCache cache, bool fCloseBeforeExecuting, string sLabel, XCore.Mediator mediator) { m_cache = cache; m_fShouldCloseBeforeExecuting = fCloseBeforeExecuting; m_sLabel = sLabel + " "; // Extra spaces are just a hack to keep the label from being truncated - I have no idea why it is being truncated m_mediator = mediator; }
public ServiceContainer(XCore core) { m_Core = core; CatApplication = new XCatApplication(m_Core); App.That = CatApplication; CatApplication.Instance <IXCore>(core); }
protected RuleFormulaVcBase(FdoCache cache, XCore.Mediator mediator) : base(cache, mediator) { ITsStrFactory tsf = m_cache.TsStrFactory; int userWs = m_cache.DefaultUserWs; m_infinity = tsf.MakeString("\u221e", userWs); m_x = tsf.MakeString("X", userWs); }
public virtual bool OnDisplayMappingJumpToPhoneme(object commandObject, ref XCore.UIItemDisplayProperties display) { CheckDisposed(); bool enable = AffixRuleFormulaControl.IsPhonemeCurrent; display.Enabled = enable; display.Visible = enable; return true; }
public bool OnDisplayContextSetOccurrence(object commandObject, ref XCore.UIItemDisplayProperties display) { CheckDisposed(); bool enable = RegRuleFormulaControl.CanModifyContextOccurrence; display.Enabled = enable; display.Visible = enable; return true; }
public bool OnDisplayContextSetVariables(object commandObject, ref XCore.UIItemDisplayProperties display) { CheckDisposed(); bool enable = RuleFormulaControl.IsFeatsNCContextCurrent; display.Enabled = enable; display.Visible = enable; return true; }
public bool OnDisplayMappingJumpToNaturalClass(object commandObject, ref XCore.UIItemDisplayProperties display) { CheckDisposed(); bool enable = AffixRuleFormulaControl.IsNCIndexCurrent; display.Enabled = enable; display.Visible = enable; return true; }
public AffixRuleFormulaVc(FdoCache cache, XCore.Mediator mediator) : base(cache, mediator) { ITsPropsBldr tpb = TsPropsBldrClass.Create(); tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, MiscUtils.StandardSansSerif); tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 10000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable); m_headerProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetIntPropValues((int)FwTextPropType.ktptBold, (int)FwTextPropVar.ktpvEnum, (int)FwTextToggleVal.kttvForceOn); tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 24000); tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter); tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, "Charis SIL"); tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable); m_arrowProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderTop, (int)FwTextPropVar.ktpvMilliPoint, 1000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 1000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter); m_ctxtProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderTrailing, (int)FwTextPropVar.ktpvMilliPoint, 1000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter); tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable); tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); m_indexProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderBottom, (int)FwTextPropVar.ktpvMilliPoint, 1000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); m_resultProps = tpb.GetTextProps(); var tsf = m_cache.TsStrFactory; var userWs = m_cache.DefaultUserWs; m_inputStr = tsf.MakeString(MEStrings.ksAffixRuleInput, userWs); m_indexStr = tsf.MakeString(MEStrings.ksAffixRuleIndex, userWs); m_resultStr = tsf.MakeString(MEStrings.ksAffixRuleResult, userWs); m_doubleArrow = tsf.MakeString("\u21d2", userWs); m_space = tsf.MakeString(" ", userWs); }
protected void AddHotlink(XCore.ChoiceBase choice) { PanelButton button = new PanelButton(choice, m_smallImages); m_panelMain.Controls.Add(button); button.Dock=DockStyle.Right; WatchPropertyOfButton(button); }
/// ------------------------------------------------------------------------------------ public ArchiveWithRamp(FdoCache cache, string appAbbrev, XCore.IHelpTopicProvider helpTopicProvider) { m_cache = cache; m_appAbbrev = appAbbrev; m_helpTopicProvider = helpTopicProvider; InitializeComponent(); get_Last_Backup(); }
public XRuntime() { mCore = XCore.GetMainInstance(); mAssemblyFilePath = Path.Combine(XCore.LocalStorage_TinaX, "xruntime", XRuntimeConst.AssemblyFileName); mSymbolFilePath = Path.Combine(XCore.LocalStorage_TinaX, "runtime", XRuntimeConst.SymbolFileName); mAppDomain = new ILAppDomain(); #if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE) mAppDomain.UnityMainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId; #endif }
protected void AddMenu(XCore.ChoiceGroup choice) { PanelMenu button = new PanelMenu(choice,m_smallImages, m_menuBarAdapter); Spacer s = new Spacer(); m_panelMain.Controls.Add(s); s.Dock = DockStyle.Left; s.Width = 10; m_panelMain.Controls.Add(button); button.Dock=DockStyle.Left; }
internal static string GetCatLibServiceName(Type type) { if (type is ILRuntimeType || type is ILRuntimeWrapperType) { return(type.FullName); } else { return(XCore.GetMainInstance().Services.CatApplication.Type2Service(type)); } }
/// <summary> /// 获取CatLib中的服务名 /// </summary> /// <param name="field"></param> /// <returns></returns> internal static string GetCatLibServiceName(FieldInfo field) { if (field is ILRuntimeFieldInfo) { return(field.FieldType.FullName); } else { return(XCore.GetMainInstance().Services.CatApplication.Type2Service(field.FieldType)); } }
//参考 https://github.com/CatLib/CatLib.ILRuntime/blob/de7ad644efbb5a41db7a0ba33d4fa22a727c8795/src/ILRuntimeApplication.cs internal static string GetCatLibServiceName(PropertyInfo property) { if (property is ILRuntimePropertyInfo) { return(property.PropertyType.FullName); } else { return(XCore.GetMainInstance().Services.CatApplication.Type2Service(property.PropertyType)); } }
public TryAWordRootSite(FdoCache cache, XCore.Mediator mediator) { m_fdoCache = cache; m_mediator = mediator; VisibleChanged += OnVisibleChanged; var window = mediator.PropertyTable.GetValue("window") as FwXWindow; if (window != null) m_styleSheet = window.StyleSheet; IWritingSystem wsObj = m_fdoCache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem; RightToLeft = wsObj.RightToLeftScript ? RightToLeft.Yes : RightToLeft.No; AutoScroll = true; }
public TryAWordRootSite(FdoCache cache, XCore.Mediator mediator) { m_fdoCache = cache; m_mediator = mediator; VisibleChanged += new EventHandler(OnVisibleChanged); FwXWindow window = mediator.PropertyTable.GetValue("window") as FwXWindow; if (window != null) m_styleSheet = window.StyleSheet; IWritingSystem wsObj = m_fdoCache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(m_fdoCache.DefaultVernWs); RightToLeft = wsObj.RightToLeft ? RightToLeft.Yes : RightToLeft.No; AutoScroll = true; }
/// <summary> /// 实际切换Stage的内部方法 /// </summary> /// <param name="newStage"></param> private void switchStage(StageControllerBase newStage) { if (m_CurrentStage != null) { if (m_CurrentStage == newStage) { return; } else { var last_stage = m_CurrentStage; #region Exit Event 广播退出事件 XEvent.Call(GameStageEventConst.OnStageExit, new string[] { last_stage.StageName, newStage.StageName }, GameStageEventConst.GameStageEventGroupName); XEvent.Call($"{GameStageEventConst.OnStageExit}{last_stage.StageName}", newStage.StageName, GameStageEventConst.GameStageEventGroupName); #endregion m_CurrentStage.OnExit(newStage.StageName); m_CurrentStage = newStage; Debug.Log($"[{GameStageConst.ServiceName}]{(XCore.GetMainInstance().IsCmnHans() ? "切换Stage:" : "Switch Stage:")}" + $"<color=#{TinaX.Internal.XEditorColorDefine.Color_Normal_Pure_16}>{last_stage.StageName}</color> --> <color=#{TinaX.Internal.XEditorColorDefine.Color_Emphasize_16}>{newStage.StageName}</color>"); newStage.OnEnter(last_stage.StageName); #region Enter Event 广播进入事件 XEvent.Call(GameStageEventConst.OnStageEnter, new string[] { newStage.StageName, last_stage.StageName }, GameStageEventConst.GameStageEventGroupName); XEvent.Call($"{GameStageEventConst.OnStageExit}{newStage.StageName}", last_stage.StageName, GameStageEventConst.GameStageEventGroupName); #endregion //广播切换事件 XEvent.Call(GameStageEventConst.OnStageChanged, new string[] { last_stage.StageName, newStage.StageName }, GameStageEventConst.GameStageEventGroupName); } } else { m_CurrentStage = newStage; bool isHans = XCore.GetMainInstance().IsCmnHans(); Debug.Log($"[{GameStageConst.ServiceName}]{(isHans ? "切换Stage:" : "Switch Stage:")}" + $"<color=#{TinaX.Internal.XEditorColorDefine.Color_Safe_16}>*{(isHans?"空 Stage":"No Stage")}*</color> --> <color=#{TinaX.Internal.XEditorColorDefine.Color_Emphasize_16}>{newStage.StageName}</color>"); newStage.OnEnter(string.Empty); //广播进入事件 XEvent.Call(GameStageEventConst.OnStageEnter, new string[] { newStage.StageName, string.Empty }, GameStageEventConst.GameStageEventGroupName); XEvent.Call($"{GameStageEventConst.OnStageExit}{newStage.StageName}", string.Empty, GameStageEventConst.GameStageEventGroupName); //广播切换事件 XEvent.Call(GameStageEventConst.OnStageChanged, new string[] { string.Empty, newStage.StageName }, GameStageEventConst.GameStageEventGroupName); } }
public void Initialize(ICmObject rootObj, int rootFlid, FdoCache cache, string displayNameProperty, XCore.Mediator mediator) { CheckDisposed(); Debug.Assert(cache != null && m_fdoCache == null); m_displayNameProperty = displayNameProperty; m_fdoCache = cache; m_rootObj = rootObj; m_rootFlid = rootFlid; Mediator = mediator; if (m_rootb == null) MakeRoot(); }
public XILRT(IAssetService assets) { m_Assets = assets; m_AppDomain = new ILAppDomain(); m_Core = XCore.GetMainInstance(); m_XServices = m_Core.Services; #if DEBUG && (UNITY_EDITOR || UNITY_ANDROID || UNITY_IPHONE) m_AppDomain.UnityMainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId; #endif LoadSymbol = XCore.GetMainInstance().DevelopMode; #if UNITY_EDITOR LoadSymbol = true; #endif }
public override void Initialize(FdoCache cache, ICmObject obj, int flid, string fieldName, IPersistenceProvider persistProvider, XCore.Mediator mediator, string displayNameProperty, string displayWs) { CheckDisposed(); base.Initialize(cache, obj, flid, fieldName, persistProvider, mediator, displayNameProperty, displayWs); m_view.Init(mediator, obj, this, new MetaRuleFormulaVc(cache, mediator), MetaRuleFormulaVc.kfragRule); m_insertionControl.AddOption(new InsertOption(RuleInsertType.Phoneme), DisplayOption); m_insertionControl.AddOption(new InsertOption(RuleInsertType.NaturalClass), DisplayOption); m_insertionControl.AddOption(new InsertOption(RuleInsertType.Features), DisplayOption); m_insertionControl.AddOption(new InsertOption(RuleInsertType.WordBoundary), DisplayOption); m_insertionControl.AddOption(new InsertOption(RuleInsertType.MorphemeBoundary), DisplayOption); m_insertionControl.NoOptionsMessage = DisplayNoOptsMsg; }
private static object GetLogMessage(object message) { if (_logConfig == null) { _logConfig = XCore.GetMainInstance().Services.Get <IXILRuntime>().DebugLogConfig; } if (_logConfig.EnablePrefix) { return($"{_logConfig.PrefixText}{message}"); } else { return(message); } }
public PanelMenu(XCore.ChoiceGroup group, ImageCollection images, XCore.IUIMenuAdapter menuBarAdapter):base() { m_group = group; m_images = images; m_menuBarAdapter = menuBarAdapter; this.Dock = System.Windows.Forms.DockStyle.Right; this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Location = new System.Drawing.Point(576, 2); #if USE_DOTNETBAR this.Name = "panelEx1"; #else this.Name = "panel1"; #endif this.Anchor = System.Windows.Forms.AnchorStyles.None; this.Size = new System.Drawing.Size(16, 16); #if USE_DOTNETBAR this.Style.BackgroundImagePosition = eBackgroundImagePosition.Center; #endif // this.StyleMouseOver.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemHotBackground; // this.StyleMouseOver.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemHotBackground2; // this.StyleMouseOver.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemHotText; #if USE_DOTNETBAR this.StyleMouseOver.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.StyleMouseOver.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.StyleMouseOver.BorderWidth = 1; this.Style.Alignment = System.Drawing.StringAlignment.Center; // this.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; // this.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; // this.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; // this.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; // this.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.StyleMouseOver.Alignment = StringAlignment.Center; this.Style.GradientAngle = 90; #endif this.Click +=new EventHandler(PanelMenu_Click); this.TabIndex = 0; // this.Click += new EventHandler(m_infoBarButton_Click); this.Tag = group; Display(); // UpdateInfoBarButtonImage(); }
private async void Start() { var core = XCore.New() //.UseVFS() .RegisterServiceProvider(new XAsset.XAssetProvider()) .UseUIKit() .UseI18N() .UseXILRuntime() .OnServicesStartException((service, err) => { // }); await core.RunAsync(); //startup TinaX Framework }
public override void Initialize(FdoCache cache, ICmObject obj, int flid, string fieldName, IPersistenceProvider persistProvider, XCore.Mediator mediator, string displayNameProperty, string displayWs) { CheckDisposed(); base.Initialize(cache, obj, flid, fieldName, persistProvider, mediator, displayNameProperty, displayWs); m_view.Init(mediator, obj, this, new MetaRuleFormulaVc(cache, mediator), MetaRuleFormulaVc.kfragRule); m_insertionControl.Initialize(cache, mediator, persistProvider, Rule.Name.BestAnalysisAlternative.Text); m_insertionControl.AddOption(RuleInsertType.PHONEME, DisplayOption); m_insertionControl.AddOption(RuleInsertType.NATURAL_CLASS, DisplayOption); m_insertionControl.AddOption(RuleInsertType.FEATURES, DisplayOption); m_insertionControl.AddOption(RuleInsertType.WORD_BOUNDARY, DisplayOption); m_insertionControl.AddOption(RuleInsertType.MORPHEME_BOUNDARY, DisplayOption); m_insertionControl.NoOptionsMessage = DisplayNoOptsMsg; }
static public RecordBarHandler Create(XCore.Mediator mediator, XmlNode toolConfiguration) { RecordBarHandler handler = null; XmlNode node = toolConfiguration.SelectSingleNode("treeBarHandler"); //if (node != null) //{ // handler = (TreeBarHandler)DynamicLoader.CreateObject(node); // handler.Init(mediator, node); //} if (node == null) handler = new RecordBarListHandler(); else handler = (TreeBarHandler)DynamicLoader.CreateObject(node); handler.Init(mediator, node); return handler; }
public void Initialize(ICmObject rootObj, int rootFlid, string rootFieldName, FdoCache cache, string displayNameProperty, XCore.Mediator mediator) { CheckDisposed(); // We can reinitialize in some cases but should not reuse with a different cache. Debug.Assert(cache != null && (m_fdoCache == null || m_fdoCache == cache)); m_displayNameProperty = displayNameProperty; Cache = cache; // Set cache on EditingHelper as well if needed. (See FWR-1426.) m_rootObj = rootObj; m_rootFlid = rootFlid; m_rootFieldName = rootFieldName; Mediator = mediator; if (m_rootb == null) MakeRoot(); else SetupRoot(); }
public MetaRuleFormulaVc(FdoCache cache, XCore.Mediator mediator) : base(cache, mediator) { ITsPropsBldr tpb = TsPropsBldrClass.Create(); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter); m_inputCtxtProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter); tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable); tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); m_resultCtxtProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, MiscUtils.StandardSansSerif); tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 10000); tpb.SetIntPropValues((int)FwTextPropType.ktptBorderColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalCenter); tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable); m_colHeaderProps = tpb.GetTextProps(); tpb = TsPropsBldrClass.Create(); tpb.SetStrPropValue((int)FwTextPropType.ktptFontFamily, MiscUtils.StandardSansSerif); tpb.SetIntPropValues((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, 10000); tpb.SetIntPropValues((int)FwTextPropType.ktptForeColor, (int)FwTextPropVar.ktpvDefault, (int)ColorUtil.ConvertColorToBGR(Color.Gray)); tpb.SetIntPropValues((int)FwTextPropType.ktptAlign, (int)FwTextPropVar.ktpvEnum, (int)FwTextAlign.ktalLeft); tpb.SetIntPropValues((int)FwTextPropType.ktptEditable, (int)FwTextPropVar.ktpvEnum, (int)TptEditable.ktptNotEditable); m_rowHeaderProps = tpb.GetTextProps(); var tsf = m_cache.TsStrFactory; var userWs = m_cache.DefaultUserWs; m_inputStr = tsf.MakeString(MEStrings.ksMetaRuleInput, userWs); m_resultStr = tsf.MakeString(MEStrings.ksMetaRuleResult, userWs); m_leftEnvStr = tsf.MakeString(MEStrings.ksMetaRuleLeftEnv, userWs); m_rightEnvStr = tsf.MakeString(MEStrings.ksMetaRuleRightEnv, userWs); m_switchStr = tsf.MakeString(MEStrings.ksMetaRuleSwitch, userWs); }
/// <summary> /// Override to handle case of improper menu in the reversal cat list tool. /// </summary> /// <param name="commandObject"></param> /// <param name="display"></param> /// <returns></returns> public override bool OnDisplayJumpToTool(object commandObject, ref XCore.UIItemDisplayProperties display) { CheckDisposed(); XCore.Command command = (XCore.Command)commandObject; string tool = SIL.Utils.XmlUtils.GetManditoryAttributeValue(command.Parameters[0], "tool"); string toolChoice = m_mediator.PropertyTable.GetStringProperty("currentContentControl", null); if (tool == "posEdit" && toolChoice == "reversalToolReversalIndexPOS") { display.Visible = display.Enabled = false; // we're already there! return true; } else { return base.OnDisplayJumpToTool(commandObject, ref display); } }
/// ------------------------------------------------------------------------------------ /// <summary> /// Inits the specified mediator. /// </summary> /// <param name="mediator">The mediator.</param> /// <param name="configurationParameters">The configuration parameters.</param> /// ------------------------------------------------------------------------------------ public override void Init(XCore.Mediator mediator, System.Xml.XmlNode configurationParameters) { base.Init(mediator, configurationParameters); // Load the special strings from the string table if possible. If not, use the // default (English) values. if (mediator != null && mediator.HasStringTable) { StringTbl = mediator.StringTbl; if (StringTbl != null) { m_sNullItemLabel = StringTbl.GetString("NullItemLabel", "DetailControls/ReferenceComboBox"); } } if (string.IsNullOrEmpty(m_sNullItemLabel) || m_sNullItemLabel == "*NullItemLabel*") m_sNullItemLabel = DetailControlsStrings.ksNullLabel; }
public void Init(XCore.Mediator mediator, ICmObject obj, RuleFormulaControl formulaControl, RuleFormulaVc vc, int rootFrag) { CheckDisposed(); m_formulaControl = formulaControl; Mediator = mediator; Cache = (FdoCache)mediator.PropertyTable.GetValue("cache"); m_obj = obj; m_vc = vc; m_rootFrag = rootFrag; if (m_rootb == null) { MakeRoot(); } else if (m_obj != null) { m_rootb.SetRootObject(m_obj.Hvo, m_vc, m_rootFrag, FontHeightAdjuster.StyleSheetFromMediator(m_mediator)); m_rootb.Reconstruct(); } }
public override async void OnRegister() { base.OnRegister(); var core = XCore.GetMainInstance(); var uikit = core.Services.Get <IUIKit>(); await uikit.OpenUIAsync("Assets/UI/SuperPowerEntry/SuperPowerEntry.prefab", view); m_GameServerProxy = (GameServerProxy)GameFacade.Instance.RetrieveProxy(GameServerProxy.NAME); foreach (var server in m_GameServerProxy.ServerList) { view.AddGameServer(server); } view.SelectFirstGameServer(); view.onAddGameServer = () => OpenAddGameServer(); view.onPressLogin = () => OpenLogin(); }
public PanelButton(XCore.ChoiceBase choice, IImageCollection images):base() { m_images = images; this.Dock = System.Windows.Forms.DockStyle.Right; this.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Location = new System.Drawing.Point(576, 2); this.Name = "panelEx1"; this.Anchor = System.Windows.Forms.AnchorStyles.None; this.Size = new System.Drawing.Size(120, 20); this.MouseEnter += new EventHandler(panelButton_MouseEnter); this.MouseLeave += new EventHandler(panelButton_MouseLeave); this.MouseDown += new MouseEventHandler(panelButton_MouseDown); this.Click += new EventHandler(PanelButton_Click); this.TabIndex = 0; this.Tag = choice; SetLabel(); }
public PanelMenu(XCore.ChoiceGroup group, IImageCollection images, XCore.IUIMenuAdapter menuBarAdapter):base() { m_group = group; m_images = images; m_menuBarAdapter = menuBarAdapter; this.Dock = System.Windows.Forms.DockStyle.Right; this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Location = new System.Drawing.Point(576, 2); this.Name = "panel1"; this.Anchor = System.Windows.Forms.AnchorStyles.None; this.Size = new System.Drawing.Size(16, 16); this.Click +=new EventHandler(PanelMenu_Click); this.TabIndex = 0; // this.Click += new EventHandler(m_infoBarButton_Click); this.Tag = group; Display(); // UpdateInfoBarButtonImage(); }
//object Instance<TService>(object instance); internal static StackObject *Instance_TService_Object(ILIntepreter intp, StackObject *esp, IList <object> mStack, CLRMethod method, bool isNewObj) { var genericArguments = method.GenericArguments; if (genericArguments == null || genericArguments.Length != 1 || method.ParameterCount != 1) { throw new EntryPointNotFoundException(); } var tService = XILUtil.ITypeToService(genericArguments[0]); var ptrOfThisMethod = ILIntepreter.Minus(esp, 1); ptrOfThisMethod = ILIntepreter.GetObjectAndResolveReference(ptrOfThisMethod); var instance = (object)typeof(object).CheckCLRTypes( StackObject.ToObject(ptrOfThisMethod, intp.AppDomain, mStack)); intp.Free(ptrOfThisMethod); return(ILIntepreter.PushObject(ILIntepreter.Minus(esp, 1), mStack, XCore.GetMainInstance().Services.Instance(tService, instance))); }
private void DoILBehaviour() { if (XCore.GetMainInstance().Services.TryGet <IXILRuntime>(out var xil)) { var type = xil.ILRuntimeAppDomain.GetType(ILBehaviourTypeName); if (type == null) { Debug.LogError($"[XIL Component - {ILBehaviourTypeName}:{this.gameObject.name}]Type name is invalid : {ILBehaviourTypeName}", this); return; } if (!type.ReflectionType.IsSubclassOf(typeof(XBehaviour))) { Debug.LogError($"[XIL Component - {ILBehaviourTypeName}:{this.gameObject.name}]Type \"{ILBehaviourTypeName}\" does not inherit from \"TinaX.XComponent.XBehaviour\"", this); return; } var behaviour = xil.CreateInstanceAndInject(type.ReflectionType); this.SetBehaviour(((ILTypeInstance)behaviour).CLRInstance as XBehaviour); } else { Debug.LogError($"[XIL Component - {ILBehaviourTypeName}:{this.gameObject.name}]TinaX.ILRuntime Service not ready. XIL Component cannot startup.", this); } }
//private LuaFunction m_EntryFunc; //private CustomLoadHandlerManager m_CustomLoadHandlerManager = new CustomLoadHandlerManager(); public TypeScriptManager(IAssetService buildInAssets) { m_Assets = buildInAssets; m_Core = XCore.GetMainInstance(); //m_JsVM = new JsEnv(new XTSLoader(buildInAssets, c_InternalLuaSign, )); }
protected override TreeViewItem BuildRoot() { // BuildRoot is called every time Reload is called to ensure that TreeViewItems // are created from data. Here we create a fixed set of items. In a real world example, // a data model should be passed into the TreeView and the items created from the model. // This section illustrates that IDs should be unique. The root item is required to // have a depth of -1, and the rest of the items increment from that. var root = new TreeViewItem { id = 0, depth = -1, displayName = "Root" }; //var allItems = new List<TreeViewItem> //{ // new TreeViewItem {id = 1, depth = 0, displayName = "Animals"}, // new TreeViewItem {id = 2, depth = 1, displayName = "Mammals"}, // new TreeViewItem {id = 3, depth = 2, displayName = "Tiger"}, // new TreeViewItem {id = 4, depth = 2, displayName = "Elephant"}, // new TreeViewItem {id = 5, depth = 2, displayName = "Okapi"}, // new TreeViewItem {id = 6, depth = 2, displayName = "Armadillo"}, // new TreeViewItem {id = 7, depth = 1, displayName = "Reptiles"}, // new TreeViewItem {id = 8, depth = 2, displayName = "Crocodile"}, // new TreeViewItem {id = 9, depth = 2, displayName = "Lizard"}, //}; Dict_Bundle_id.Clear(); Dict_Assets_id.Clear(); var allItems = new List <TreeViewItem>(); var root_item = new TreeViewItem { id = 1, depth = 0, displayName = "AssetBundle Assets" }; allItems.Add(root_item); int counter = 1; var vfs = XCore.GetMainInstance().GetService <IVFSInternal>(); if (vfs.LoadFromAssetbundle()) { foreach (var bundle in vfs.GetAllBundle()) { counter++; allItems.Add(new TreeViewItem { id = counter, depth = 1, displayName = bundle.AssetBundleName }); Dict_Bundle_id.Add(counter, bundle); if (bundle.Assets != null && bundle.Assets.Count > 0) { foreach (var asset in bundle.Assets) { counter++; allItems.Add(new TreeViewItem { id = counter, depth = 2, displayName = asset.AssetPathLower }); Dict_Assets_id.Add(counter, asset); } } } } // Utility method that initializes the TreeViewItem.children and .parent for all items. SetupParentsAndChildrenFromDepths(root, allItems); // Return root of the tree return(root); }
/// <summary> /// 将IType转为字符串 /// </summary> /// <param name="type">类型</param> /// <returns>字符串</returns> public static string ITypeToService(IType type) { var ilType = type as ILType; return(ilType != null ? ilType.FullName : XCore.GetMainInstance().Services.Type2ServiceName(type.TypeForCLR)); }
public void OnServiceRegister() { XCore.GetMainInstance().BindSingletonService <ILua, LuaManager>().SetAlias <Internal.ILuaInternal>(); }
public void OnQuit() { XCore.GetMainInstance().Services.Get <IGameStageInternal>().Close(); }
public void OnQuit() { _ = XCore.GetMainInstance()?.GetService <IVFSInternal>().OnServiceClose(); }
public Task <bool> OnInit() { mCore = XCore.GetMainInstance(); return(Task.FromResult(true)); }
public async Task <XException> Start() { #region config if (mInited) { return(null); } mConfig = XConfig.GetConfig <UIConfig>(UIConst.ConfigPath_Resources); if (mConfig == null) { return(new XException("[TinaX.UIKit] Connot found config file.")); } if (!mConfig.EnableUIKit) { return(null); } if (mConfig.UINameMode == UINameMode.UIGroup) { mCurUIGroup = mConfig.DefaultUIGroup; } else { mUIRootDirLoadPath = mConfig.UIRootDirectoryLoadPath; if (!mUIRootDirLoadPath.IsNullOrEmpty()) { if (mUIRootDirLoadPath.EndsWith("/")) { mUIRootDirLoadPath = mUIRootDirLoadPath.Substring(0, mUIRootDirLoadPath.Length - 1); } mUIRootDirLoadPath_withSlash = mUIRootDirLoadPath + "/"; } } mUINameMode = mConfig.UINameMode; #endregion //Init UIKit GameObjects #region UIKit GameObjects mUIKit_Root_Go = XCore.GetMainInstance().BaseGameObject .FindOrCreateGameObject("UIKit") .SetPosition(new Vector3(-9999, -9999, -9999)); if (mConfig.UseUICamera) { var camera_config = mConfig.UICameraConfig; if (camera_config == null) { camera_config = new UICameraConfig(); } mScreenUICamera = mUIKit_Root_Go.FindOrCreateGameObject("UICamera") .AddComponent <Camera>(); mScreenUICamera.clearFlags = camera_config.clearFlags; mScreenUICamera.backgroundColor = camera_config.backgroundColor; mScreenUICamera.cullingMask = camera_config.cullingMask; mScreenUICamera.orthographic = camera_config.orthographic; mScreenUICamera.orthographicSize = camera_config.orthographicSize; mScreenUICamera.nearClipPlane = camera_config.nearClipPlane; mScreenUICamera.farClipPlane = camera_config.farClipPlane; mScreenUICamera.depth = camera_config.depth; mScreenUICamera.renderingPath = camera_config.renderingPath; mScreenUICamera.targetTexture = camera_config.targetTexture; mScreenUICamera.useOcclusionCulling = camera_config.useOcclusionCulling; mScreenUICamera.allowHDR = camera_config.allowHDR; mScreenUICamera.allowMSAA = camera_config.allowMSAA; } //Default UIRoot refreshUIRoot(0); //EventSystem #if ENABLE_LEGACY_INPUT_MANAGER if (mConfig.AutoCreateEventSystem) { var es_go = GameObjectHelper.FindOrCreateGameObject("EventSystem"); var event_system = es_go.GetComponentOrAdd <UnityEngine.EventSystems.EventSystem>(); event_system.sendNavigationEvents = true; event_system.pixelDragThreshold = 10; var input_module = es_go.GetComponentOrAdd <UnityEngine.EventSystems.StandaloneInputModule>(); } #endif #endregion await Task.Yield(); return(null); }
public void OnServiceRegister() { XCore.GetMainInstance()?.BindSingletonService <IVFS, IAssetService, VFSKit>().SetAlias <IVFSInternal>(); }
public XException GetStartException() { return(XCore.GetMainInstance().GetService <IXRuntimeInternal>().GetStartException()); }
/// <summary> /// 服务启动 /// </summary> /// <returns></returns> public Task <bool> OnStart() { return(XCore.GetMainInstance().GetService <IXRuntimeInternal>().Start()); }
/// <summary> /// 服务注册 /// </summary> public void OnServiceRegister() { XCore.GetMainInstance().BindSingletonService <IXRuntime, IAppDomain, XRuntime>().SetAlias <IXRuntimeInternal>(); }
public ServiceContainer(XCore core) { m_Core = core; CatApplication = new XCatApplication(m_Core); App.That = CatApplication; }
public Task OnRestart() { return(XCore.GetMainInstance()?.GetService <IVFSInternal>().OnServiceClose()); }