public PreviewDataConverter()
        {
            var baconProvider = ServiceLocator.Current.GetInstance <IBaconProvider>();

            _imagesService  = baconProvider.GetService <IImagesService>();
            _systemServices = baconProvider.GetService <ISystemServices>();
        }
        public CommentViewModelCollection(IBaconProvider baconProvider, string permaLink, string subreddit, string subredditId, string targetName)
        {
            _timerHandles  = new List <WeakReference>();
            _state         = new Dictionary <object, object>();
            _permaLink     = permaLink;
            _subreddit     = subreddit;
            _targetName    = targetName;
            _baconProvider = baconProvider;
            var settingsService = baconProvider.GetService <ISettingsService>();

            if (settingsService.IsOnline())
            {
                _listingProvider = new BaconographyPortable.Model.Reddit.ListingHelpers.PostComments(baconProvider, subreddit, permaLink, targetName);
            }
            else
            {
                _listingProvider = new BaconographyPortable.Model.KitaroDB.ListingHelpers.PostComments(baconProvider, subredditId, permaLink, targetName);
            }


            //dont add to the observable collection all at once, make the view models on the background thread then start a ui timer to add them 10 at a time
            //to the actual observable collection leaving a bit of time in between so we dont block anything

            _systemServices = baconProvider.GetService <ISystemServices>();
            _systemServices.RunAsync(RunInitialLoad);
        }
Exemplo n.º 3
0
 public AcademicController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _context            = context;
     _studentServices    = studentServices;
     _systemServices     = systemServices;
     _studentCredentials = new StudentCredential(context, studentServices, systemServices);
 }
Exemplo n.º 4
0
        internal Sprite(IEnumerable<ISwfTag> tags, ushort id, ushort frames, ISystemServices services)
        {
            ushort frame = 0;
            var removed = new List<ushort>();
            var modified = new List<PlaceObject2Tag>();
            var actions = new List<ActionBlock>();

            ID = id;
            Frames = new SpriteFrame[frames];
            foreach (var tag in tags)
            {
                if (tag is ShowFrameTag)
                {
                    Frames[frame++] = new SpriteFrame(actions.ToArray(), removed, modified);
                    actions.Clear();
                }
                else if (tag is FrameLabelTag)
                    _frameLabels.Add((tag as FrameLabelTag).Label, frame);
                else if (tag is PlaceObjectTag)
                    modified.Add(new PlaceObject2Tag(tag as PlaceObjectTag));
                else if (tag is PlaceObject2Tag)
                    modified.Add(tag as PlaceObject2Tag);
                else if (tag is RemoveObjectTag)
                    removed.Add((tag as RemoveObjectTag).Depth);
                else if (tag is RemoveObject2Tag)
                    removed.Add((tag as RemoveObject2Tag).Depth);
                else if (tag is DoActionTag)
                    actions.Add((tag as DoActionTag).Actions);
                else
                    // TODO: Implement remaining valid tags
                    // DoABC, StartSound, SoundStreamHead, SoundStreamHead2, SoundStreamBlock, PlaceObject3
                    UnhandledTag(tag, services);
            }
        }
Exemplo n.º 5
0
        public Bitmap(ISwfDefinitionTag tag, ISystemServices services)
        {
            Texture2D texture;
            if (tag is DefineBitsLosslessTag)
            {
                var t = tag as DefineBitsLosslessTag;
                texture = new Texture2D(services.GraphicsDevice, t.Width, t.Height, false, SurfaceFormat.Color);
                texture.SetData(t.Pixels);
            }
            else if (tag is DefineBitsTag)
            {
                var t = tag as DefineBitsTag;
                var t3 = tag as DefineBitsJPEG3Tag;
                texture = Texture2D.FromStream(services.GraphicsDevice, new MemoryStream(t.ImageData));

                if (t3 != null && t3.HasAlpha)
                {
                    var alpha = Swf.BitmapUtils.DecompressAlphaValues(t3.CompressedAlpha, texture.Width, texture.Height);
                    var data = new Color[texture.Width * texture.Height];
                    texture.GetData(data);
                    for (int i = data.Length - 1; i >= 0; data[i].A = alpha[i], i--) ;
                    texture.SetData(data);
                }
            }
            else
                throw new InvalidOperationException("Tag does not define bitmap!");

            ID = tag.CharacterID;
            Image = services.VectorDevice.CreateImage(texture, false, false);
        }
 public CombinedSearchViewModel(IBaconProvider baconProvider)
 {
     _baconProvider = baconProvider;
     _viewModelContext = baconProvider.GetService<IViewModelContextService>();
     _systemServices = baconProvider.GetService<ISystemServices>();
     SearchResults = new BindingShellViewModelCollection(new SearchResultsViewModelCollection(_baconProvider, "", false));
     
 }
 public PreviewImageViewModelWrapper(Task <IEnumerable <Tuple <string, string> > > imagesTask, ISystemServices systemServices)
 {
     _systemServices = systemServices;
     IsLoading       = true;
     imagesTask.ContinueWith(FinishLoad, TaskScheduler.FromCurrentSynchronizationContext());
     MoveBack    = new RelayCommand(() => CurrentPosition = _currentPosition - 1);
     MoveForward = new RelayCommand(() => CurrentPosition = _currentPosition + 1);
 }
Exemplo n.º 8
0
 public PreviewImageViewModelWrapper(Task<IEnumerable<Tuple<string, string>>> imagesTask, ISystemServices systemServices)
 {
     _systemServices = systemServices;
     IsLoading = true;
     imagesTask.ContinueWith(FinishLoad, TaskScheduler.FromCurrentSynchronizationContext());
     MoveBack = new RelayCommand(() => CurrentPosition = _currentPosition - 1);
     MoveForward = new RelayCommand(() => CurrentPosition = _currentPosition + 1);
 }
Exemplo n.º 9
0
 public HostelBookingController(UnisolAPIdbContext context, IStudentServices studentServices,
                                ISystemServices systemServices, IConfiguration configuration)
 {
     _context           = context;
     _systemServices    = systemServices;
     _configuration     = configuration;
     _studentServices   = studentServices;
     studentCredentials = new StudentCredential(_context, studentServices, systemServices);
 }
Exemplo n.º 10
0
 public UnitsController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _context           = context;
     _studentServices   = studentServices;
     _systemServices    = systemServices;
     studentCredentials = new StudentCredential(context, studentServices, systemServices);
     campusDetails      = new CampusDetails(context);
     _financeUtilities  = new FinanceController(context, studentServices, systemServices);
 }
Exemplo n.º 11
0
 public FlashDocument(string name, SwfStream stream, ISystemServices services)
     : base(stream.ProcessFile(), 0, stream.FrameCount, services)
 {
     Name = name;
     Version = stream.Version;
     Width = stream.Rectangle.Width;
     Height = stream.Rectangle.Height;
     FrameDelay = 1000.0 / (double)stream.FrameRate;
 }
Exemplo n.º 12
0
        public Controller(Config config, ISystemServices ss, IRelay relay)
        {
            m_config = config;
            m_services = ss;
            m_relay = relay;
            m_isDst = config.IsDST;

            ScheduleLights();
        }
Exemplo n.º 13
0
        public Shape(ISwfDefinitionTag tag, ISystemServices services, FlashDocument document)
        {
            var state = services.VectorDevice.State;
            var t = tag as DefineShapeTag;
            var shapes = t.Shape.SubShapes;

            ID = tag.CharacterID;
            Bounds = t.ShapeBounds;
            _subShapes = new SubShape[shapes.Length];
            for (int s = 0; s < _subShapes.Length; s++)
            {
                var subShape = _subShapes[s] = new SubShape();
                var shape = shapes[s];

                subShape._fills = new SubShapeFill[shape.Fills.Count];
                subShape._strokes = new SubShapeStroke[shape.Lines.Count];

                var paints = new List<VGPaint>(shape.Fills.Count + shape.Lines.Count);
                int i = 0;
                VGPaint paint;

                foreach (var f in shape.Fills)
                {
                    paints.Add(paint = MakeFill(f.Key, services.VectorDevice, document));
                    subShape._fills[i++] = new SubShapeFill
                    {
                        Paint = paint,
                        FillMatrix = f.Key.Matrix,
                        Path = services.VectorDevice.PreparePath(f.Value.GetPath(), VGPaintMode.Fill)
                    };
                }

                i = 0;
                foreach (var l in shape.Lines)
                {
                    paint = l.Key.HasFill ? MakeFill(l.Key.Fill, services.VectorDevice, document) : services.VectorDevice.CreateColorPaint(l.Key.Color);
                    paints.Add(paint);

                    state.StrokeStartCap = l.Key.StartCapStyle;
                    state.StrokeEndCap = l.Key.EndCapStyle;
                    state.StrokeJoin = l.Key.JoinStyle;
                    state.StrokeMiterLimit = (float)l.Key.MiterLimit;
                    subShape._strokes[i++] = new SubShapeStroke
                    {
                        Paint = paint,
                        Path = services.VectorDevice.PreparePath(l.Value.GetPath(), VGPaintMode.Stroke),
                        Thickness = l.Key.Width,
                        FillMatrix = l.Key.HasFill ? l.Key.Fill.Matrix : VGMatrix.Identity,
                        ScaleX = !l.Key.NoHScale,
                        ScaleY = !l.Key.NoVScale
                    };
                }

                subShape._paints = paints.ToArray();
            }
        }
Exemplo n.º 14
0
 public LoginViewModel(IBaconProvider baconProvider)
 {
     _userService = baconProvider.GetService<IUserService>();
     _systemServices = baconProvider.GetService<ISystemServices>();
     _notificationService = baconProvider.GetService<INotificationService>();
     _settingsService = baconProvider.GetService<ISettingsService>();
     _baconProvider = baconProvider;
     _isLoggedIn = false;
     MessengerInstance.Register<UserLoggedInMessage>(this, OnUserLoggedIn);
 }
Exemplo n.º 15
0
 public LoginViewModel(IBaconProvider baconProvider)
 {
     _userService         = baconProvider.GetService <IUserService>();
     _systemServices      = baconProvider.GetService <ISystemServices>();
     _notificationService = baconProvider.GetService <INotificationService>();
     _settingsService     = baconProvider.GetService <ISettingsService>();
     _baconProvider       = baconProvider;
     _isLoggedIn          = false;
     MessengerInstance.Register <UserLoggedInMessage>(this, OnUserLoggedIn);
 }
		public SubredditSelectorViewModel(IBaconProvider baconProvider)
        {
            _baconProvider = baconProvider;
            _redditService = _baconProvider.GetService<IRedditService>();
            _navigationService = _baconProvider.GetService<INavigationService>();
            _userService = _baconProvider.GetService<IUserService>();
            _dynamicViewLocator = _baconProvider.GetService<IDynamicViewLocator>();
            _systemServices = _baconProvider.GetService<ISystemServices>();
            Subreddits = new BindingShellViewModelCollection(new SubredditViewModelCollection(_baconProvider));
        }
Exemplo n.º 17
0
        public Campus360AcademicsController(UnisolAPIdbContext context, IPortalApiProxy portalProxy, IStudentServices studentServices, ISystemServices systemServices)
        {
            _context           = context;
            studentCredentials = new StudentCredential(context, studentServices, systemServices);
            _studentServices   = studentServices;
            _systemServices    = systemServices;

            campusDetails = new CampusDetails(context);
            _portalProxy  = portalProxy;
        }
Exemplo n.º 18
0
 internal RootMovieClip(FlashDocument document, ISystemServices services)
     : base(null, document, null)
 {
     ButtonStack = new VGMatrixStack(32);
     Services = services;
     Transparent = true;
     Root = this;
     StartTime = DateTime.Now;
     Document = document;
     Antialiasing = VGAntialiasing.Faster;
     GlobalScope = new GlobalScope(this);
     Context.RootClip = this;
     Context.Scope.AddFirst(GlobalScope);
 }
Exemplo n.º 19
0
        public static void DoMonitor(Controller controller, Config config, ISystemServices sr)
        {
            s_controller = controller;
            s_config = config;
            s_schedulingResources = sr;

            s_screenUpdate = new Timer(new TimerCallback(UpdateMonitorScreen),
                                            null,
                                            2 * 1000,  // Wait 2 seconds to let the controller start
                                            5 * 1000); // Update every 5 seconds

            s_monitorThread = new Thread(new ThreadStart(DimKeyPad));
            s_monitorThread.Start();
        }
Exemplo n.º 20
0
        public void Initialize(IViewModelContextService viewModelContextService, IOOMService oomService, ISettingsService settingsService, 
            ISuspensionService suspensionService, IDynamicViewLocator dynamicViewLocator, IOfflineService offlineService, IImagesService imagesService,
            ISystemServices systemServices, ISuspendableWorkQueue suspendableWorkQueue)
        {
            _viewModelContextService = viewModelContextService;
            _oomService = oomService;
            _settingsService = settingsService;
            _suspensionService = suspensionService;
            _dynamicViewLocator = dynamicViewLocator;
            _offlineService = offlineService;
            _imagesService = imagesService;
            _systemServices = systemServices;
            _suspendableWorkQueue = suspendableWorkQueue;

            _oomService.OutOfMemory += _oomService_OutOfMemory;
        }
        public void Initialize(ISmartOfflineService smartOfflineService, ISuspensionService suspensionService, IRedditService redditService,
            ISettingsService settingsService, ISystemServices systemServices, IOfflineService offlineService, INotificationService notificationService,
            IUserService userService, ISuspendableWorkQueue suspendableWorkQueue)
        {
            _smartOfflineService = smartOfflineService;
            _suspensionService = suspensionService;
            _redditService = redditService;
            _settingsService = settingsService;
            _systemServices = systemServices;
            _offlineService = offlineService;
            _notificationService = notificationService;
            _userService = userService;
            _suspendableWorkQueue = suspendableWorkQueue;

            _smartOfflineService.OffliningOpportunity += _smartOfflineService_OffliningOpportunity;
            Messenger.Default.Register<UserLoggedInMessage>(this, UserLoggedIn);
        }
Exemplo n.º 22
0
        public ButtonInfo(ISwfDefinitionTag tag, ISystemServices services, FlashDocument document)
        {
            if (tag is DefineButtonTag)
                tag = new DefineButton2Tag(tag as DefineButtonTag);

            var b = tag as DefineButton2Tag;
            CxForm = null;
            TrackAsMenu = b.TrackAsMenu;
            Actions = b.Actions;
            ID = tag.CharacterID;

            Parts = b.Parts
                .Where(r => r.Up || r.Down || r.Over)
                .OrderBy(r => r.CharacterDepth)
                .Select(r => new ButtonPart(r, document))
                .Where(p => p.Character != null)
                .ToArray();

            GenerateHits(b, services, document);
        }
Exemplo n.º 23
0
        internal void AddInfo(ISwfTag tag, ISystemServices services)
        {
            if (tag is DefineFontInfoTag)
            {
                var i = (tag as DefineFontInfoTag);
                SetDeviceFont(i.Name, i.Characters, services);
            }
            else if (tag is DefineFontTag)
                GlyphFont = (tag as DefineFontTag).Glyphs;
            else if (tag is DefineFont2Tag)
            {
                var font = tag as DefineFont2Tag;

                if (font.Glyphs != null && font.Glyphs.Length > 0)
                    GlyphFont = font.Glyphs;

                if (!string.IsNullOrEmpty(font.Name))
                    SetDeviceFont(font.Name, font.Characters, services);
            }
        }
Exemplo n.º 24
0
 public LoadIndicatorViewModel(IBaconProvider baconProvider)
 {
     _running = 0;
     _systemServices = baconProvider.GetService<ISystemServices>();
     MessengerInstance.Register<LoadingMessage>(this, OnLoadingMessage);
 }
Exemplo n.º 25
0
 public LibraryController(LibraryAPIdbContext libraryContext, UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _libraryContext    = libraryContext;
     studentCredentials = new StudentCredential(context, studentServices, systemServices);
     library            = new Library(libraryContext);
 }
Exemplo n.º 26
0
        public PreviewDataConverter()
        {
			var baconProvider = ServiceLocator.Current.GetInstance<IBaconProvider>();
            _imagesService = baconProvider.GetService<IImagesService>();
            _systemServices = baconProvider.GetService<ISystemServices>();
        }	
Exemplo n.º 27
0
 public TranscriptController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemRepository)
 {
     _context          = context;
     studentCredential = new StudentCredential(context, studentServices, systemRepository);
 }
Exemplo n.º 28
0
        public Text(DefineTextTag tag, ISystemServices services, FlashDocument document)
        {
            ID = tag.CharacterID;
            Matrix = tag.Matrix;
            Bounds = tag.Bounds;

            var path = new VGPath();
            var parts = new List<VGPreparedPath>();
            var scale = Vector2.One;
            var leftTop = new Vector2(tag.Bounds.Left, tag.Bounds.Top);

            Font font = null;
            ushort? lastFont = null;
            VGColor? lastColor = null;

            foreach (var rec in tag.TextRecords)
            {
                if ((rec.HasFont && lastFont != rec.FontId) || (rec.HasColor && lastColor != rec.Color))
                {
                    if (!path.IsEmpty && lastFont.HasValue && lastColor.HasValue)
                    {
                        var pp = services.VectorDevice.PreparePath(path, VGPaintMode.Fill);
                        pp.Tag = services.VectorDevice.CreateColorPaint(lastColor.Value);
                        parts.Add(pp);
                    }

                    path = new VGPath();
                }

                if (rec.HasColor) lastColor = rec.Color;
                if (rec.HasFont)
                {
                    font = document[rec.FontId] as Font;
                    scale = scale = new Vector2(rec.FontSize, rec.FontSize);
                    if (font != null) lastFont = rec.FontId;
                }

                if (font == null || !lastColor.HasValue || rec.Glyphs.Length == 0)
                    continue;

                var offset = new Vector2(rec.HasXOffset ? rec.XOffset : 0, rec.HasYOffset ? rec.YOffset : 0);
                var refPt = Vector2.Zero;
                if (rec.Glyphs[0].GlyphIndex < font.GlyphFont.Length)
                    refPt = font.GlyphFont[rec.Glyphs[0].GlyphIndex].ReferencePoint * scale;
                var xoff = Vector2.Zero;

                foreach (var g in rec.Glyphs)
                {
                    if (g.GlyphIndex >= font.GlyphFont.Length) continue;

                    var fg = font.GlyphFont[g.GlyphIndex];
                    if (fg.GlyphPath == null) continue;

                    var rpt = fg.ReferencePoint.X * scale.X;

                    var p = fg.GlyphPath.Clone();
                    p.Scale(scale);
                    p.Offset(offset + xoff);
                    path.Append(p);

                    xoff.X += g.GlyphAdvance;
                }
            }

            if (!path.IsEmpty && lastFont.HasValue && lastColor.HasValue)
            {
                var pp = services.VectorDevice.PreparePath(path, VGPaintMode.Fill);
                pp.Tag = services.VectorDevice.CreateColorPaint(lastColor.Value);
                parts.Add(pp);
            }

            TextParts = parts.ToArray();
        }
Exemplo n.º 29
0
 public ExamCardController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _context           = context;
     _studentServices   = studentServices;
     studentCredentials = new StudentCredential(_context, studentServices, systemServices);
     _financeUtilities  = new FinanceController(context, studentServices, systemServices);
 }
Exemplo n.º 30
0
 /// <summary>
 /// 短信统计
 /// </summary>
 public MessageStatController()
 {
     _ISystemServices = new SystemServices();
 }
Exemplo n.º 31
0
 public PreviewDataConverter(IBaconProvider baconProvider)
 {
     _imagesService = baconProvider.GetService<IImagesService>();
     _systemServices = baconProvider.GetService<ISystemServices>();
 }
Exemplo n.º 32
0
 /// <summary>
 /// 运维管理员配置
 /// </summary>
 public OperationSysController()
 {
     _ISystemServices = new SystemServices();
 }
Exemplo n.º 33
0
 public OnlineReportingController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _context           = context;
     _studentServices   = studentServices;
     studentCredentials = new StudentCredential(context, studentServices, systemServices);
 }
Exemplo n.º 34
0
 public PreviewDataConverter(IBaconProvider baconProvider)
 {
     _imagesService  = baconProvider.GetService <IImagesService>();
     _systemServices = baconProvider.GetService <ISystemServices>();
 }
Exemplo n.º 35
0
 public SystemController(ISystemServices systemServices)
 {
     _systemServices = systemServices;
 }
Exemplo n.º 36
0
        public void DumpCharacters(ISystemServices services, bool shapes, bool texts)
        {
            var dev = services.VectorDevice;
            int i = 0;
            foreach (var ch in _characters.Where(c => c.Value != null))
            {
                if (!ch.Value.Bounds.HasValue) continue;

                dev.State.ResetDefaultValues();
                dev.State.SetAntialiasing(VGAntialiasing.Better);
                dev.State.NonScalingStroke = true;
                dev.State.MaskingEnabled = false;
                dev.State.FillRule = VGFillRule.EvenOdd;
                dev.State.ColorTransformationEnabled = true;
                dev.State.SetProjection(ch.Value.Bounds.Value.Width, ch.Value.Bounds.Value.Height);
                dev.State.PathToSurface.Push(VGMatrix.Translate(-ch.Value.Bounds.Value.Left, -ch.Value.Bounds.Value.Top));

                using (var surface = dev.CreateSurface(ch.Value.Bounds.Value.Width / 10, ch.Value.Bounds.Value.Height / 10, Microsoft.Xna.Framework.Graphics.SurfaceFormat.Color))
                {
                    switch (ch.Value.Type)
                    {
                        case CharacterType.Shape:
                            if (shapes)
                            {
                                var shape = ch.Value as Shape;
                                using (var context = dev.BeginRendering(surface, new Movie.DisplayState(), true))
                                    shape.Draw(context);

                                using (var fs = new System.IO.FileStream("Shape_" + ch.Key + ".tga", System.IO.FileMode.Create))
                                    XnaVG.Loaders.TgaImage.SaveAsTga(fs, surface.Target);
                            }
                            break;
                        case CharacterType.Text:
                            if (texts)
                            {
                                var text = ch.Value as Text;
                                using (var context = dev.BeginRendering(surface, new Movie.DisplayState(), true))
                                    text.Draw(context);

                                using (var fs = new System.IO.FileStream("Text_" + ch.Key + ".tga", System.IO.FileMode.Create))
                                    XnaVG.Loaders.TgaImage.SaveAsTga(fs, surface.Target);
                            }
                            break;
                    }
                }

                i++;
                Console.WriteLine(i + " / " + _characters.Count);
            }
        }
Exemplo n.º 37
0
 public FinanceController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _context           = context;
     studentCredentials = new StudentCredential(_context, studentServices, systemServices);
 }
Exemplo n.º 38
0
        protected override void UnhandledTag(ISwfTag tag, ISystemServices services)
        {
            if (tag is ISwfDefinitionTag)
            {
                var defTag = tag as ISwfDefinitionTag;

                ICharacter character = null;
                switch (defTag.Type)
                {
                    case CharacterType.BinaryData: character = new BinaryData(defTag.CharacterID, (tag as DefineBinaryDataTag).Data); break;
                    case CharacterType.Bitmap: character = new Bitmap(defTag, services); break;
                    case CharacterType.Button: character = new ButtonInfo(defTag, services, this); break;
                    case CharacterType.Shape: character = new Shape(defTag, services, this); break;
                    case CharacterType.Text: character = new Text(tag as DefineTextTag, services, this); break;
                    case CharacterType.Sprite:
                        {
                            var sprite = tag as DefineSpriteTag;
                            character = new Sprite(sprite.Tags, defTag.CharacterID, sprite.FrameCount, services);
                        }
                        break;
                    case CharacterType.Font:
                        {
                            var font = new Font(defTag.CharacterID);
                            font.AddInfo(tag, services);
                            character = font;
                        }
                        break;
                }

                if (character != null)
                    _characters.Add(defTag.CharacterID, character);
            }
            else if (tag is SetBackgroundColorTag)
            {
                BackgroundColor = (tag as SetBackgroundColorTag).Color;
            }
            else if (tag is DefineScenesAndFrameLabelsTag)
            {
                var def = tag as DefineScenesAndFrameLabelsTag;
                _frameLabels = new Dictionary<string, ushort>(def.FrameLabels);
                _scenes = new Dictionary<string, ushort>(def.Scenes);
            }
            else if (tag is DefineFontInfoTag)
            {
                var fi = tag as DefineFontInfoTag;
                (_characters[fi.FontID] as Font).AddInfo(tag, services);
            }
            else if (tag is DoInitActionTag)
            {
                var init = tag as DoInitActionTag;
                (_characters[init.SpriteID] as Sprite).InitAction = init.Actions;
                _initOrder.Add(init.SpriteID);
            }
            else if (tag is DefineButtonCxFormTag)
            {
                var cxf = tag as DefineButtonCxFormTag;
                (_characters[cxf.CharacterID] as ButtonInfo).SetCxForm(cxf.CxForm);
            }

            #region Not implemented tags

            /*
            else if (tag is DefineEditTextTag) { }
             */

            // else if (tag is SetTabIndexTag) { }
            // else if (tag is DefineScalingGridTag) { }
            else
                base.UnhandledTag(tag, services);

            #endregion

            #region Unsupported tags
            //TODO: Tags not yet implemented or unsupported
            //DefineFontNameTag
            //{14, "DefineSound"},
            //{17, "DefineButtonSound"},
            //{24, "Protect"},
            //{46, "DefineMorphShape"},
            //{56, "ExportAssets"},
            //{57, "ImportAssets"},
            //{58, "EnableDebugger"},
            //{60, "DefineVideoStream"},
            //{61, "VideoFrame"},
            //{64, "EnableDebugger2"},
            //{65, "ScriptLimits"},
            //{69, "FileAttributes"},
            //{71, "ImportAssets2"},
            //{73, "DefineFontAlignZones"},
            //{74, "CSMTextSettings"},
            //{76, "SymbolClass"},
            //{77, "Metadata"},
            //{84, "DefineMorphShape2"},
            //{89, "StartSound2"},
            //{91, "DefineFont4"}
            #endregion
        }
Exemplo n.º 39
0
 protected virtual void UnhandledTag(ISwfTag tag, ISystemServices services)
 {
     services.Log("Unhandled tag '{0}' inside {1}!", tag.ToString(), GetType().Name);
 }
Exemplo n.º 40
0
        /// <summary>
        /// Dependency Injection
        /// </summary>
        public WebApiApplication()
        {
            systemServices = Services.DependencyResolution.IoC.Container().GetInstance <ISystemServices>(TargetImplement.V1.ToString());

            networkHelper = new NetworkHelper();
        }
 public LoadIndicatorViewModel(IBaconProvider baconProvider)
 {
     _running        = 0;
     _systemServices = baconProvider.GetService <ISystemServices>();
     MessengerInstance.Register <LoadingMessage>(this, OnLoadingMessage);
 }
Exemplo n.º 42
0
 public CoursesController(IStudentServices studentServices, UnisolAPIdbContext context, ISystemServices systemService)
 {
     _studentServices    = studentServices;
     _context            = context;
     _studentCredentials = new StudentCredential(_context, studentServices, systemService);
 }
Exemplo n.º 43
0
 public GetSiteFireListHandler(IVmsLogger <GetSiteFireListHandler> logger, ISystemServices systemServices, ISiteRepository siteRepository)
 {
     _logger         = logger;
     _systemServices = systemServices;
     _siteRepository = siteRepository;
 }
Exemplo n.º 44
0
 public DatabaseUtilitiesController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     _context           = context;
     _studentServices   = studentServices;
     studentCredentials = new StudentCredential(_context, studentServices, systemServices);
 }
Exemplo n.º 45
0
        private void SetDeviceFont(string name, char[] table, ISystemServices services)
        {
            if (DeviceFont != null)
                return;

            GlyphChars = table;
            DeviceFont = services.LoadFont(name);
            if (DeviceFont == null)
                services.Log("Font '{0}' does not exist!", name);
        }
Exemplo n.º 46
0
 public GetSiteAvailabilityHandler(IVmsLogger <GetSiteAvailabilityHandler> logger, ISiteRepository siteRepository, ISystemServices systemServices)
 {
     _logger         = logger;
     _siteRepository = siteRepository;
     _systemServices = systemServices;
 }
Exemplo n.º 47
0
 public ElectionsController(UnisolAPIdbContext context, IStudentServices studentServices, ISystemServices systemServices)
 {
     studentCredentials = new StudentCredential(context, studentServices, systemServices);
 }
Exemplo n.º 48
0
        private void GenerateHits(DefineButton2Tag tag, ISystemServices services, FlashDocument document)
        {
            var hit = tag.Parts.Where(r => r.HitTest).Select(r => new ButtonPart(r, document));
            foreach (var h in hit)
            {
                if (h.Character == null) continue;
                if (!h.Character.Bounds.HasValue) continue;
                _hitBounds = Rectangle.Union(_hitBounds, TransformBounds(h.Character.Bounds.Value, h.Matrix));
            }
            if (_hitBounds == Rectangle.Empty)
                return;

            // Make Hit (using Color surface since Alpha8 is not supported everywhere)
            using (var surface = services.VectorDevice.CreateSurface(HitTestSize, HitTestSize, SurfaceFormat.Color))
            {
                var state = services.VectorDevice.CreateState();
                state.SetAntialiasing(VGAntialiasing.None);
                state.NonScalingStroke = true;
                state.FillRule = VGFillRule.EvenOdd;
                state.ColorTransformationEnabled = true;
                state.SetProjection(_hitBounds.Width, _hitBounds.Height);
                state.PathToSurface.Push(VGMatrix.Translate(-_hitBounds.Left, -_hitBounds.Top));

                using (var context = services.VectorDevice.BeginRendering(surface, state, new DisplayState(), true))
                {
                    foreach (var h in hit.OrderBy(c => c.Depth))
                    {
                        if (!(h.Character is Movie.IDrawable)) continue;
                        if (!h.Character.Bounds.HasValue) continue;

                        state.PathToSurface.PushCombineLeft(h.Matrix);
                        (h.Character as Movie.IDrawable).Draw(context);
                        state.PathToSurface.Pop();
                    }
                }

                Func<Color, byte> isCovered = (c) => (byte)((c.A != 0) ? 1 : 0);
                Color[] data = new Color[surface.Width * surface.Height];
                surface.Target.GetData(data);
                for (int y = 0; y < surface.Height; y++)
                {
                    for (int x = 0; x < surface.Width; )
                    {
                        var b = isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        b <<= 1;
                        b |= isCovered(data[x++]);
                        _hitTestBitmap[(x / 8) - 1, y] = b;
                    }
                }
            }
        }
Exemplo n.º 49
0
 /// <summary>
 /// 用户统计
 /// </summary>
 public UsersStatController()
 {
     _ISystemServices = new SystemServices();
 }
Exemplo n.º 50
0
 /// <summary>
 /// 模块管理员配置
 /// </summary>
 public ModularSysController()
 {
     _ISystemServices = new SystemServices();
 }
 public SuspendableWorkQueueImpl(ISystemServices systemServices)
 {
     _systemServices = systemServices;
 }