Beispiel #1
0
        public override void BuildState()
        {
            if (this.gameObject.GetComponent <IndexController>() == false)
            {
                this.gameObject.AddComponent <IndexController>().Start();
            }

            CreateCamera();
            CreateBackground();
            CreatePullOfCharacters();

            _controller = AFObject.Create <GameController>();
            _controller.gameObject.transform.parent = this.gameObject.transform;
            _controller.Initialize();
            _controller.SetAnchorTarget(_cameraGameObject);

            if (this.gameObject.GetComponent <HudController>() == false)
            {
                this.gameObject.AddComponent <HudController>();
            }
            this.gameObject.GetComponent <HudController>().SetAnchorTarget(_cameraGameObject);

            #if UNITY_EDITOR
            AFAssetManager.SimulatedDPI     = AFAssetManager.DPI_IPHONE_4_5;
            AFAssetManager.SimulatePlatform = AFAssetManager.EPlataform.IOS;
            #endif

            CreateParticles();
            base.BuildState();
        }
        public void CreateAttributeTest()
        {
            PIAttribute attribute = new PIAttribute()
            {
                Name                = "WaterEventFrame",
                Description         = "2008 Water Use",
                Type                = "Int32",
                TypeQualifier       = "",
                DataReferencePlugIn = "Table Lookup",
                ConfigString        = "SELECT [Water Use] FROM [Energy Use 2008] WHERE [Asset ID] = '%Element%'",
                IsConfigurationItem = false,
                IsHidden            = false,
                IsManualDataEntry   = false,
            };

            instance.CreateAttribute(webId, attribute);

            string       path         = Constants.AF_EVENT_FRAME_PATH;
            AFEventFrame myEventFrame = AFObject.FindObject(path) as AFEventFrame;

            myEventFrame.Refresh();

            if (myEventFrame != null)
            {
                Assert.IsNotNull(myEventFrame.Attributes[Constants.AF_ATTRIBUTE_NAME]);
            }
        }
Beispiel #3
0
        public void UpdateTest()
        {
            // TODO uncomment below to test the method and replace null with proper value
            //string webId = null;
            //PIAnalysisTemplate template = null;
            //var response = instance.Update(webId, template);
            //Assert.IsInstanceOf<Object> (response, "response is Object");

            string             path             = Constants.AF_ANALYSIS_TEMPLATE_PATH;
            PIAnalysisTemplate analysisTemplate = instance.Get(webId, null);

            analysisTemplate.WebId = null;
            analysisTemplate.Id    = null;
            analysisTemplate.Links = null;
            analysisTemplate.Path  = null;
            analysisTemplate.HasNotificationTemplate = null;
            analysisTemplate.HasTarget   = null;
            analysisTemplate.Description = "This is the new analysis template swagger description";
            instance.Update(webId, analysisTemplate);

            StandardPISystem.Refresh();
            AFAnalysisTemplate myAnalysisTemplate = AFObject.FindObject(path) as AFAnalysisTemplate;

            myAnalysisTemplate.Refresh();

            if (myAnalysisTemplate != null)
            {
                Assert.IsTrue(myAnalysisTemplate.Description == analysisTemplate.Description);
            }
        }
Beispiel #4
0
        public void UpdateTest()
        {
            string     path     = Constants.AF_TIMERULE_PATH;
            PITimeRule timeRule = instance.GetByPath(path, null);

            timeRule.Name               = null;
            timeRule.Description        = null;
            timeRule.ConfigStringStored = null;
            timeRule.EditorType         = null;
            timeRule.IsConfigured       = null;
            timeRule.IsInitializing     = null;
            timeRule.PlugInName         = null;
            timeRule.DisplayString      = null;
            timeRule.WebId              = null;
            timeRule.Id           = null;
            timeRule.Path         = null;
            timeRule.Links        = null;
            timeRule.ConfigString = "Frequency=400";
            instance.Update(webId, timeRule);
            StandardPISystem.Refresh();
            var newTimeRule = AFObject.FindObject(path) as AFTimeRule;

            if (newTimeRule != null)
            {
                Assert.IsTrue(timeRule.ConfigString == newTimeRule.ConfigString);
            }
        }
        public void UpdateTest()
        {
            string       path       = Constants.AF_EVENT_FRAME_PATH;
            PIEventFrame eventFrame = instance.GetByPath(path, null);

            eventFrame.Id                = null;
            eventFrame.Description       = "New swagger event frame description";
            eventFrame.Links             = null;
            eventFrame.Path              = null;
            eventFrame.WebId             = null;
            eventFrame.HasChildren       = null;
            eventFrame.AcknowledgedBy    = null;
            eventFrame.Security          = null;
            eventFrame.AcknowledgedDate  = null;
            eventFrame.IsAcknowledged    = null;
            eventFrame.IsAnnotated       = null;
            eventFrame.IsLocked          = null;
            eventFrame.CanBeAcknowledged = null;
            eventFrame.AreValuesCaptured = null;
            instance.Update(webId, eventFrame);

            StandardPISystem.Refresh();
            AFEventFrame myEventFrame = AFObject.FindObject(path) as AFEventFrame;

            myEventFrame.Refresh();
            myEventFrame.Database.Refresh();
            if (myEventFrame != null)
            {
                Assert.IsTrue(myEventFrame.Description == eventFrame.Description);
            }
        }
Beispiel #6
0
        public override void Initialize()
        {
            AFAssetManager.SetDirectoryOwner("QuebraCuca");

            m_stateManager = AFObject.Create <AFStateManager>();

            m_stateManager.Initialize(new GameStateFactory());

            _resolutionController = ResolutionController.Instance();
            _paths  = PathConstants.Instance();
            _sounds = SoundConstants.Instance();

            GameObject _soundManager = new GameObject();

            _soundManager.name = "SoundManager";
            _soundManager.AddComponent <SoundManager>().Init();
            //SoundManager.PlaySoundByName(SoundConstants.BG_SOUND);

            AFSingleTransition tras = AFObject.Create <AFSingleTransition>();
            SpriteRenderer     sr   = tras.gameObject.AddComponent <SpriteRenderer>();

            sr.transform.position   = new Vector3(0, 0, 6);
            sr.sprite               = AFAssetManager.Instance.CreateSpriteFromTexture("Common/High/loadingscreen");
            sr.transform.localScale = new Vector3(1, 1, 1);
            m_stateManager.AddTransition(tras);

            m_stateManager.GotoState(AState.EGameState.MENU);

            base.Initialize();
        }
        public void UpdateAnnotationTest()
        {
            var          result     = instance.GetAnnotations(webId, null);
            PIAnnotation annotation = result.Items.Where(m => m.Name == Constants.AF_EVENT_FRAME_ANNOTATION_NAME).FirstOrDefault();

            annotation.Value = "odosdsaaCSWCCSA";
            string id = annotation.Id.ToString();

            annotation.Id           = null;
            annotation.CreationDate = null;
            annotation.Creator      = null;
            annotation.Modifier     = null;
            annotation.ModifyDate   = null;
            annotation.Links        = null;
            instance.UpdateAnnotation(webId: webId, id: id, annotation: annotation);

            string       path       = Constants.AF_EVENT_FRAME_PATH;
            AFEventFrame eventFrame = AFObject.FindObject(path) as AFEventFrame;

            eventFrame.Refresh();
            IList <AFAnnotation> annotations = eventFrame.GetAnnotations();
            string afAnnValue = annotations.Where(m => m.Name == annotation.Name).First().Value.ToString();

            Assert.IsTrue(afAnnValue == annotation.Value.ToString());
        }
Beispiel #8
0
        public void ObserveAFCache()
        {
            AFElement element1 = AFObject.FindObject(elementPath) as AFElement;
            AFElement element2 = AFObject.FindObject(elementPath) as AFElement;

            Assert.Same(element1, element2);
        }
Beispiel #9
0
    public AFStatesController buildHeroAnimation()
    {
        AFStatesController m_heroStates;

        UnityEngine.Debug.Log(AFAssetManager.GetPathTargetPlatformWithResolution() + "/" + "hero_sprites");
        AFTextureAtlas heroAtlas = AFAssetManager.Instance.Load <AFTextureAtlas>(AFAssetManager.GetPathTargetPlatformWithResolution() + "/" + "hero_sprites");

        m_heroStates = AFObject.Create <AFStatesController>("Hero Controller");

        AFMovieClip animation = AFObject.Create <AFMovieClip>("small_walk");

        animation.Init(heroAtlas.GetSprites("small_walk"));
        animation.gameObject.AddComponent <BoxCollider2D>();
        m_heroStates.Add("small_walk", animation, false);

        animation = AFObject.Create <AFMovieClip>("small_stop");
        animation.Init(heroAtlas.GetSprites("small_stop"));
        animation.gameObject.AddComponent <BoxCollider2D>();
        m_heroStates.Add("small_stop", animation, true);

        m_heroStates.gameObject.AddComponent <Rigidbody2D>();

        m_heroStates.transform.localScale = new UnityEngine.Vector3(3, 3, 3);

        return(m_heroStates);
    }
Beispiel #10
0
        internal static void OnChanged(object sender, AFChangedEventArgs e)
        {
            //Console.WriteLine(sender);
            //Console.WriteLine(e);

            // Find changes made while application not running.
            List <AFChangeInfo> list = new List <AFChangeInfo>();

            list.AddRange(myPISystem.FindChangedItems(true, int.MaxValue, sysCookie, out sysCookie));
            list.AddRange(monitoredDB.FindChangedItems(true, int.MaxValue, dbCookie, out dbCookie));

            // Refresh objects that have been changed.
            AFChangeInfo.Refresh(myPISystem, list);
            foreach (AFChangeInfo info in list)
            {
                AFChangeInfoAction ac    = info.Action;
                AFObject           myObj = info.FindObject(myPISystem, true);
                AFIdentity         myID  = myObj.Identity;
                if (myID == AFIdentity.EventFrame && ac == AFChangeInfoAction.Added)
                {
                    AFEventFrame myEFinfo = (AFEventFrame)info.FindObject(myPISystem, true);
                    AFNamedCollectionList <AFEventFrame> myEFList = AFEventFrame.FindEventFrames(monitoredDB, null, new AFTime("*"), 0, 5, AFEventFrameSearchMode.BackwardFromEndTime, "", "", null, myEFinfo.Template, true);
                    foreach (AFEventFrame EF in myEFList)
                    {
                        Console.WriteLine(EF.Name);
                    }
                }
            }
        }
Beispiel #11
0
        public void Initialize()
        {
            _characterAnimations = AFObject.Create <AFStatesController>();

            string     path      = PathConstants.GetGameScenePath() + "cucaSprites";
            AMovieClip animation = AnimationFactory.Instance.BuildAnimation(path, STATE_HITED);

            _characterAnimations.Add(STATE_HITED, animation, false);

            animation = AnimationFactory.Instance.BuildAnimation(path, STATE_ANGRY);
            _characterAnimations.Add(STATE_ANGRY, animation, false);

            animation = AnimationFactory.Instance.BuildAnimation(path, STATE_IDLE);
            _characterAnimations.Add(STATE_IDLE, animation, true);


            _characterAnimations.gameObject.transform.parent = this.gameObject.transform;
            _sprite = _characterAnimations.GetCurrentState().GetSprite();
            this.gameObject.AddComponent <BoxColliderResizer>().Initialize();

            if (this.gameObject.GetComponent <AnimationController>())
            {
                this.gameObject.GetComponent <AnimationController>().Initialize();
            }
        }
Beispiel #12
0
        public void RemoveReferencedElementTest()
        {
            AddReferencedElementTest();
            string     path = Constants.AF_DATABASE_PATH;
            AFDatabase db   = AFObject.FindObject(path) as AFDatabase;

            db.Refresh();
            if (db != null)
            {
                Assert.IsNotNull(db.Elements[Constants.AF_ELEMENT_NAME + "Child1"]);
                Assert.IsNotNull(db.Elements[Constants.AF_ELEMENT_NAME + "Child2"]);
            }

            string        path1  = Constants.AF_ELEMENT_PATH + @"\" + Constants.AF_ELEMENT_NAME + "Child1";
            string        path2  = Constants.AF_ELEMENT_PATH + @"\" + Constants.AF_ELEMENT_NAME + "Child2";
            string        webId1 = client.Element.GetByPath(path1).WebId;
            string        webId2 = client.Element.GetByPath(path2).WebId;
            List <string> referencedElementWebId = new List <string>()
            {
                webId1, webId2
            };

            instance.RemoveReferencedElement(webId, referencedElementWebId);


            db.Refresh();
            if (db != null)
            {
                Assert.IsNull(db.Elements[Constants.AF_ELEMENT_NAME + "Child1"]);
                Assert.IsNull(db.Elements[Constants.AF_ELEMENT_NAME + "Child2"]);
            }
        }
Beispiel #13
0
        public void CreateAnalysisTest()
        {
            string     path     = Constants.AF_ELEMENT_PATH;
            PIAnalysis analysis = new PIAnalysis()
            {
                Name                   = "MyNewAnalysis",
                Description            = "",
                AnalysisRulePlugInName = "PerformanceEquation",
                GroupId                = 0,
                MaximumQueueSize       = 0,
                OutputTime             = "",
                Priority               = "High",
                PublishResults         = false,
                Status                 = "Disabled",
                TemplateName           = "",
                TimeRulePlugInName     = "Periodic"
            };

            instance.CreateAnalysis(webId, analysis);

            AFElement myElement = AFObject.FindObject(path) as AFElement;

            myElement.Refresh();

            if (myElement != null)
            {
                Assert.IsNotNull(myElement.Analyses[analysis.Name]);
            }
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            PISystems myPISystems = new PISystems();
            PISystem  myPISystem = myPISystems[EventFrameTest.Properties.Settings.Default.AFSystemName];
            object    sysCookie, dbCookie;

            AFDatabases myDBs = myPISystem.Databases;
            AFDatabase  myDB  = myDBs[EventFrameTest.Properties.Settings.Default.AFDBName];

            myPISystem.FindChangedItems(false, int.MaxValue, null, out sysCookie);
            myDB.FindChangedItems(false, int.MaxValue, null, out dbCookie);

            // Find changes made while application not running.
            List <AFChangeInfo> list = new List <AFChangeInfo>();

            list.AddRange(myPISystem.FindChangedItems(false, int.MaxValue, sysCookie, out sysCookie));
            list.AddRange(myDB.FindChangedItems(false, int.MaxValue, dbCookie, out dbCookie));

            // Refresh objects that have been changed.
            AFChangeInfo.Refresh(myPISystem, list);
            foreach (AFChangeInfo info in list)
            {
                AFChangeInfoAction ac    = info.Action;
                AFObject           myObj = info.FindObject(myPISystem, true);
                AFIdentity         myID  = myObj.Identity;
                if (myID == AFIdentity.EventFrame && ac == AFChangeInfoAction.Added)
                {
                    Console.WriteLine("Found changed object: {0}", myObj);
                }
            }
            Console.ReadLine();
        }
        public void CreateAttributeTemplateTest()
        {
            string path = Constants.AF_ATTRIBUTE_TEMPLATE_PATH;
            PIAttributeTemplate template = new PIAttributeTemplate()
            {
                Name                = "Water(2008)",
                Description         = "2008 Water Use",
                Type                = "Int32",
                TypeQualifier       = "",
                DefaultValue        = 0,
                DataReferencePlugIn = "Table Lookup",
                ConfigString        = "SELECT [Water Use] FROM [Energy Use 2008] WHERE [Asset ID] = '%Element%'",
                IsConfigurationItem = false,
                IsExcluded          = false,
                IsHidden            = false,
                IsManualDataEntry   = false,
                TraitName           = "LimitLoLo"
            };

            instance.CreateAttributeTemplate(webId, template);
            AFAttributeTemplate myAttributeTemplate = AFObject.FindObject(path) as AFAttributeTemplate;

            myAttributeTemplate.ElementTemplate.Refresh();
            Assert.IsTrue(myAttributeTemplate.AttributeTemplates.Count == 4);
        }
Beispiel #16
0
        public T Load <T>(string name, string path) where T : UnityEngine.Object
        {
            T res = null;

            try
            {
                res = GetAsset <T>(name);

                if (AFObject.IsNull(res))
                {
                    if (typeof(T) == typeof(AFTextureAtlas))
                    {
                        res = Add(name, new AFTextureAtlas(name, path, AFTextureAtlas.EFileType.kTextTypes_Csv)) as T;
                    }
                    else
                    {
                        res = Resources.Load <T>(path);

                        if (typeof(T) == typeof(Texture))
                        {
                            Add(name, res as Texture);
                        }

                        else if (typeof(T) == typeof(GameObject))
                        {
                            Add(name, res as GameObject);
                        }

                        else if (typeof(T) == typeof(AFSound))
                        {
                            Add(name, res as AFSound);
                        }

                        else if (typeof(T) == typeof(Texture))
                        {
                            Add(name, res as Texture);
                        }
                        else
                        {
                            Add(name, res);
                        }

                        Resources.UnloadUnusedAssets();
                    }

                    UnityEngine.Debug.Log("I'll store an object of: " + typeof(T).ToString());
                }
            }
            catch (NullReferenceException nullEx)
            {
                UnityEngine.Debug.LogError("The asset was not found: " + nullEx.Message);
            }
            catch (Exception ex)
            {
                //TODO: Discover what happens when unity throw this error
                UnityEngine.Debug.LogError("The asset was not found: " + ex.Message);
            }

            return(res);
        }
        public void UpdateTest()
        {
            string         path            = Constants.AF_ANALYSIS_RULE_PATH;
            AFAnalysisRule myAnalysisRule  = AFObject.FindObject(path) as AFAnalysisRule;
            string         oldConfigString = myAnalysisRule.ConfigString;



            PIAnalysisRule analysisRule = instance.GetByPath(path, null);

            analysisRule.Name               = null;
            analysisRule.Description        = null;
            analysisRule.DisplayString      = null;
            analysisRule.EditorType         = null;
            analysisRule.HasChildren        = null;
            analysisRule.PlugInName         = null;
            analysisRule.SupportedBehaviors = null;
            analysisRule.Path               = null;
            analysisRule.IsConfigured       = null;
            analysisRule.IsInitializing     = null;
            analysisRule.WebId              = null;
            analysisRule.Links              = null;
            analysisRule.Id           = null;
            analysisRule.ConfigString = "Avg2d := TagAvg('Temperature','*-4d','*');\r\nAvg1d := TagAvg('Temperature','*-3d','*');\r\nSumAvg := Avg1d+Avg2d+2;";
            instance.Update(webId, analysisRule);


            //StandardPISystem.Databases[Constants.AF_DATABASE_NAME].Refresh();

            myAnalysisRule.RefreshConfigurationAndVariableMapping();
            Assert.IsFalse(oldConfigString == analysisRule.ConfigString);
        }
Beispiel #18
0
        public void UpdateTest()
        {
            string     path     = Constants.AF_ANALYSIS_PATH;
            PIAnalysis analysis = instance.Get(webId, null);

            analysis.WebId                       = null;
            analysis.Id                          = null;
            analysis.Links                       = null;
            analysis.Path                        = null;
            analysis.AutoCreated                 = null;
            analysis.HasTemplate                 = null;
            analysis.HasNotification             = null;
            analysis.HasTarget                   = null;
            analysis.IsConfigured                = null;
            analysis.Description                 = "This is the new analysis swagger description";
            analysis.IsTimeRuleDefinedByTemplate = null;
            instance.Update(webId, analysis);

            StandardPISystem.Refresh();
            AFAnalysis myAnalysis = AFObject.FindObject(path) as AFAnalysis;

            if (analysis != null)
            {
                Assert.IsTrue(myAnalysis.Description == analysis.Description);
            }
        }
Beispiel #19
0
        public void UpdateDataTest()
        {
            string      path = Constants.AF_TABLE_PATH;
            PITableData data = new PITableData();

            data.Columns = new Dictionary <string, string>();
            data.Columns.Add("Model", "String");
            data.Columns.Add("4WD", "Boolean");
            data.Columns.Add("TopSpeed", "Int32");
            data.Rows = new List <Dictionary <string, object> >();
            var item1 = new Dictionary <string, object>();

            item1.Add("Model", "Jeep");
            item1.Add("4WD", true);
            item1.Add("TopSpeed", 100);
            var item2 = new Dictionary <string, object>();

            item2.Add("Model", "Prius");
            item2.Add("4WD", false);
            item2.Add("TopSpeed", 80);
            data.Rows.Add(item1);
            data.Rows.Add(item2);
            instance.UpdateData(webId, data);

            StandardPISystem.Refresh();
            AFTable myTable = AFObject.FindObject(path) as AFTable;

            myTable.Refresh();

            Assert.IsTrue(myTable.Table.Rows.Count == 2);
            Assert.IsTrue(myTable.Table.Columns.Count == 3);
        }
        public void CaptureValuesTest()
        {
            instance.CaptureValues(webId);
            string       path         = Constants.AF_EVENT_FRAME_PATH;
            AFEventFrame myEventFrame = AFObject.FindObject(path) as AFEventFrame;

            myEventFrame.Refresh();
            Assert.IsTrue(myEventFrame.AreValuesCaptured == true);
        }
        public void DeleteTest()
        {
            instance.Delete(webId);
            StandardPISystem.Refresh();
            string         path           = Constants.AF_ANALYSIS_RULE_PATH;
            AFAnalysisRule myAnalysisRule = AFObject.FindObject(path) as AFAnalysisRule;

            Assert.IsNull(myAnalysisRule);
        }
        public void AcknowledgeTest()
        {
            instance.Acknowledge(webId);
            string       path         = Constants.AF_EVENT_FRAME_PATH;
            AFEventFrame myEventFrame = AFObject.FindObject(path) as AFEventFrame;

            myEventFrame.Refresh();
            Assert.IsTrue(myEventFrame.IsAcknowledged == true);
        }
Beispiel #23
0
        public AFMovieClip BuildAnimation(string spritePath, string animationStateName)
        {
            AFMovieClip    L_animation;
            AFTextureAtlas L_heroAtlas = AFAssetManager.Instance.Load <AFTextureAtlas>(spritePath);

            L_animation = AFObject.Create <AFMovieClip>(animationStateName);
            L_animation.Init(L_heroAtlas.GetSprites(animationStateName));
            return(L_animation);
        }
Beispiel #24
0
        static void Main(string[] args)
        {
            if (args.Length < 4)
            {
                Console.WriteLine("Usage: RunAnalysis.exe <elementPath> <analysisName> <startTime> <endTime>");
                Console.WriteLine("(e.g. RunAnalysis.exe" + @"\\afservername\dbname\elementName analysisName 'y' 't')");
                return;
            }

            var elementPath  = args[0];
            var analysisName = args[1];
            var st           = args[2];
            var et           = args[3];

            var element = AFObject.FindObject(elementPath) as AFElement;

            if (element == null)
            {
                Console.WriteLine("Failed to find element '{0}'", elementPath);
                return;
            }

            var analysis = element.Analyses[analysisName];

            if (analysis == null)
            {
                Console.WriteLine("Failed to find analysis '{0}|{1}'", elementPath, analysisName);
                return;
            }

            AFTime startTime;

            if (!AFTime.TryParse(st, out startTime))
            {
                Console.WriteLine("Invalid start time '{0}';", st);
                return;
            }

            AFTime endTime;

            if (!AFTime.TryParse(et, out endTime))
            {
                Console.WriteLine("Invalid end time '{0}';", et);
                return;
            }

            Console.WriteLine("Evaluating {0}|{1} from {2} to {3}...", elementPath, analysisName, startTime, endTime);
            var executor = new AnalysisExecutor(analysis);

            executor.Run(new AFTimeRange(startTime, endTime));

            if (Debugger.IsAttached)
            {
                Console.Read();
            }
        }
Beispiel #25
0
        public void DeleteTest()
        {
            instance.Delete(webId);
            StandardPISystem.Refresh();
            AFDatabase db = AFObject.FindObject(Constants.AF_DATABASE_NAME) as AFDatabase;

            Assert.IsNull(db);
            DeleteSampleDatabaseForTests();
            CreateSampleDatabaseForTests();
        }
Beispiel #26
0
        public static T Resolve <T>(string absolutePath) where T : AFObject
        {
            T afObject = AFObject.FindObject(absolutePath) as T;

            if (afObject == null)
            {
                throw new ArgumentException("Could not resolve the specified " + typeof(T).Name);
            }
            return(afObject);
        }
Beispiel #27
0
        public void DeleteTest()
        {
            // TODO uncomment below to test the method and replace null with proper value
            instance.Delete(webId);
            AFAnalysis analysis = AFObject.FindObject(Constants.AF_ANALYSIS_PATH) as AFAnalysis;

            Assert.IsNull(analysis);
            DeleteSampleDatabaseForTests();
            CreateSampleDatabaseForTests();
        }
Beispiel #28
0
        public static T Find <T>(this PISystems systems, string path)
            where T : AFObject
        {
            if (systems.DefaultPISystem == null)
            {
                throw new InvalidOperationException("Default PISystem must be set.");
            }

            return(AFObject.FindObject(path, systems.DefaultPISystem) as T);
        }
Beispiel #29
0
        public void DeleteTest()
        {
            string path = Constants.AF_TIMERULE_PATH;

            instance.Delete(webId);
            StandardPISystem.Refresh();
            var newTimeRule = AFObject.FindObject(path) as AFTimeRule;

            Assert.IsNull(newTimeRule);
        }
Beispiel #30
0
        public void Init()
        {
            PIWebApiClient client = PIWebApiClientGenerator.GenerateInstance();

            instance             = client.Configuration;
            configElement        = AFObject.FindObject(Constants.PIWEBAPI_CONFIGURATION_ELEMENT_PATH) as AFElement;
            corsExpHeaders       = configElement.Attributes[Constants.PIWEBAPI_CONFIGURATION_CORSEXPHEADERS].GetValue().Value.ToString();
            corsMethods          = configElement.Attributes[Constants.PIWEBAPI_CONFIGURATION_CORSMETHODS].GetValue().Value.ToString();
            scanSearchInterval   = configElement.Attributes[Constants.PIWEBAPI_CONFIGURATION_CORSEACHSCANINTERVALS].GetValue().ValueAsInt32();
            corsMethodsAttribute = configElement.Attributes[Constants.PIWEBAPI_CONFIGURATION_CORSMETHODS];
        }