private SmartObjectDefinition CreateSmartObject(string smoName)
        {
            try
            {
                // Delete the smartobject if it already exists
                this.DeleteSmartObject(smoName);

                toolStripStatusLabel1.Text = ("Creating SmartObject properties for '" + smoName + "'");
                statusStrip1.Update();
                ManagementServerConnect();

                // Get SmartBox service instance
                ServiceInstance serviceInstance = ServiceInstance.Create(_smoManagementServer.GetServiceInstanceForExtend(new Guid(_smartboxGuid), string.Empty));
                ExtendObject    extendObject    = serviceInstance.GetCreateExtender();

                extendObject.Name = smoName;
                extendObject.Metadata.DisplayName = smoName;

                // Create 'id' property
                ExtendObjectProperty idProperty = new ExtendObjectProperty();
                idProperty.Name = "ID";
                idProperty.Metadata.DisplayName = idProperty.Name;
                idProperty.Type       = PropertyDefinitionType.Autonumber;
                idProperty.ExtendType = ExtendPropertyType.UniqueIdAuto;

                // Create 'name' property
                ExtendObjectProperty nameProperty = new ExtendObjectProperty();
                nameProperty.Name = "Name";
                nameProperty.Metadata.DisplayName = nameProperty.Name;
                nameProperty.Type = PropertyDefinitionType.Text;

                // Create other properties here as needed
                // Add the new properties below

                // Add properties
                extendObject.Properties.Add(idProperty);
                extendObject.Properties.Add(nameProperty);

                SmartObjectDefinition smoDefinition = new SmartObjectDefinition();

                // Create SmartObject Definition
                smoDefinition.Create(extendObject);
                smoDefinition.AddDeploymentCategory("Test SmartObjects");

                smoDefinition.Build();

                return(smoDefinition);
            }

            catch (Exception ex)
            {
                throw ex;
            }

            finally
            {
                ManagementServerCloseConnection();
            }
        }
Exemple #2
0
        public override void OnDoCreate(ExtendObject item, params object[] args)
        {
            base.OnDoCreate(item, args);
            ServiceManager.AddService <IWindowManager>(new WindowManager());


            OnSelectedItemCommand     = RegisterCommand(OnSelectedItem);
            OnOpenViewsCheckedCommand = RegisterCommand(OnOpenViewsChecked);
            OnHeroSelectedCommand     = RegisterCommand(OnHeroSelected);
            OnAlbumSelectedCommand    = RegisterCommand(OnAlbumSelected);
            OnApplyTPCommand          = RegisterCommand(OnApplyTP);

            popupView            = CreateView <SelectVideoPlayerDialogViewModel>(true);
            DownLoadManagerView  = CreateView <DownloadManagerViewModel>(true);
            ModifySkinDialogView = CreateView <ModifySkinDialogViewModel>(true);

            DownloadManager.Info = DownLoadManagerView.Model;
            //CurrentAlbumProperty.ValueChanged += CurrentAlbumProperty_ValueChanged;

            AlbumList = new ObservableCollection <Album> {
                new Wow178Album("http://wow.178.com/list/pvpshipin/index.html")
                {
                    Name = "pvp视频区"
                },
                new Wow178Album("http://wow.178.com/list/quweishipin/index.html")
                {
                    Name = "娱乐视频区"
                },
                new Wow178Album("http://wow.178.com/list/ctmsp/index.html")
                {
                    Name = "大灾变视频区"
                },
                new Wow178Album("http://wow.178.com/list/49616960521.html")
                {
                    Name = "我叫MT系列"
                },
                new Wow178Album("http://wow.178.com/list/lk/index.html")
                {
                    Name = "巫妖王视频区"
                },
                new Wow178Album("http://wow.178.com/list/rs/index.html")
                {
                    Name = "晶红圣殿视频"
                },
                new Wow178Album("http://wow.178.com/list/ghxc/index.html")
                {
                    Name = "公会宣传视频"
                },
                new Wow178Album("http://wow.178.com/list/cg/index.html")
                {
                    Name = "官方视频"
                },
                new Wow178Album("http://wow.178.com/list/fanchang/index.html")
                {
                    Name = "玩家翻唱区"
                },
            };
        }
        // GET: api/Servers
        //public IEnumerable<Server> Get()
        //{
        //    var servers = unitOfWork.Servers.GetAll().ToArray();
        //    return Mapper.Map<Test.Models.Entities.Server[], Server[]>(servers);
        //}

        // GET: api/Servers/5
        public async Task <Server> Get(int id)
        {
            var server = unitOfWork.Servers.Get(id);

            var serverDto = Mapper.Map <Test.Models.Entities.Server, Server>(server);

            string html = await HttpRequestHelper.GetServerPage(serverDto.EndPointURL);

            ServerDetails details = serverDto.Details;

            ExtendObject <ServerDetails> .ExtendFromHtmlBody(ref details, html);

            return(serverDto);
        }
Exemple #4
0
        public override void OnDoCreate(ExtendObject item, params object[] args)
        {
            base.OnDoCreate(item, args);
            ServiceManager.AddService <IWindowManager>(new WindowManager());


            OnSelectedItemCommand     = RegisterCommand(OnSelectedItem);
            OnOpenViewsCheckedCommand = RegisterCommand(OnOpenViewsChecked);
            OnHeroSelectedCommand     = RegisterCommand(OnHeroSelected);
            OnAlbumSelectedCommand    = RegisterCommand(OnAlbumSelected);
            OnApplyTPCommand          = RegisterCommand(OnApplyTP);

            popupView            = CreateView <SelectVideoPlayerDialogViewModel>(true);
            DownLoadManagerView  = CreateView <DownloadManagerViewModel>(true);
            ModifySkinDialogView = CreateView <ModifySkinDialogViewModel>(true);

            DownloadManager.Info = DownLoadManagerView.Model;
            //CurrentAlbumProperty.ValueChanged += CurrentAlbumProperty_ValueChanged;

            AlbumList = new ObservableCollection <Album> {
                new LOL178Album("http://lol.178.com/list/video.html")
                {
                    Name = "精彩视频专辑"
                },
                new LOL178Album("http://lol.178.com/list/guofuvideo/index.html")
                {
                    Name = "解说视频专辑"
                },
                new LOL178Album("http://lol.178.com/list/bisaishipin/index.html")
                {
                    Name = "赛事专辑"
                },
                new LOL178Album("http://lol.178.com/list/116743038027.html")
                {
                    Name = "国服高手解说"
                },
                new LOL178Album("http://lol.178.com/list/ob.html")
                {
                    Name = "高端OB局解说"
                },
                new LOL178Album("http://lol.178.com/list/146255006330.html")
                {
                    Name = "7M教学大全专辑"
                },
                new LOL178Album("http://lol.178.com/list/jy/index.html")
                {
                    Name = "JY解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/120419608247.html")
                {
                    Name = "JD解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/124596016347.html")
                {
                    Name = "天天解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/119657498491.html")
                {
                    Name = "SMZ24解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/116477983166.html")
                {
                    Name = "戴尔解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/127966158778.html")
                {
                    Name = "JoKer解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/xiaocang/index.html")
                {
                    Name = "小苍解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/142589587871.html")
                {
                    Name = "小智解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/xiaomo/index.html")
                {
                    Name = "小漠解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/124596016347.html")
                {
                    Name = "天天解说专辑"
                },
                new LOL178Album("http://lol.178.com/list/116743035365.html")
                {
                    Name = "WE专辑"
                },
                new LOL178Album("http://lol.178.com/list/133669237409.html")
                {
                    Name = "CLG.EU专辑"
                },
                new LOL178Album("http://lol.178.com/list/120167121601.html")
                {
                    Name = "M5专辑"
                },
                new LOL178Album("http://lol.178.com/list/117082659809.html")
                {
                    Name = "IG专辑"
                },
                new LOL178Album("http://lol.178.com/list/dayeshipin/index.html")
                {
                    Name = "打野专辑"
                },
                new LOL178Album("http://lol.178.com/list/recommend.html")
                {
                    Name = "娱乐专辑"
                }
            };
        }
 public override void OnDoCreate(ExtendObject item, params object[] args)
 {
     base.OnDoCreate(item, args);
     PageIndexProperty.ValueChanged   += OnPageIndexChanged;
     PlayerIndexProperty.ValueChanged += PlayerIndexProperty_ValueChanged;
 }
Exemple #6
0
        public override void OnDoCreate(ExtendObject item, params object[] args)
        {
            base.OnDoCreate(item, args);

            SelectedIndexProperty.ValueChanged += SelectedIndexProperty_ValueChanged;
        }
 public override void OnDoCreate(ExtendObject item, params object[] args)
 {
     base.OnDoCreate(item, args);
     OnHeroSelectedCommand = RegisterCommand(OnHeroSelected);
 }