Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (securityCenterProperties_ != null)
            {
                hash ^= SecurityCenterProperties.GetHashCode();
            }
            hash ^= ResourceProperties.GetHashCode();
            if (securityMarks_ != null)
            {
                hash ^= SecurityMarks.GetHashCode();
            }
            if (createTime_ != null)
            {
                hash ^= CreateTime.GetHashCode();
            }
            if (updateTime_ != null)
            {
                hash ^= UpdateTime.GetHashCode();
            }
            if (iamPolicy_ != null)
            {
                hash ^= IamPolicy.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
 public void Fill(ResourceProperties resProperties)
 {
     Type.text   = Type.text + resProperties.Type;
     ID.text     = ID.text + resProperties.ID;
     Value.text  = Value.text + resProperties.Value.Value;
     Color.color = resProperties.Color;
     Color.text  = Color.text + resProperties.Color.ToString("F2");
 }
        /*__________________________________________________________________________________________*/
        public CashlinxPawnSupportSession()
        {
            var confRef = SecurityAccessor.Instance.EncryptConfig;

            this.userState = UserDesktopState.NOTLOGGEDIN;
            this.UserName  = string.Empty;
            this.IsoLevel  = IsolationLevel.ReadCommitted;
            ButtonResourceManagerHelper = new ButtonResourceManagerHelper();
            ResourceProperties          = new ResourceProperties();

            this.MenuEnabled    = true;
            this.skipLDAP       = false;
            this.timer          = null;
            this.HistorySession = null;
            ApplicationExit     = false;
            if (confRef == null)
            {
                return;
            }

            this.customers = new List <CustomerVO>(1)
            {
                new CustomerVO()
            };
            this.PawnLoans = new List <PawnLoan>(1)
            {
                new PawnLoan()
            };
            this.PawnLoanKeys          = new List <PawnLoan>(1);
            this.PawnLoanKeysAuxillary = new List <PawnLoan>(1);
            this.PawnLoans_Auxillary   = new List <PawnLoan>();

            this.PDLoanKeys = new List <PDLoan>(1)
            {
                new PDLoan()
            };
            //Init the items requiring encrypted configuration and use default audit log handlers, disabling audit logging for now
            GlobalDataAccessor.Instance.Init(this, confRef, "SupportApp",
                                             auditLogEnabledChangeHandlerBase, auditLogMessageHandlerBase, false);

            //Create main flow executor
            this.mainFlowExecutor = new MainFlowExecutor();

            //Create the application controller
            this.AppController = new AppWorkflowController(this, this.mainFlowExecutor);

            // get the list of available buttons for support app
            string errorCode;
            string errorText;

            List <string> buttonTagNames;
            var           retVal = getButtonNames(GlobalDataAccessor.Instance.OracleDA,
                                                  out buttonTagNames, out errorCode, out errorText);

            CurrentSiteId.AvailableButtons = buttonTagNames;
        }
Exemplo n.º 4
0
 //@Override
 public Resource createResource(ResourceProperties properties)
 {
     foreach (ResourceFactory factory in factories)
     {
         if (factory.accepts(properties))
         {
             return(factory.create(properties));
         }
     }
     throw new NUnsupportedResourcePropertiesException();
 }
Exemplo n.º 5
0
        public bool InitializeSecurityData(ResourceProperties resourceProperties, string clientKey, string storeNumber, PawnSecVO pSecVo,
                                           out string machineName, out string ipAddress, out string macAddress)
        {
            machineName = string.Empty;
            ipAddress   = string.Empty;
            macAddress  = string.Empty;
            if (this.encryptedConfig != null)
            {
                return(true);
            }
            this.pawnSecLogger.logMessage(LogLevel.DEBUG, this, "InitializeSecurityData()...");
            if (this.dataAccessor == null || this.state == PawnSecState.DISCONNECTED)
            {
                this.pawnSecLogger.logMessage(LogLevel.ERROR, this, "- Data Accessor is invalid or disconnected");
                return(false);
            }

            //Retrieve the machine name
            machineName = System.Environment.MachineName;
            if (this.pawnSecLogger.IsLogDebug)
            {
                this.pawnSecLogger.logMessage(
                    LogLevel.DEBUG, "- Machine Name From Environment: {0}", machineName);
            }
            machineName = string.Concat(machineName, MACHINE_SERVER);
            this.pawnSecLogger.logMessage(LogLevel.INFO, this, "- Machine Name = {0}", machineName);

            try
            {
                //Create the host information object
                this.hostInfo = new HostInformation(this.pawnSecLogger);

                //Retrieve the Ip address
                ipAddress = hostInfo.IPAddress;
                this.pawnSecLogger.logMessage(LogLevel.DEBUG, this, "- IP Address  = {0}", ipAddress);

                //Retrieve the MAC address
                macAddress = hostInfo.MACAddress;
                this.pawnSecLogger.logMessage(LogLevel.DEBUG, this, "- MAC Address = {0}", macAddress);
            }
            catch (Exception eX)
            {
                ipAddress  = null;
                macAddress = null;
                this.pawnSecLogger.logMessage(LogLevel.WARN, this, "- Could not retrieve MAC address or IP address - default to machine name: {0}", machineName);
                return(false);
            }

            this.encryptedConfig = new EncryptedConfigContainer(resourceProperties.PrivateKey,
                                                                clientKey, storeNumber, pSecVo);
            return(true);
        }
        public JewelryDisplay(ResourceProperties resourceProperties)
        {
            JEWELRY = new Dictionary<string, Bitmap>()
        {
            {"Pearl Necklace", resourceProperties.Pearl},
            {"Herring Bone Necklace", resourceProperties.HB},
            {"Heart Diamond Pendant", resourceProperties.HP},
            {"Diamond Pendant", resourceProperties.DP}
        };

            InitializeComponent();
            this.Hide();
        }
Exemplo n.º 7
0
        public PawnSecSetupForm(
            DataAccessTools dA,
            SecurityAccessor pSecAccess,
            StoreSetupVO sConfig,
            PawnSecVO pSecVo,
            EncryptedConfigContainer pEnc,
            string clientKey,
            string storeNum,
            bool initCreate)
        {
            InitializeComponent();
            this.logLevel      = LogLevel.DEBUG;
            this.storeNumber   = storeNum;
            GlobalChangesMade  = false;
            StoreChangesMade   = false;
            MachineChangesMade = false;
            initialCreation    = initCreate;
            this.storeData     = sConfig;
            pawnSecAccessor    = pSecAccess;
            pawnSecVo          = pSecVo;
            //CreatingWorkstation = false;
            this.dAPawnSec = dA;

            ResourceProperties resourceProperties = new ResourceProperties();

            resourceProperties.PrivateKey = clientKey;

            if (initCreate)
            {
                if (!pawnSecAccessor.InitializeSecurityData(resourceProperties, clientKey, storeNum, pSecVo,
                                                            out this.machineName,
                                                            out this.ipAddress,
                                                            out this.macAddress))
                {
                    throw new ApplicationException(
                              "Cannot initialize encryption portion of PAWNSEC™.");
                }
                this.pSec = pawnSecAccessor.EncryptConfig;
            }
            else
            {
                this.pSec = pEnc;
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Returns the log analytics workspace ID.
        /// </summary>
        /// <param name="resourceIdentifier">
        /// The log analytics resource identifier.
        /// The value of the <see cref="ResourceType"/> property must be equal to <see cref="ResourceType.LogAnalytics"/>
        /// </param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>A <see cref="Task{TResult}"/>, returning the workspace ID.</returns>
        public async Task <string> GetLogAnalyticsWorkspaceIdAsync(ResourceIdentifier resourceIdentifier, CancellationToken cancellationToken)
        {
            if (resourceIdentifier.ResourceType != ResourceType.LogAnalytics)
            {
                throw new ArgumentOutOfRangeException(nameof(resourceIdentifier), resourceIdentifier.ResourceType, $"The resource type must be {ResourceType.LogAnalytics}");
            }

            // Extract the workspace ID from the resource properties
            ResourceProperties properties = await this.GetResourcePropertiesAsync(resourceIdentifier, cancellationToken);

            string workspaceId = properties.Properties["customerId"].ToObject <string>();

            if (workspaceId == null)
            {
                throw new ArgumentException($"No workspace ID found for resource {resourceIdentifier.ResourceName}");
            }

            return(workspaceId);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Returns the Application Insights app ID.
        /// </summary>
        /// <param name="resourceIdentifier">
        /// The Application Insights resource identifier.
        /// The value of the <see cref="ResourceType"/> property must be equal to <see cref="ResourceType.ApplicationInsights"/>
        /// </param>
        /// <param name="cancellationToken">The cancellation token.</param>
        /// <returns>A <see cref="Task{TResult}"/>, returning the app ID.</returns>
        public async Task <string> GetApplicationInsightsAppIdAsync(ResourceIdentifier resourceIdentifier, CancellationToken cancellationToken)
        {
            if (resourceIdentifier.ResourceType != ResourceType.ApplicationInsights)
            {
                throw new ArgumentOutOfRangeException(nameof(resourceIdentifier), resourceIdentifier.ResourceType, $"The resource type must be {ResourceType.ApplicationInsights}");
            }

            // Extract the AppId from the resource properties
            ResourceProperties properties = await this.GetResourcePropertiesAsync(resourceIdentifier, cancellationToken);

            string applicationId = properties.Properties["AppId"].ToObject <string>();

            if (applicationId == null)
            {
                throw new ArgumentException($"No application ID found for resource {resourceIdentifier.ResourceName}");
            }

            return(applicationId);
        }
Exemplo n.º 10
0
 public bool Equals(Asset other)
 {
     if (ReferenceEquals(other, null))
     {
         return(false);
     }
     if (ReferenceEquals(other, this))
     {
         return(true);
     }
     if (Name != other.Name)
     {
         return(false);
     }
     if (!object.Equals(SecurityCenterProperties, other.SecurityCenterProperties))
     {
         return(false);
     }
     if (!ResourceProperties.Equals(other.ResourceProperties))
     {
         return(false);
     }
     if (!object.Equals(SecurityMarks, other.SecurityMarks))
     {
         return(false);
     }
     if (!object.Equals(CreateTime, other.CreateTime))
     {
         return(false);
     }
     if (!object.Equals(UpdateTime, other.UpdateTime))
     {
         return(false);
     }
     if (!object.Equals(IamPolicy, other.IamPolicy))
     {
         return(false);
     }
     return(Equals(_unknownFields, other._unknownFields));
 }
Exemplo n.º 11
0
    /// <summary>
    /// Gather targeted resource each X seconds, according to unit actionSpeed property.
    /// </summary>
    private void gather()
    {
        if (hasNewAssociatedResource)
        {
            //When unit has a new ressource, get all associated variableds
            prop                     = associatedResource.GetComponent <ResourceProperties> ();
            nextActionTime           = Time.time + unitProperties.actionSpeed;
            hasNewAssociatedResource = false;
        }
        //When resource exists, gather it each time
        if (associatedResource != null)
        {
            if (Time.time >= nextActionTime)
            {
                prop.alreadyGathered += gatherAmount;
                if (prop.foodReward)
                {
                    PlayerData.food += gatherAmount;
                }
                if (prop.woodReward)
                {
                    PlayerData.wood += gatherAmount;
                }
                if (prop.ironReward)
                {
                    PlayerData.iron += gatherAmount;
                }

                PlayerData.updateResourceView();

                if (prop.alreadyGathered >= prop.maxGathering)
                {
                    associatedResource = null;
                }
                nextActionTime = Time.time + unitProperties.actionSpeed;
            }
        }
    }
Exemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HaloModel"/> class.
        /// </summary>
        /// <param name="entry">The model Halo 2 index entry.</param>
        public HaloModel(MapFile map, IndexEntry entry)
        {
            //Check
            if (map == null)
            {
                throw new ArgumentNullException(nameof(map));
            }
            if (entry == null)
            {
                throw new ArgumentNullException(nameof(entry));
            }
            else if (entry.Root != HaloTags.mode)
            {
                throw new ArgumentException("Index entry is not render model.", nameof(entry));
            }

            //Setup
            this.map   = map;
            this.entry = entry;
            tag        = new ModelTag(entry);
            meshes     = new Mesh[tag.Regions.Length][][];

            //Setup property accessors
            compressionInfo = new CompressionInfoProperties(this);
            regions         = new RegionProperties[tag.Regions.Length];
            for (int i = 0; i < tag.Regions.Length; i++)
            {
                regions[i] = new RegionProperties(this, i);
            }
            permutations = new PermutationProperties[tag.Regions.Length][];
            for (int i = 0; i < tag.Regions.Length; i++)
            {
                permutations[i] = new PermutationProperties[tag.Permutations[i].Length];
                for (int j = 0; j < tag.Permutations[i].Length; j++)
                {
                    permutations[i][j] = new PermutationProperties(this, i, j);
                }
            }
            sections = new SectionProperties[tag.Sections.Length];
            for (int i = 0; i < tag.Sections.Length; i++)
            {
                sections[i] = new SectionProperties(this, i);
            }
            resources = new ResourceProperties[tag.Sections.Length][];
            for (int i = 0; i < tag.Sections.Length; i++)
            {
                resources[i] = new ResourceProperties[tag.Resources[i].Length];
                for (int j = 0; j < tag.Resources[i].Length; j++)
                {
                    resources[i][j] = new ResourceProperties(this, i, j);
                }
            }

            //Loop through regions
            for (int r = 0; r < tag.Regions.Length; r++)
            {
                //Setup
                ModelTagGroup.Region region = tag.Regions[r];
                meshes[r] = new Mesh[region.Permutations.Count][];

                //Loop through permutations
                for (int p = 0; p < region.Permutations.Count; p++)
                {
                    //Setup
                    ModelTagGroup.Region.Permutation permutation = tag.Permutations[r][p];
                    meshes[r][p] = new Mesh[6];

                    //Loop through LODs
                    byte[] sourceData = null;
                    for (int l = 0; l < 6; l++)
                    {
                        //Get source data
                        int sectionIndex = -1;
                        switch (l)
                        {
                        case 0: sectionIndex = permutation.L1SectionIndex; break;

                        case 1: sectionIndex = permutation.L2SectionIndex; break;

                        case 2: sectionIndex = permutation.L3SectionIndex; break;

                        case 3: sectionIndex = permutation.L4SectionIndex; break;

                        case 4: sectionIndex = permutation.L5SectionIndex; break;

                        case 5: sectionIndex = permutation.L6SectionIndex; break;
                        }

                        //Check
                        if (sectionIndex >= 0 && sectionIndex < sections.Length)
                        {
                            //Get properties
                            ModelTagGroup.Section section = tag.Sections[sectionIndex];

                            //Check
                            if (section.RawOffset != uint.MaxValue)
                            {
                                RawLocation rawLocation = (RawLocation)(section.RawOffset & 0xC0000000);
                                if (rawLocation == RawLocation.Local)
                                {
                                    sourceData = entry.Raws[RawSection.Model][(int)section.RawOffset].ToArray();
                                }
                                else
                                {
                                    string fileLocation = string.Empty;
                                    int    rawOffset    = (int)(section.RawOffset & (uint)RawLocation.LocalMask);
                                    switch (rawLocation)
                                    {
                                    case RawLocation.Shared:
                                        fileLocation = HaloSettings.SharedPath;
                                        break;

                                    case RawLocation.Mainmenu:
                                        fileLocation = HaloSettings.MainmenuPath;
                                        break;

                                    case RawLocation.SinglePlayerShared:
                                        fileLocation = HaloSettings.SingleplayerSharedPath;
                                        break;
                                    }

                                    //Check
                                    if (File.Exists(fileLocation))
                                    {
                                        using (FileStream fs = new FileStream(fileLocation, FileMode.Open))
                                            using (BinaryReader mapReader = new BinaryReader(fs))
                                            {
                                                fs.Seek(rawOffset, SeekOrigin.Begin);
                                                sourceData = mapReader.ReadBytes((int)section.RawSize);
                                            }
                                    }
                                }
                            }

                            //Set
                            if (sourceData.Length == 0)
                            {
                                continue;
                            }

                            //Dump
                            try
                            {
                                using (FileStream fs = new FileStream(@"F:\model.bin", FileMode.Create, FileAccess.ReadWrite, FileShare.Read))
                                    fs.Write(sourceData, 0, sourceData.Length);
                            }
                            catch { }

                            //Create Mesh
                            meshes[r][p][l] = Mesh.Halo2Mesh(resources[sectionIndex], sourceData);
                        }
                    }
                }
            }
        }
Exemplo n.º 13
0
 /**
  * Creates a Resource based on the {@link ResourceProperties} definition.
  *
  * @param resourceProperties
  * @return
  * @throws UnsupportedResourcePropertiesException
  *             if the provided properties cannot be handled in creation of a
  *             resource.
  */
 public static Resource toResource(ResourceProperties resourceProperties) // throws UnsupportedResourcePropertiesException
 {
     return(ResourceFactoryRegistryImpl.getDefaultInstance().createResource(resourceProperties));
 }
Exemplo n.º 14
0
 public Task <Stream> GetStreamAsync(CancellationToken cancellationToken)
 {
     return(ResourceProperties.GetStreamAsync(cancellationToken));
 }