/// <summary> /// インポート /// </summary> /// <param name="fileName"></param> /// <param name="ssceName"></param> /// <param name="targets"></param> public Information Import(string fileName, string ssceName, SSPJImportTool.TargetAnimation[] targets) { var xml = new XmlDocument(); xml.Load(fileName); // 上書き設定の読み込み OverrideSettings overrideSettings = CreateOverrideSettings(NodeReader.findFirst(xml, "SpriteStudioAnimePack/settings")); // パーツ情報 var partsNode = NodeReader.findFirst(xml, "SpriteStudioAnimePack/Model/partList").Children("value"); var parts = from p in partsNode.Nodes select new Part(p); // セルの指定 var cellMapNames = NodeReader.findFirst(xml, "SpriteStudioAnimePack/cellmapNames").Children("value"); // アニメーション情報 var animeNode = NodeReader.findFirst(xml, "SpriteStudioAnimePack/animeList").Children("anime"); var animes = targets == null ? from a in animeNode.Nodes select new Animation(a) : from a in animeNode.Nodes where System.Array.Find(targets, (o) => o.File == ssceName && o.Animation == a.AtText("name")) != null select new Animation(a); return(new Information() { settings = overrideSettings, cellMapNames = cellMapNames.AtText(), parts = parts.ToList().AsReadOnly(), animations = animes.ToList().AsReadOnly(), }); }
/// <summary> /// 上書き設定の生成 /// </summary> /// <param name="settings"></param> /// <returns></returns> private static OverrideSettings CreateOverrideSettings(NodeReader settings) { OverrideSettings overrideSettings = new OverrideSettings(); { var fps = settings.ChildOrNull("fps"); var frameCount = settings.ChildOrNull("frameCount"); var sortMode = settings.ChildOrNull("sortMode"); var pivot = settings.ChildOrNull("pivot"); overrideSettings.fps = fps != null ? (int?)fps.AtInteger() : null; overrideSettings.frameCount = frameCount != null ? (int?)frameCount.AtInteger() : null; overrideSettings.sortMode = sortMode != null ? (SortMode?)SortModeOpeartor.FromString(sortMode.AtText()) : null; if (pivot != null) { float[] pivots = pivot.AtFloats(' '); overrideSettings.pivotX = pivots[0]; overrideSettings.pivotY = pivots[1]; } else { overrideSettings.pivotX = null; overrideSettings.pivotY = null; } } return(overrideSettings); }
protected override bool OnNotificationProcessing(OSNotificationReceivedResult p0) { _result = p0; var overrideSettings = new OverrideSettings { Extender = this }; DisplayNotification(overrideSettings); return(false); }
protected override bool OnNotificationProcessing(OSNotificationReceivedResult p0) { _result = p0; var overrideSettings = new OverrideSettings { Extender = this }; var type = p0.Payload.AdditionalData.GetString("type"); if (!type.Equals(PushSubscription.User.GetEnumDescription()) || BasePresenter.User.PushSubscriptions.Contains(PushSubscription.User)) { DisplayNotification(overrideSettings); } return(false); }
protected override bool OnNotificationProcessing(OSNotificationReceivedResult p0) { _result = p0; var overrideSettings = new OverrideSettings { Extender = this }; var isUserAuthenticated = AppSettings.User.HasPostingPermission; if (isUserAuthenticated) { DisplayNotification(overrideSettings); } return(isUserAuthenticated); }
public Animation(NodeReader node) { name = node.AtText("name"); if (node.AtBoolean("overrideSettings")) { settings = CreateOverrideSettings(node.Child("settings")); } else { settings = new OverrideSettings(); } var parts = node.Child("partAnimes").Children("partAnime"); List <PartAnimation> results = new List <PartAnimation>(); foreach (var part in parts) { results.Add(new PartAnimation(part)); } this.parts = results.AsReadOnly(); }
protected override bool OnNotificationProcessing(OSNotificationReceivedResult p0) { OverrideSettings overrideSettings = new OverrideSettings(); overrideSettings.Extender = new NotificationCompat.CarExtender(); Com.OneSignal.Android.OSNotificationPayload payload = p0.Payload; JSONObject additionalData = payload.AdditionalData; if (additionalData.Has("room_name")) { string roomName = additionalData.Get("room_name").ToString(); string callType = additionalData.Get("call_type").ToString(); string callId = additionalData.Get("call_id").ToString(); string fromId = additionalData.Get("from_id").ToString(); string toId = additionalData.Get("to_id").ToString(); return(false); } return(true); }
/// <summary> /// 上書き設定の生成 /// </summary> /// <param name="settings"></param> /// <returns></returns> private static OverrideSettings CreateOverrideSettings( NodeReader settings ) { OverrideSettings overrideSettings = new OverrideSettings(); { var fps = settings.ChildOrNull( "fps" ); var frameCount = settings.ChildOrNull( "frameCount" ); var sortMode = settings.ChildOrNull( "sortMode" ); var pivot = settings.ChildOrNull( "pivot" ); overrideSettings.fps = fps != null ? (int?) fps.AtInteger() : null; overrideSettings.frameCount = frameCount != null ? (int?) frameCount.AtInteger() : null; overrideSettings.sortMode = sortMode != null ? (SortMode?) SortModeOpeartor.FromString( sortMode.AtText() ) : null; if ( pivot != null ) { float[] pivots = pivot.AtFloats( ' ' ); overrideSettings.pivotX = pivots[0]; overrideSettings.pivotY = pivots[1]; } else { overrideSettings.pivotX = null; overrideSettings.pivotY = null; } } return overrideSettings; }
public Animation( NodeReader node ) { name = node.AtText( "name" ); if ( node.AtBoolean( "overrideSettings" ) ) { settings = CreateOverrideSettings( node.Child( "settings" ) ); } else { settings = new OverrideSettings(); } var parts = node.Child( "partAnimes" ).Children( "partAnime" ); List<PartAnimation> results = new List<PartAnimation>(); foreach ( var part in parts ) { results.Add( new PartAnimation( part ) ); } this.parts = results.AsReadOnly(); }